[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to filter more than 1 port in one line

hi there!!
im trying to filter ports on my firewall
but i would like to close more than one port in one line of my script
chek here
iptables -A  FORWARD -s -p tcp --dport 8000 -d -j DROP

now i want to add in that line the port 5000 8888
50001 and other else
how can i do that ?
i all ready try with "," but no working

any advice?
You need to use the module "multiport" eg:

iptables -t filter -A INPUT -p tcp -m multiport --dports 5000,8000 -j DROP

Note that when you use -m multiport the module multiport is loaded and
then you need to use --dports (not --dport).

You will find this and more running:

iptables -m multiport --help

Maxwillian Miorim <miorimmax@gmail.com>
* Slackware 10.2/current
* OpenBSD 3.9
* Debian SID

Todo software em C deveria iniciar com um:
#ifdef WIN32
 printf(" Hey, what about a real OS?\n ");

Reply to: