Created
January 27, 2021 14:56
-
-
Save tlwr/7e27440e3e88b372a8f8e2611d6fb0f9 to your computer and use it in GitHub Desktop.
iptables
This file contains hidden or 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 INPUT -i lo -j ACCEPT # Loopback | |
iptables -A INPUT -p icmp -j ACCEPT # ICMP | |
iptables -A INPUT -p tcp -m tcp --dport 2222 -m state --state NEW,ESTABLISHED -j ACCEPT # SSH port 2222 | |
iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT # DNS response | |
iptables -A INPUT -p tcp -m tcp -m state --state ESTABLISHED -j ACCEPT # Established TCP conns | |
iptables -A INPUT -j DROP # Drop remaining traffic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment