LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   --destination-ports port[,port[,port...]] (https://www.linuxquestions.org/questions/linux-networking-3/destination-ports-port%5B-port%5B-port-%5D%5D-158463/)

KevinGuy 03-16-2004 12:46 PM

--destination-ports port[,port[,port...]]
 
Why is it that I get this:
Code:

iptables v1.2.7a: Unknown arg `--destination-ports'
Try `iptables -h' or 'iptables --help' for more information.
DONE.

when I have this code:
Code:

$IPT -I TRAFFIC -p tcp --destination-ports 5631,5633,5635 -s 0.0.0.0 -j ACCEPT
It wont let me use multiple ports.... i have to use either --dport, or --destination-port. But this only alows me to use one single port.

Thanks

chort 03-16-2004 07:06 PM

Well according to the iptables man page it says the multiport module will allow you to use --destination-port port[,port], etc. So it looks like it shouldn't be plural (port, not ports) and you also need the multiport module for netfilter.

You could also write it in a for loop, if you wanted

for port in 5631 5633 5635 ; do $IPT -I TRAFFIC -p tcp --dport $port -s 0.0.0.0 -j ACCEPT ; done ; unset port


All times are GMT -5. The time now is 08:53 PM.