我已将规则添加到iptables
文件中,但该命令未显示它。
$ sudo less /etc/sysconfig/iptables
Generated by iptables-save v1.4.7 on Fri Oct 24 13:28:48 2014
*filter
:INPUT ACCEPT [759586734:591152083716]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [753755282:560671783214]
-A INPUT -s 93.114.45.59/32 -j DROP
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
答案1
service iptables restart
将其添加到文件后你做了吗?该文件仅用于持久配置。如果您想使其处于活动状态,则必须重新启动该服务。
答案2
您可以尝试-v
以下选项iptables
:
iptables -L -v