Skip to content

Instantly share code, notes, and snippets.

@nuga99
Last active December 18, 2019 06:48
Show Gist options
  • Save nuga99/3c9f281022f666de867c4a5b19defb20 to your computer and use it in GitHub Desktop.
Save nuga99/3c9f281022f666de867c4a5b19defb20 to your computer and use it in GitHub Desktop.
Iptables Configuration for Dockerize App
echo "{
\"iptables\": false
}" > /etc/docker/daemon.json
sed -i -e 's/DEFAULT_FORWARD_POLICY="DROP"/DEFAULT_FORWARD_POLICY="ACCEPT"/g' /etc/default/ufw
ufw reload
iptables -t nat -A POSTROUTING ! -o docker0 -s 172.17.0.0/16 -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment