Created
June 23, 2020 11:47
-
-
Save andygock/1855ad9ccb2625372f2483c61cbee0f6 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
# Flush tables | |
iptables -F | |
# Allow established connections | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allow SSH, VNC, Web etc | |
iptables -A INPUT -p tcp --dport ssh -j ACCEPT | |
# iptables -A INPUT -p tcp --dport 5900 -j ACCEPT | |
# iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
# iptables -A INPUT -p tcp --dport 443 -j ACCEPT | |
# Ping, from anywhere | |
iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT | |
iptables -A OUTPUT -p icmp --icmp-type 0 -j ACCEPT | |
# Accept all from localhost | |
iptables -A INPUT -i lo -j ACCEPT | |
iptables -A OUTPUT -o lo -j ACCEPT | |
# Drop everything else | |
iptables -A INPUT -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment