|
发表于 2006-6-6 18:04:33
|
显示全部楼层
要解决两个问题
第一是实现对内对外的网络服务
第二是构建网络数据转发,实现内网访问外网.
iptables -A INPUT DROP
iptables -A OUTPUT DROP
iptables -A FORWARD DROP
iptables –A INPUT –p tcp –m multiport --dport 80,21,25,110 –j ACCEPT
打开WWW,FTP,SMTP,POP3服务
iptables –A OUTPUT –p tcp –m multiport --sport 80,21,25,110–j ACCEPT
iptables –A OUTPUT –p tcp –m state --state ESTABLISHED –j ACCEPT
iptables –A INPUT –p udp –m multiport --dport 25 –j ACCEPT
打开SMTP
iptables –A OUTPUT –p udp –m multiport --sport 25 –j ACCEPT
iptables –A OUTPUT –p udp –m state --tate ESTABLISHED –j ACCEPT
iptables –A INPUT –i lo –j ACCEPT
iptables –A OUTPUT –o lo –j ACCEPT
如果是被动FTP则:
iptables –A INPUT –p tcp –dport 1024: -j ACCEPT
iptables –A OUTPUT –p tcp --sport 1024: –m state --state ESTABLISHEED -j ACCEPT
同时添加跟踪模块 modprobe ipt_conntrack_ftp modprobe ipt_nat_ftp
内网转发
iptables -A FORWARD -d 192.168.5.0/24 -j ACCEPT
iptables -A FORWARD -o eth0(192.168.0.100) -j ACCEPT
iptables –t nat –A POSTROUTING –s 192.168.5.0/24 –j SNAT --to –source 192.168.0.100
同时打开echo “1” > /proc/sys/net/ipv4/ip_forward
或在/etc/sysctl.conf 中net.ipv4.ip_forward=1重启计算机
试试再说吧,不行再发信息.
劝你用VSFTP,
POSTFIX我从来没用过,,不知道效果怎样? |
|