iptables 里的--sport问题

由 sjhs 在 04-19-2003 16:57 发表:

iptables 里的--sport问题

在/etc/sysconfig/iptables中有一语句

-A OUTPUT -o eth0 -p tcp -s 192.168.0.2 --sport 80 -d 192.168.0.55 -j ACCEPT

运行命令 /etc/rc.d/init.d/iptables start 时出现如下提示:

应用iptables 防火墙规则:iptables-restore v1.2.6a:Unknow arg '--sport'

Try 'iptables-restore -h' or 'iptables-restore --help' for more information [ 失败]

而我在终端下直接运行命令:iptables -A OUTPUT -o eth0 -p tcp -s 192.168.0.2 --sport 80 -d 192.168.0.55 -j ACCEPT

则可以正常,请高手帮看看是什么原因? 多谢!!1


由 BTworm 在 04-19-2003 23:46 发表:


> quote: > > * * * > > 在/etc/sysconfig/iptables中有一语句
>
> -A OUTPUT -o eth0 -p tcp -s 192.168.0.2 --sport 80 -d 192.168.0.55 -j ACCEPT > > * * *

这句少了“-m tcp”。

你可以现在终端运行:

> quote: > > * * * > > iptables -A OUTPUT -o eth0 -p tcp -s 192.168.0.2 --sport 80 -d 192.168.0.55 -j ACCEPT
>
> > > * * *

<br /

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus