LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 710|回复: 3

iptable共享上网问题,紧急求助!

[复制链接]
发表于 2005-5-5 10:55:48 | 显示全部楼层 |阅读模式
脚步如下:
iptables -P INPUT DROP
iptables -A INPUT -i ! ppp0 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -i ppp0 --dport 21 -j ACCEPT
iptables -A INPUT -p tcp -i ppp0 -j REJECT --reject-with tcp-reset
iptables -A INPUT -p udp -i ppp0 -j REJECT --reject-with icmp-port-unreachable

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
前面都是好的,但执行最后一行时报错:
iptables: Invalid argument,我把最后一行拿出来分段执行,有如下报错:
iptables v1.2.9: Unkown arg '-j'
可是我记得以前用这种方法是可以共享上网的啊,兄弟们请帮帮我啊! 谢谢了!
我的系统是mandrake 10.0 official  :help  :help  :help
 楼主| 发表于 2005-5-5 11:31:47 | 显示全部楼层
刚才在netfilter官方网站找到了:
You have just upgraded your kernel and suddenly some of the commands (especially in the 'nat' table), and you experience something like:

# iptables -A POSTROUTING -t nat -o ppp0 -j MASQUERADE
iptables: Invalid argument

This happens when the structure size between kernel and userspace changes. You will need to recompile the iptables userspace program using the include files of your new kernel. This only happens if you (or the vendor of your kernel) has applied some patches either only to the old or only to the new kernel. It is not supposed to happen between vanilla kernel.org kernels. If it does, please inform the netfilter-devel mailinglist.
问题是我新装的系统,还没有作任何更新啊,难道就没有别的兄弟碰到这个问题?
现在决定更新一下系统试试!
回复 支持 反对

使用道具 举报

发表于 2005-5-5 14:28:38 | 显示全部楼层
那你就重装一下iptables就是啦(有这个包吧?),不过没道理,既然是用rpm包安装的吗,不应该关编译的事啊。你自己编译的内核?
回复 支持 反对

使用道具 举报

发表于 2005-5-10 21:50:34 | 显示全部楼层
Post by florist
刚才在netfilter官方网站找到了:
You have just upgraded your kernel and suddenly some of the commands (especially in the 'nat' table), and you experience something like:

# iptables -A POSTROUTING -t nat -o ppp0 -j MASQUERADE
iptables: Invalid argument

This happens when the structure size between kernel and userspace changes. You will need to recompile the iptables userspace program using the include files of your new kernel. This only happens if you (or the vendor of your kernel) has applied some patches either only to the old or only to the new kernel. It is not supposed to happen between vanilla kernel.org kernels. If it does, please inform the netfilter-devel mailinglist.
问题是我新装的系统,还没有作任何更新啊,难道就没有别的兄弟碰到这个问题?
现在决定更新一下系统试试!


修改一下写法


iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表