Created
May 24, 2020 21:35
-
-
Save Lajule/21fb494ec1143ee146a0f9f8e3b0b2c0 to your computer and use it in GitHub Desktop.
Configuration for 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 -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -t filter -A INPUT -i lo -j ACCEPT | |
iptables -t filter -A OUTPUT -o lo -j ACCEPT | |
iptables -t filter -A INPUT -p icmp -m limit --limit 5/second -j ACCEPT | |
iptables -t filter -A OUTPUT -p icmp -j ACCEPT | |
iptables -A FORWARD -o lo -j ACCEPT | |
iptables -t filter -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