Specifying a port range with iptables?

jwantz at hpcc2.hpcc.noaa.gov jwantz at hpcc2.hpcc.noaa.gov
Thu Apr 11 22:40:49 EDT 2002


Hi Doug,
You have a syntax problem I think.
The beginning of your iptables command should look like:
iptables -t nat -A PREROUTING  and so on.
Also, don't forget to use a ':' in your port range rather than a '-' like 
somebody already said
     Jim Wantz
.

On Thu, 11 Apr 
2002, Doug Lawlor 
wrote:

> Is it possible to specify a port range using iptables?  If I present
> iptables with the following line it gives me a statement something like:
> 
> iptables -A PREROUTING -t nat -p udp -d $MYIP --dport 2074 - 2076 -j DNAT --to 192.168.0.2:2074 - 2076
> 
> "Bad argument `-'
> Try `iptables -h' or 'iptables --help' for more information.  "
> 
> If I take out the spaces between the dashes:
> 
> iptables -A PREROUTING -t nat -p udp -d $MYIP --dport 2074-2076 -j DNAT --to 192.168.0.2:2074-2076
> 
> I get an invalid port specification or something to that effect.  
> 
> Any help on this would be appreciated.  
> 
> Doug
> 
> 





More information about the Speakup mailing list