-
-
Save anonymous/fed516158ec76d3167a8 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
i=/sbin/iptables | |
# Flush all rules | |
$i -F | |
$i -X | |
# Setup default filter policy | |
$i -P INPUT DROP | |
$i -P OUTPUT DROP | |
$i -P FORWARD DROP | |
# Allow established connections | |
$i -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allow unlimited traffic on loopback | |
$i -A INPUT -i lo -j ACCEPT | |
$i -A OUTPUT -o lo -j ACCEPT | |
# Open nginx | |
$i -A INPUT -p tcp --dport 443 -j ACCEPT | |
$i -A INPUT -p tcp --dport 80 -j ACCEPT | |
# Open SSH | |
$i -A INPUT -p tcp --dport 22 -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment