Change docker0 network from 172.16.0.0/16 due to IP conflict

I am trying to run the Hyper-V appliance of HassOS.
But I am having som issues with the builtin docker0 bridge network.

I use a few VLANs at home all are within the 172.17.0.0/16 network. This is also the network used by docker0.

I need to figure out how to change that network. Docker has this suggestion.
So now my question is how do I find /etc/docker/daemon.json.

I took the image and booted a linux and looked around in all partitions that I could mount and didnt find anything. (windows guy so might have missed something)

I have searched for it, found things like this:

This page didnt get a answer that solves the problem.

based on the docs it look like daemon.json not exist until you create it and only thing that will exist in it is your user defined networks. same as a HA intergration .yaml file

you may also look at Portainer as it has mechanism for manage the docker networking and may simplify this.

Hi.
Thanks for the reply. I have been trying to figure this out.

Portainer does not allow for changes to docker network.

I tried to mount the disk that hass.os is running on to create the /etc/docker/daemon.json file
But I cant get it to mount RW. (/dev/sdc3 on /mnt type squashfs (ro,relatime))

I understand that the system isnt really to be changed, and I love that Idea, if I just could use it and not have an IP conflict… The depressing thing is that HA doesnt event use the docker network.

BUT you talked about a HA intergration.yaml file… I need to stop running my head into a wall, so ill look into if I can use the integration.yaml to do changes to the docker in the base.

Have you tried using Portainer? Would make this much easier.

I will test today to see if I can create docker network 173.17.0.0/16

EDIT
worked. Portainer makes this no issue.
i created a new bridge network with that IP range. I am certain if I move all Containers to that network they continue working without issue. I may test tonight but cannot now as it could bring down Services which I need for Answering My Door :slight_smile:

I will check to see how to change default “bridge” network in docker but cannot fully verify as this would break my system possibly but maybe I move to network also. I think all my stuff use hostname not docker IP so this is likely no issue for me.

Actually I think I deviated and forget you not using docker but using VM with HASS OS(docker).

In this case portainer and above cannot help but the .json suggestion still should. Originally I realize the VM but I forgot when I look back at this question. I will look at HASSOS and check this on one of my RasPi with HA to see where this file live and how changes affect it. I beileve this should be similar enough to your issue.

I know this thread is a few months old, but I’ll post what I was able to do to change the default docker bridge network.

Access the appliance using the console. For my OVA appliance, I use virt-manager; for my rpi4, I had to enable ssh to port 22222 and login (or connect a monitor and keyboard).

# vi /etc/docker/daemon.json

{
  "bip": "10.0.0.1/24",
  "default-address-pools": [
    { "base": "10.0.0.0/16", "size": 24 }
  ]
}

The bip directive sets the base ip and size of the default bridge and default-address-pools sets any other networks that might be created (by you) into a safe range.

# systemctl restart docker.service

I also had to # systemctl restart hassos-supervisor.service

Now, I need to figure out how to change the subnet of the hassio network. As I’ve migrated over to my rpi4, I will play around with my kvm appliance to see what I can do without completely locking out the system.

4 Likes

My savior… :smiley:

I have two small things that I have learnt…

  • Running hassio when you are on the console “login” is the secret word to access the machine.
  • When you do a typo and it is dead… I had to mount /dev/sda7 which is the partition where the file was…

But this will allow me to tinker and continue my Home Assistant way track

Hello everyone! I found myself in this problem too and I can’t solve it!
I also tried to do a new installation from scratch, but unfortunately I can’t even complete the installation because supervisor doesn’t have internet access!
Can anyone help me out?
Could I also have the same problem explained here?
My problems started when I changed my home internet connection provider.

This was just what I was looking for! Thanks

Only thing to mention here is that for Hassio you need to have setup your authorized_keys as documented here: Debugging the Home Assistant Operating System | Home Assistant Developer Docs

You then need to SSH in using your preferred client and create the file as described (I found that rebooting was best way to get the changes to apply)

You CAN NOT update this config using any SSH add-on via the Supervisor in Hassio.