(CentOS5.5)阻止xxx.xxx:
# iptables -A OUTPUT -j DROP -d xxx.xxx.xxx.xxx然后通过下列方式核实:
# iptables -L OUTPUT --line-numbers
Chain OUTPUT (policy DROP)
num target prot opt source destination
1 ACCEPT all -- anywhere anywhere
2 ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
3 DROP all -- anywhere xxx.xxx.xxx.xxx不管用,我做错什么了?
发布于 2015-03-05 09:56:51
从任何地方到表中的任何位置都有ACCEPT,因此永远不会达到匹配和DROP规则。
在本例中,使用-I而不是-A将规则插入到表的顶部。
请注意,在编写脚本时,通常最好使用-A,因为规则按照脚本中列出的规则的相同顺序添加。
https://unix.stackexchange.com/questions/188319
复制相似问题