https://rancher.com/ logo
Title
w

white-yacht-56857

10/25/2022, 2:36 PM
Hello guys, I need to change the default network where the desktop rancher is running. Currently my internal network uses the 172.16.0.0./12 range. Is there any way to change the default network used by Rancher Desktop? I use a Macbook
f

fast-garage-66093

10/25/2022, 3:43 PM
I don't understand the question; which network are you talking about? Are you having a routing conflict?
Or do you want Rancher Desktop to use an external IP address in your local network range for the Kubernetes ingress (traefik)?
That should happen automatically when you run Rancher Desktop with admin privileges: it will create a bridged network on the highest priority host network adapter that has an IP address when you start Rancher Desktop (so usually your Wifi or Ethernet one).
Not much more I can say without more information...
w

white-yacht-56857

10/25/2022, 4:29 PM
Sorry for not being clear, When installing rancher desktop the network used by default is 172.17.0.0.16 which conflicts with my internal network. Therefore, the containers that run inside Rancher Desktop do not communicate with external services. I need to change the network that docker climbs to when installed by rancher.
w

wide-mechanic-33041

10/25/2022, 4:34 PM
not running 1.6.1 so may have changed, but I would expect ~/Library/Application\ Support/rancher-desktop/lima/_config/networks.yaml would be where to start. I would have expected a network on the private classC though.
f

fast-garage-66093

10/25/2022, 4:37 PM
@wide-mechanic-33041 No, the
networks.yaml
is about the bridged and shared interfaces only; @white-yacht-56857's issue seems to be with the internal docker network inside the VM. Since it overlaps with his local network, he is not able to route packets to other machines on the local net.
👍 1
$ rdctl shell ip a show docker0
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
    link/ether 02:42:27:6b:85:8f brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
w

wide-mechanic-33041

10/25/2022, 4:41 PM
got it nesting dolls problem and this isn’t a route leakage, but if that container needs resources on the host routed network than you have the conflict.
f

fast-garage-66093

10/25/2022, 5:04 PM
Ok, I managed to get it to work, but this may break in future releases:
$ echo '{"bip":"172.20.0.1/16"}' | rdctl shell sudo tee /etc/docker/daemon.json
You have to execute this while Rancher Desktop is running. Then stop and restart it. Afterwards the docker bridge should use the new network range:
$ rdctl shell ip a show docker0
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
    link/ether 02:42:5f:b0:5f:23 brd ff:ff:ff:ff:ff:ff
    inet 172.20.0.1/16 brd 172.20.255.255 scope global docker0
       valid_lft forever preferred_lft forever
Note that
bip
must be a valid gateway address, so you can't specify
x.y.z.0/nn
. Don't ask me how I know! 😄
Right now we don't create
daemon.json
, but we might in the future, so blindly overwriting it as I do above may create problems.