-   Linux - Newbie (
-   -   iptables\firewall issue (

toma20082010 03-10-2011 02:45 PM

iptables\firewall issue
hey there everybody,

i've an issue in a firewall command i hope u help me on.

when i try to type the following firewall command:
iptables -A INPUT -s -dport 8000:9000 -p tcp -j ACCEPT

it gives me:
Bad argument `8000:9000`

it complaints about the port range and i cant see in problems in that.
i also tried to change the order of the options but it never worked.

one other thing,
why it don't allow me to add -sport option in the above command?

thank u very much,,

eSelix 03-10-2011 03:00 PM


iptables -A INPUT -s -p tcp --dport 8000:9000 -j ACCEPT
Double dash and -p argument position before --dport. For source port also is double dashes needed --sport. The general rule is one dash for single letter option and two dashes for multiple letters option names.

All times are GMT -5. The time now is 05:06 AM.