Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .