Created
April 11, 2018 07:00
-
-
Save liruqi/1f97edf330241502899e9e7486fe32b6 to your computer and use it in GitHub Desktop.
iptables disable non-http(s) traffic
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
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT | |
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT | |
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT | |
iptables -A OUTPUT -p tcp -j REJECT --reject-with tcp-reset | |
iptables -A FORWARD -p tcp --dport 80 -j ACCEPT | |
iptables -A FORWARD -p tcp --dport 443 -j ACCEPT | |
iptables -A FORWARD -p tcp -j REJECT --reject-with tcp-reset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment