# How to automatically define docker networks?

**URL:** <https://forums.suse.com/t/how-to-automatically-define-docker-networks/12566>\
**Category:** RancherOS\
**Created:** [December 3, 2018, 4:39pm UTC](https://forums.suse.com/t/how-to-automatically-define-docker-networks/12566 "2018-12-03T16:39:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael-brade](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/michael-brade/32/4680_2.png) [@michael-brade](https://forums.suse.com/u/michael-brade)\
**Post date:** [December 3, 2018, 4:39pm UTC](https://forums.suse.com/t/how-to-automatically-define-docker-networks/12566/1 "2018-12-03T16:39:51Z")

</div>

Hi, I have installed RancherOS 1.4.2. I can execute:

```auto
docker network create --driver bridge --ip-range=172.11.0.0/24 --subnet=172.11.0.0/24 mynet

```

and interestingly, this even survives a reboot. So that’s great so far.

Now I want to be able to install RancherOS with `mynet` already available, i.e., define it in `cloud-config.yml`. To my knowledge, this is not possible.

So what is the correct way to initially define a docker network in RancherOS? And how can I connect services to that network in `cloud-config.yml`?

---

<div class="post-metadata">

**Author:** ![michael-brade](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/michael-brade/32/4680_2.png) [@michael-brade](https://forums.suse.com/u/michael-brade)\
**Post date:** [December 6, 2018, 11:48am UTC](https://forums.suse.com/t/how-to-automatically-define-docker-networks/12566/2 "2018-12-06T11:48:01Z")

</div>

So… what does no answer mean? That it’s not possible at all?

---

<div class="post-metadata">

**Author:** ![Jason-ZW](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jason-zw/32/4607_2.png) [@Jason-ZW](https://forums.suse.com/u/Jason-ZW)\
**Post date:** [December 10, 2018, 3:53am UTC](https://forums.suse.com/t/how-to-automatically-define-docker-networks/12566/3 "2018-12-10T03:53:29Z")

</div>

Maybe this command is what you want: `ros install -d /dev/xxx --append "rancher.docker.bip=172.22.42.1/16"`
