LinuxSir.cn,穿越时空的Linuxsir!

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

iptables的问题

[复制链接]
发表于 2005-12-8 11:20:09 | 显示全部楼层 |阅读模式
我想将自己的机器配置成“用于共享intelnet连接的防火墙”
我的linux有两块网卡:eth1为外网(211.71.233.78) eth0为内网(192.168.2.1)
然后找了一台机器作为内网的机器,配置ip(192.168.2.2)
但是在编写码时出现了如下问题:
[root@zhang root]#  iptables -A INPUT -p ALL -i eth0 -s 192.168.2.0/24 -j ACCEPT
[root@zhang root]#  iptables -A INPUT -p ALL -i io -s 127.0.0.1 -j ACCEPT
[root@zhang root]#  iptables -A INPUT -p ALL -i io -s 192.168.2.1 -j ACCEPT
[root@zhang root]#  iptables -A INPUT -P ALL -i io -s 211.71.233.78 -j ACCEPT
iptables v1.2.7a: Can't use -P with -A

Try `iptables -h' or 'iptables --help' for more information.
[root@zhang root]#  iptables -A INPUT -P ALL -i eth0 -s 192.168.2.255 -j ACCEPT
iptables v1.2.7a: Can't use -P with -A

Try `iptables -h' or 'iptables --help' for more information.
这是怎么回事呢?为什么不可以使用-P,-A这两个参数呢?
发表于 2005-12-8 12:55:30 | 显示全部楼层
A append  加一条规则
P policy    设定链的默认策略
不能同时使用
回复 支持 反对

使用道具 举报

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

本版积分规则

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