Server Fault is a question and answer site for system and network administrators. 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 want to know what is the difference between these two commands

iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT


iptables -A INPUT -p tcp --dport 80 -j ACCEPT
share|improve this question
up vote 0 down vote accepted

Nothing, since the tcp match is implicit when filtering the tcp protocol.

share|improve this answer
SO IT MEANS -m option is only important for STATE matches , otherwise no need to use for tcp , udp , icmp – John Aug 26 '10 at 6:23
If either no options imply a match or if an option implies multiple matches then you need to specify a match. Otherwise, iptables will figure out what you mean in the command line. – Ignacio Vazquez-Abrams Aug 26 '10 at 6:43

Your Answer


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