• 기존 규칙 삭제

# iptables -F INPUT

# iptables -F OUTPUT

# iptables -F FORWARD

# iptables -t nat -F

 

• 새 규칙 추가

# iptables -P INPUT ACCEPT

# iptables -P OUTPUT ACCEPT

# iptables -P FORWARD DROP

# iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT

# iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

# iptables -A FORWARD -j LOG

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

 

• iptables 변경사항 저장

# service iptables save


# service iptables stop, start