LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   iptables\firewall issue (http://www.linuxquestions.org/questions/linux-newbie-8/iptables%5Cfirewall-issue-867774/)

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 xxx.xxx.xxx.xxx -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

Code:

iptables -A INPUT -s xxx.xxx.xxx.xxx -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 02:46 AM.