Drop INPUT, FORWARD
# iptables -P INPUT DROP
# iptables -P FORWARD DROP
Accept establised
# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Accept loopback
# iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo -j ACCEPT
Accept SSH
# iptables -A INPUT -p tcp --dport 22 -i eth0 -j ACCEPT
Accept ICMP
# iptables -A INPUT -p icmp -j ACCEPT
View
# iptables -L
With line numbers
# iptables -L --line-numbers
Save
# iptables-save > /root/fw.conf
To enable on next boot, add line to
/etc/rc.d/rc.local
iptables-restore < /root/fw.conf
Nav komentāru:
Ierakstīt komentāru