Forked from paladini/IPTables - Block all websites except some of them
Created
August 26, 2019 08:37
-
-
Save kelixlabs/e70bceb88512991c6a0b47b3b2e8f0f5 to your computer and use it in GitHub Desktop.
IPTables - Blocking all websites except a few of them.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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