r/LinuxContainers • • Nov 02 '18
Installing Docker breaks my LXCs bridge to the LAN/DHCP - how to get them living side by side?
I have a home microserver set up so all it's networking goes through a bridge, which allows my lxc containers to fetch an IP through DHCP on my router (router applies static IP via mac address). Essentially what this blog post describes.
But every time I install Docker it creates its own bridge and breaks LXC container networking. So I uninstall and fix things...
I'd really like to play with docker, if nothing else it would make some app installs easier. So I'm looking for advice on getting both running side by side.
Have you done it? Can containers still fetch an IP via DHCP? How?
TIA
1
u/[deleted] Nov 08 '18
Hadn't realized how man iptables rules docker inserts. Turns out they somehow block either incoming or outgoing traffic to the LXC containers.
I've told the docker daemon not to mess with iptables by creating /etc/docker/daemon.json with the contents:
After a reboot my lxc containers can one again grab an IP from the router.
Downside will be the need to manually manage iptables for any docker containers I install.
1
u/[deleted] Nov 02 '18
Why do you use that blog post's recommendations rather than using the
lxcbr0option?Can you install Docker within a container? That is less likely to mess with your host networking.
This information may help diagnose the issue:
Compare between before and after Docker creates its bridge.