论坛风格切换切换到宽版
  • 597阅读
  • 1回复

[问题求助]iptables规则的问题 [复制链接]

上一主题 下一主题
离线ilxd.
 
发帖
2128
C币
-60197
威望
412
贡献值
1
银元
-1
铜钱
4904
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
#!/bin/sh



echo "1" >;/proc./sys/net/ipv4/ip._forward.

iptables -F
iptables -X
ipt.ables -t nat -F          婚庆
iptab.les -t nat -X           建材
iptables .-P INPUT ACCEPT             电子
iptables -P OUTPUT AC.CEPT虚拟主机
iptables -P FO.R.WARD ACCEPT.
iptables -t nat -P PRER.OUTING .ACCEPT投资
iptables -t nat -P O.UTPUT ACCEP.T             汽车
ipta.bles -t nat -P POSTROUTING .ACCEPT           鲜花
#--------------------------------------------.---------------------------------------.-----------.---[成人用品]
iptables -t nat -A P.OSTROUTING -o e.th1 -m i.prange --src-range 192.168.1.40-192.168.1.154 -j MASQUERADE[成人用品]
iptables -t .nat -A POSTROUTING -o eth.1 -m iprange --src-ran.ge 192.168.1.156-192.168.1.159 -j MASQUERADE(广告)
#如果将以上两个规则写成以下的方式也会提示iptables: No chai.n/target/m.atch by that name的错误虚拟主机
#----.------.-------------------------------------------------------------------------------.-------域名
iptables -t nat -A PREROUTING -i e.th0 -p tcp -m iprange --src-range 192.168.1.40-19.2.168.1.154 --dport. 80 -j REDIRECT --to-ports 312.8--- 印刷
iptables -t nat -A. PREROU.TING -i eth.0 -p tcp -m iprange --src-range 192.168.1.156-192.168.1.1.59 --dport 80 -j REDIRECT --to-ports 3128--------------彩票
#-----.-------------------------------------.----------------.--------------------------------------域名

#以下规则设置后好象不生效
iptables -A PREROUTING -i eth1 -p tcp -d x.x.x.x --dport 80 -j DNAT --.to-destin.ation 192..168.1.145:80.
i.ptables -A PREROUTING -i eth.0 -p tcp -d x.x.x.x --dport 80 -j DNAT --to-destination 192..168.1.145:80[成人用品]

表现为:
在浏览器里输入http://x.x.x.x 网址后无法打开网页.请问有什么办法可以跟踪规则是否生效?.

请问是什么原因造成?.如何解决?.

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线mxdkey.
发帖
2108
C币
-60626
威望
400
贡献值
1
银元
-2
铜钱
4685
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
iptables -t nat -A POSTROUTING -o eth1 -m iprange --src-range 192.168.1.40-192.168.1.154 -j MASQUERADE

iptables -t nat -A POSTROUTING -o eth1 -m iprange --src-range 192.168.1.156-192.168.1.159 -j MASQUERADE

#如果将以上两个规则写成以下的方式也会提示iptables: No chain/target/match by that name的错误
复制代码

如果你的netfilter和iptables还没打iprange的补丁会出现提示iptables: No chain/target/match by that name的错误
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个