LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-10-2011, 02:45 PM   #1
toma20082010
LQ Newbie
 
Registered: Feb 2011
Posts: 22

Rep: Reputation: 0
Thumbs up 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,,
 
Old 03-10-2011, 03:00 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Kubuntu
Posts: 1,190

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
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.

Last edited by eSelix; 03-10-2011 at 03:02 PM.
 
1 members found this post helpful.
  


Reply

Tags
firewall, iptables, port


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTables+Firewall rashid_47010 Linux - Networking 6 08-15-2009 12:20 AM
Iptables with iptables-firewall.conf arno's matt3333 Slackware 16 06-28-2007 07:20 AM
IPTABLES firewall Vs rc firewall netguy2000 Linux - Security 7 02-28-2004 04:31 AM
Firewall/iptables brentos Linux - Security 14 11-25-2003 05:47 PM
rc.firewall vs iptables dunmarie Linux - Security 2 10-09-2003 02:00 PM


All times are GMT -5. The time now is 02:30 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration