Bridged vm network broken after docker install on host

I ran at this problem lately, just want to help others.

My host run Centos7 and host vm who get their networking via a bridge connection. After deploying docker on the host I started to have issue with the networking inside my vm’s. I was able to ping the vm but no tcp connection were passing thru. That being said, it’s a bad idea to deploy docker on the host… The right way to do it is to install a vm and host your container there, always try to keep the virt host minimal.

I’m not going into details, there’s plenty of documentation on this, but docker use iptables to give containers access to the network, forward port etc… So I knew I had to mess with iptables to fix this. I’ve read and tried few suggestions on different forum/reddit/blog post without anyluck… And then I tried with firewall-cmd… It worked…

So here’s the easy fix that worked:

firewall-cmd --permanent --direct --passthrough ipv4 -I FORWARD -i br0 -j ACCEPT
firewall-cmd --permanent --direct --passthrough ipv4 -I FORWARD -o br0 -j ACCEPT
firewall-cmd --reload