Skip to content

Instantly share code, notes, and snippets.

@fud
Created August 2, 2016 23:25
Show Gist options
  • Select an option

  • Save fud/b160d71d64b0cba94092dc81d9032026 to your computer and use it in GitHub Desktop.

Select an option

Save fud/b160d71d64b0cba94092dc81d9032026 to your computer and use it in GitHub Desktop.
docker iptables
ubuntu@dm1a:/etc/network/interfaces.d$ sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DOCKER all -- anywhere anywhere ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DOCKER all -- anywhere !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- ip-172-17-0-0.ap-southeast-2.compute.internal/16 anywhere
MASQUERADE all -- ip-10-0-3-0.ap-southeast-2.compute.internal/24 !ip-10-0-3-0.ap-southeast-2.compute.internal/24
MASQUERADE tcp -- ip-172-17-0-3.ap-southeast-2.compute.internal ip-172-17-0-3.ap-southeast-2.compute.internal tcp dpt:https
MASQUERADE tcp -- ip-172-17-0-3.ap-southeast-2.compute.internal ip-172-17-0-3.ap-southeast-2.compute.internal tcp dpt:http
Chain DOCKER (2 references)
target prot opt source destination
RETURN all -- anywhere anywhere
DNAT tcp -- anywhere anywhere tcp dpt:https to:172.17.0.3:443
DNAT tcp -- anywhere anywhere tcp dpt:http to:172.17.0.3:80
ubuntu@dm1a:/etc/network/interfaces.d$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment