Skip to content

Instantly share code, notes, and snippets.

@tuxmartin
Last active March 20, 2017 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxmartin/47d0b7289d052bafe551b75787ac01f5 to your computer and use it in GitHub Desktop.
Save tuxmartin/47d0b7289d052bafe551b75787ac01f5 to your computer and use it in GitHub Desktop.
#echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -X
#smaze vsechna pravidla
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
#politika firewallu
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
#mistni smycka povolena
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -m state --state=RELATED,ESTABLISHED -j ACCEPT
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i ppp0 -j ACCEPT
iptables -A INPUT -i tun0 -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-admin-prohibited
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment