iptables: blocking multiple ports with one rule.

Asked by daniel CURTIS on 2013-04-29

Hi. I have one short question related to iptables and ports. There is many FAQ's, HowTo's on the internet, but I'm still confused. So, here is a question; let say, that I want to block port range from 100 to 200. Which rule is correct for doing this?

,-----[ block multiple ports ]
| 1) iptables -A INPUT -p tcp --match multiport --dport 100:200 -j DROP
| 2) iptables -A INPUT -p tcp -m tcp --dport 100:200 -j DROP
`-----

Sorry for such naive question. Best regards.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu iptables Edit question
Assignee:
No assignee Edit question
Solved by:
daniel CURTIS
Solved:
2013-05-13
Last query:
2013-05-13
Last reply:
daniel CURTIS (anoda) said : #1

Hi, I decided to use second variant.