Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I wanted to ask how to test IP Table Rules. For example, I have a port number and I want to be sure that it accepts all packets. How can I do it?

After I type iptables -L I see that the rule has been added but I need a practical proof. Is there a way how I can do it?

I can't find online any resource about how to do that rather then to check the existence of the IP Table rule.

The rule which I wanted to test is:

sudo iptables –A INPUT –i eth0 –j ACCEPT
share|improve this question

2 Answers 2

Add a copy of the rule you wish to test with a log option "above" the actual rule. Monitor the logs.

share|improve this answer

If your Ubuntu's IP is public on Internet, you could use this tool to ping the port you want to test.

share|improve this answer
    
is it it sufficient to test it just with ping command? –  Alex Mar 3 '13 at 18:20
    
To test incoming TCP packets, yes. –  Desmond Hume Mar 3 '13 at 18:22
    
What about UDP packets? Also what if I test it with nmap -p <portNumber> <interface> and I get that the port is filtered, is it considered that the port accepted the packed? –  Alex Mar 3 '13 at 18:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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