Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kelixlabs/e70bceb88512991c6a0b47b3b2e8f0f5 to your computer and use it in GitHub Desktop.

Select an option

Save kelixlabs/e70bceb88512991c6a0b47b3b2e8f0f5 to your computer and use it in GitHub Desktop.

Revisions

  1. @paladini paladini revised this gist Jun 28, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions IPTables - Block all websites except some of them
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    // 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.*.*
  2. @paladini paladini revised this gist Jun 28, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions IPTables - Block all websites except some of them
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    iptables -I OUTPUT -p tcp -m tcp --dport 443 -j REJECT --reject-with icmp-port-unreachable
    iptables -I OUTPUT -p tcp -m tcp --dport 80 -j REJECT --reject-with icmp-port-unreachableBlock
    iptables -A OUTPUT -s 150.162.0.0/16 -j ACCEPT
    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.*.*
  3. @paladini paladini created this gist Jun 28, 2015.
    3 changes: 3 additions & 0 deletions IPTables - Block all websites except some of them
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    iptables -I OUTPUT -p tcp -m tcp --dport 443 -j REJECT --reject-with icmp-port-unreachable
    iptables -I OUTPUT -p tcp -m tcp --dport 80 -j REJECT --reject-with icmp-port-unreachableBlock
    iptables -A OUTPUT -s 150.162.0.0/16 -j ACCEPT