0

I have added the rule to iptables file, however the command does not show it.

$ 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  
0

did you do a service iptables restart after adding it to the file? That file is just for the persistent configuration. If you want to make it active you have to restart the service.

-1

You can try the -v option of iptables:

iptables -L -v

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.