【发布时间】:2013-06-14 03:19:45
【问题描述】:
我正在使用 CentOS。
我在我的 IPTable 测试环境中完成了以下操作。我已经使用
刷新了所有规则 iptables -F
然后我添加了以下规则。
iptables -I INPUT -p all -j ACCEPT
然后根据观察,我添加了这条规则;
iptables -A INPUT -s 192.168.2.50 -j DROP
我已经运行了
service iptable save
之后我尝试 ping 被阻止的 ip (192.168.2.50)。我还是能ping通,被屏蔽的ip也能ping通。
我想阻止来自被阻止 IP 的任何传入连接。
这是 iptables -L
的输出 Chain INPUT (policy DROP) target prot opt source destination
ACCEPT all -- anywhere anywhere
DROP all -- 192.168.2.50 anywhere
Chain FORWARD (policy DROP) target prot opt source destination
Chain OUTPUT (policy ACCEPT) target prot opt source destination
Chain icmp_packets (0 references) target prot opt source destination
Chain tcp_packets (0 references) target prot opt source destination
请帮忙..谢谢..
【问题讨论】:
-
你有多个接口吗?
-
没有。只有一个 1. eth0 接口而已。如果我有多个接口会有什么区别?