|
|

楼主 |
发表于 2005-5-20 11:50:10
|
显示全部楼层
Post by faint
打开FORWARD
iptables -A FORWARD -p tcp -d $你的内网服务ip --dport $你的内网服务端口 -m state --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
还是不行啊,我把下面的内容加到脚本里,还是不行
$IPT -A FORWARD -p tcp -d $www_server --dport $http -m state --state NEW -j ACCEPT
$IPT -A FORWARD -p tcp -d $sql_server --dport $sql -m state --state NEW -j ACCEPT
$IPT -A FORWARD -p tcp -d $ftp_server --dport $ftp -m state --state NEW -j ACCEPT
$IPT -A FORWARD -p tcp -d $email_server --dport $smtp -m state --state NEW -j ACCEPT
$IPT -A FORWARD -p tcp -d $email_server --dport $pop3 -m state --state NEW -j ACCEPT
$IPT -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
--state NEW的NEW是什么啊?
运行iptables -L的显示:
[root@as3 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT udp -- dns-zhonggc.bj.cncnet.net anywhere udp spt:domain
ACCEPT udp -- dns-jinrj.bj.cncnet.net anywhere udp spt:domain
ACCEPT tcp -- anywhere anywhere tcp spt:http
ACCEPT tcp -- anywhere anywhere tcp spt:ftp
ACCEPT tcp -- anywhere anywhere tcp spt:smtp
ACCEPT tcp -- anywhere anywhere tcp spt:pop3
ACCEPT tcp -- anywhere anywhere tcp spt:ms-sql-s
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.35.7 tcp dpt:http state NEW
ACCEPT tcp -- anywhere 192.168.35.201 tcp dpt:ms-sql-s state NEW
ACCEPT tcp -- anywhere 192.168.35.7 tcp dpt:ftp state NEW
ACCEPT tcp -- anywhere 192.168.35.7 tcp dpt:smtp state NEW
ACCEPT tcp -- anywhere 192.168.35.7 tcp dpt:pop3 state NEW
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@as3 ~]#
iptables -t nat -L没什么变化
[root@as3 ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere 218.107.130.52 tcp dpt:ms-sql-s to:192.168.35.201:1433
DNAT tcp -- anywhere 218.107.130.52 tcp dpt:http to:192.168.35.7:80
DNAT tcp -- anywhere 218.107.130.52 tcp dpt:ftp to:192.168.35.7:21
DNAT tcp -- anywhere 218.107.130.52 tcp dpt:smtp to:192.168.35.7:25
DNAT tcp -- anywhere 218.107.130.52 tcp dpt:pop3 to:192.168.35.7:110
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- anywhere anywhere to:218.107.130.52
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@as3 ~]# |
|