# 1. clear all the rules iptables -F iptables -X iptables -Z
# 2. set the policy iptables -P INPUT DROP iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT
# 3~5. set various rules iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -s 192.168.1.1 -j ACCEPT iptables -A INPUT -i eth0 -s 192.168.1.0/24 -j DROP
# 6. write in the firewall's configure file /sbin/iptables-save