This doesn't work fir me:

# iptables -A INPUT -p tcp --dports 110,143,993,995 -j ACCEPT

iptables v1.4.7: unknown option `--dports'
Try `iptables -h' or 'iptables --help' for more information.

However on the man page, there is an option --dports... any ideas?

Thanks!

link|improve this question

2  
Quick guess would be that you need to use the multiport module: -m multiport --dports 110,143,993,995 ... – cyberx86 Jan 24 at 15:55
@cyberx86 Yes are right :) Thanks! – Zenet Jan 24 at 15:57
feedback

2 Answers

up vote 2 down vote accepted

You have to use --match multiport in the rule for defining more ports

#iptables -A INPUT -p tcp  --match multiport --dports 110,143,993,995 -j ACCEPT
link|improve this answer
feedback

You need to specify the -m multiport module before using the dports options

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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