https://rancher.com/ logo
m

mysterious-controller-97665

06/02/2022, 6:24 PM
Hi, I installed Rancher desktop version 1.3.0 for Windows 10. I need to change the docker0 bride ip range used by the daemon that is currently using 172.17.0.1. It is blocking my connection to another system that has 172.17 in it's address. Here are the steps I attempted to change the configuration: 1. Created a /etc/docker/daemon.json file setting the bip to another ip address. 2. Created a /etc/default/docker file with the contents: DOCKER_OPTS="--config-file=/etc/docker/daemon.json" 3. Edited the /etc/default/docker file with the contents: DOCKER_OPTS="--bip=172.18.0.0/16" None of these changed the daemon to use a different ip address than 172.17.0.1 for the docker0 bridge. I'm not sure what steps I need to take to change it.
I just tried with the daemon.json set to:
Copy code
{
  "default-address-pools": [
    {
      "base": "172.27.0.0/12",
      "size": 20
    },
    {
      "base": "192.168.0.0/16",
      "size": 24
    }
  ]
}
that didn't work either
Any help would be appreciated.
j

jolly-forest-99711

06/03/2022, 4:46 PM
I assume you're creating these files inside the rancher desktop WSL distribution? Otherwise it wouldn't make sense. But if you're doing that, I'm not sure how that would affect the host networking. I'm not familiar with Windows networking - @calm-sugar-3169 do you have any idea how to get this to work?
m

mysterious-controller-97665

06/06/2022, 1:30 PM
Yes, these files are in the WSL2 as I found no other instructions on how to configure it
Ok, I'm not seeing anything posted on how to solve this. I'll have to try either Docker or another alternative to see if I can get it to work
c

calm-sugar-3169

06/07/2022, 10:55 PM
@mysterious-controller-97665 have you tried adding the
--bip 192.168.0.0/16
argument directly to dockerd in the docker startup service to see if that makes any difference?
m

mysterious-controller-97665

06/08/2022, 12:53 PM
@calm-sugar-3169 where would I set that in Rancher? I tried setting that in the /etc/default/docker file in WSL2
r

rapid-helmet-86074

06/08/2022, 2:52 PM
I'm not sure with Docker Desktop's moby, but when I was having problems with a cluster of CentOS 7 with Docker CE 19 I found https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/ as official doc & https://serverfault.com/questions/916941/configuring-docker-to-not-use-the-172-17-0-0-range mentioned another useful option, so I ended up with
/etc/docker/daemon.json
like:
Copy code
{
  "live-restore": false,
  "bip": "192.168.1.1/24",
  "default-address-pools": [
    {
      "base": "192.168.2.0",
      "size": 24
    },
    {
      "base": "192.168.3.0",
      "size": 24
    }
  ]
}
That worked well enough for me. The docker0: interface in this example would get 192.168.1.0/24 net, and the first two
docker network create
commands would get the other two networks (if something did a third one it'd go back to 172.17.0.1, though so periodically we did end up with odd issues from that).
(This was for a DC/OS cluster, a distribution of Apache Mesos which is cluster orchestration that generally lost to Kubernetes, so that's why I did the live-restore false as well as we were getting zombie containers if the docker daemon got restarted from Mesos starting it elsewhere while the original one was kept alive.)
180 Views