Skip to content

Instantly share code, notes, and snippets.

@Lajule
Created May 24, 2020 21:35
Show Gist options
  • Save Lajule/21fb494ec1143ee146a0f9f8e3b0b2c0 to your computer and use it in GitHub Desktop.
Save Lajule/21fb494ec1143ee146a0f9f8e3b0b2c0 to your computer and use it in GitHub Desktop.
Configuration for iptables
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