LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-08-2004, 01:16 AM   #1
scs0
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Rep: Reputation: 0
iptables problem --sport not working ??


Hi people, I can't seem to find anything like this on the internet. I've just installed fedora core 2, kernel version 2.6.5-1.358 (if I remember correctly) with iptables version 1.2.9.

Now most of it works properly but when ever I try to add in --sport or --dport into one of my rules I get a bad command response and it tells me to check out the -help page.

Looked at the help page and noticed that --sport/--dport was not mentioned ..... has this been removed in iptables v1.2.9 ?? All of the tutorials I've seen still use those commands

I have tried -dport
--dport
--destination-port

Heres an example rule of mine (not working) in a script

$iptables -A FORWARD -p udp -d 203.34.44.54 --sport 53 -m state --state NEW -j ACCEPT

then when I run the script it comes up with the above error about not knowing the command --sport.

thanks for any help

PS I have reinstalled fedora but it still doesn't work.
 
Old 11-08-2004, 10:46 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Welcome to LinuxQuestions.

No, --sport is still supported in iptables 1.2.9 and the rule you've posted loads just fine. Obviously make sure that there isn't a syntax error in the rule that you're trying to load. But it sounds like you're short an iptables kernel module. Do lsmod and post all the iptables modules that you have loaded. If you have iptables built into the kernel, then look at your config and the netfilter modules should be listed there.
 
Old 11-08-2004, 07:34 PM   #3
scs0
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Hey Capt_Caveman, thanks for the reply.

Here are the results of the lsmod:

ipt_REJECT
ipt_state
ip_conntrack ipt_state
iptable_filter
ip_tables ipt_REJECT, ipt_state, iptable_filter
 
Old 11-08-2004, 07:43 PM   #4
predator.hawk
Member
 
Registered: Aug 2004
Location: USA
Distribution: FreeBSD-5.4-STABLE
Posts: 252

Rep: Reputation: 30
i'v had the same prob, try using something like iptables -p tcp --sport 5644 -j DROP or whatever. the key is adding the -p tcp switch, otherwise sport and dport don't work.
 
Old 11-08-2004, 08:02 PM   #5
scs0
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Original Poster
Rep: Reputation: 0
predator.hawk

Thanks for that, I just went back through looking at my rules and I hadn't put the -p switch in. Actually I had in one of them but not the other five rules. And I managed to post the rule with the -p switch in it above ....

Anyway thank you for your help
 
Old 11-09-2004, 09:50 PM   #6
predator.hawk
Member
 
Registered: Aug 2004
Location: USA
Distribution: FreeBSD-5.4-STABLE
Posts: 252

Rep: Reputation: 30
np, i just like helping out .
 
  


Reply


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
Using --dport --sport... When to use one or another Palula Linux - Security 7 09-02-2005 11:32 AM
iptables not working selfnet Linux - Networking 2 05-02-2005 11:23 AM
Lexar JumpDrive Sport 128MB and CentOS 4.0 linux-rulz Linux - Hardware 6 04-08-2005 06:33 AM
iptables not working with me picox Linux - Security 8 01-10-2005 02:54 AM
How do I get the Rio Sport S30S to work under Mandrake 9.2 Valshak Linux - Hardware 0 03-01-2004 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:55 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration