[SOLVED] 'docker swarm init' broke vm networking

Feb 3, 2018
6
1
6
34
Firstly, I know now that my setup is not up to regs, but I'm not at a point right now where I can correct it until I'm back in some kind of working order.

Explaining my issue starts with revealing my docker env is running on the host system and not in a vm. This 'hadn't' been an issue until last night when started playing around with docker swarm and ran docker swarm init --advertise-addr {ipaddress}. This instantly broke my connection to my server so I got on the console and ran docker swarm leave -f. This got me back in the gui after a restart but currently none of my vms seem to be attaching to their assigned vmbr. They can't ping the host, gateway, or even other vms attached the same bridge.

I now know that the docker init command takes over the interface and that is why it broke my connection but what I don't understand (and more critically how to undo) is the damage it did to vm networking after undoing the init.

My networking config still seem valid as my docker clients that are networked via the same vmbr's are working just fine. Further the proxmox GUI is connected via a vmbr as well and that's also up and running. My issue as best as I can narrow it down is that no mater how I modify or recreate vmbr's or the nic's on my vms they never truly get attached to the bridges.

Anyone have any idea what is going on here? I'm happy to post configs as needed but at this point I'm not sure what ones would be of any help.
  • Proxmox: Virtual Environment 6.3-6 / 5.4.106-1-pve
  • Docker: 20.10.5, build 55c4c88
 
UPDATE:

Maybe the solution, maybe unrelated.

I noticed a docker network called [B]docker_gwbridge and with some googling found out that this network was made during the init. Deleting it did not fix my networking issue at first, but after a restart the networking is back up now.

Unsure what the real solution is but I'll leave this up just in case it helps some poor soul in the future.[/B]
 
  • Like
Reactions: jacks
This is a top hit on google so I figured I'd post the solution I found here. I also ran the issue of vms losing network access when the host machine joins a docker swarm. I had to turn on ip forwarding and then vms got their network access again. Add these lines to /etc/sysctl.conf

Code:
net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1

Then reboot the host or run
Code:
sysctl -p
 
  • Like
Reactions: jacks

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!