Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paladini/abfe36d71cf24a56cc44 to your computer and use it in GitHub Desktop.
Save paladini/abfe36d71cf24a56cc44 to your computer and use it in GitHub Desktop.
IPTables - Blocking all websites except a few of them.
// This isn't the final version of the script. The third may be incorrect.
iptables -I OUTPUT -p tcp -m tcp --dport 443 -j REJECT --reject-with icmp-port-unreachable // blocking https sites
iptables -I OUTPUT -p tcp -m tcp --dport 80 -j REJECT --reject-with icmp-port-unreachableBlock // blocking http sites
iptables -A OUTPUT -s 150.162.0.0/16 -j ACCEPT // accepting ips from 150.162.*.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment