Skip to content

Instantly share code, notes, and snippets.

@mikhail-angelov
Created February 26, 2021 12:32
Show Gist options
  • Save mikhail-angelov/1e6bb89eb14741a331132f8abc142df2 to your computer and use it in GitHub Desktop.
Save mikhail-angelov/1e6bb89eb14741a331132f8abc142df2 to your computer and use it in GitHub Desktop.
iptable docker
#to disable external export port
iptables -I DOCKER 1 -i eth0 -p tcp --dport 5432 -j DROP
#to allow export port for particular IP
iptables -I DOCKER 1 --src 195.201.137.198 -m tcp -p tcp --dport 5432 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment