Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@BirkhoffLee
Last active December 5, 2018 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BirkhoffLee/7ad80bf0b17b2af03ca604b8b69fed57 to your computer and use it in GitHub Desktop.
Save BirkhoffLee/7ad80bf0b17b2af03ca604b8b69fed57 to your computer and use it in GitHub Desktop.
CentOS firewalld + Docker companion
cp /etc/docker/daemon.json /etc/docker/daemon.json.old
echo '{"iptables": false}' > /etc/docker/daemon.json
firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -o eth0 -j MASQUERADE # this enables containers access outside internet
firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment