iptables (etc/sysconfig)
:PREROUTING ACCEPT [1:78]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -s 192.168.2.0/24 -o eth1 -j MASQUERADE
-A POSTROUTING -s 192.168.2.0/24 -o eth0 -j MASQUERADE
# NIC 1 route 去NIC 0
COMMIT
# Completed on Tue Oct 25 04:52:48 2011
# Generated by iptables-save v1.4.7 on Tue Oct 25 04:52:48 2011
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [3:220]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
# Accept DNS client request
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
# Accept HTTP request
-A INPUT -j REJECT
-A FORWARD -j ACCEPT
COMMIT
留言列表