Skip to contentSkip to conversation

Trouble with --dport

DISCUSSION blah blah 2 participants 5 messages Oct 21, 2002 1 message not in the archive

lore
Share & tools
lore

blah blah

author
#0 lore raw

I am having trouble with the following lines:

-A INPUT -i eth0 -p tcp -s 1.1.1.1 --dport 1234 -j ACCEPT
-A INPUT -i eth0 -p tcp -s 1.1.1.2 --dport 1233 -j ACCEPT

I get an error message about --dport being an unknown arg. If I use either of the 2 lines without the other they work fine. It always errors on the second line. I can reverse the order and whichever is the second line will be flagged. I am using ver 1.2.5 which came with redhat 7.3.

It looks to me like it is not loading the tcp extensions for the second rule despite the "-p tcp" being present.

Any help is appreciated. Thanks.

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

#1 lore raw
Quoted 8 lines · blah blah

I am having trouble with the following lines:

-A INPUT -i eth0 -p tcp -s 1.1.1.1 --dport 1234 -j ACCEPT
-A INPUT -i eth0 -p tcp -s 1.1.1.2 --dport 1233 -j ACCEPT

I get an error message about --dport being an unknown arg.

What actual error message do you get ?

If you can type in the commands and then cut & paste what you type and what comes back that would be good.

Quoted 1 line

If I use either of the 2 lines without the other they work fine.

To me, that says there's no "unknown argument", otherwise it would still be unknown when you haven't typed the other command....

Quoted 2 lines

It always errors on the second line. I can reverse the order and
whichever is the second line will be flagged.

Show us a cut & paste so we can see what you mean.

Antony.

Signature · 4 lines
How I want a drink, alcoholic of course, after the heavy chapters
involving quantum mechanics.

 - 3.14159265358979
#3 lore raw
In reply to a message not in the archive
Quoted 12 lines · Ivan Rodriguez Aguilar
Quoted 7 lines · Antony Stone
Quoted 6 lines · blah blah

I am having trouble with the following lines:

-A INPUT -i eth0 -p tcp -s 1.1.1.1 --dport 1234 -j ACCEPT
-A INPUT -i eth0 -p tcp -s 1.1.1.2 --dport 1233 -j ACCEPT

Yes the protocol what is tcp or udp ??
example

Quoted 2 lines

iptables -A INPUT -i eth0 -p tcp -s 1.1.1.1 -p tcp --dport 1234 -j ACCEPT

Why put "-p tcp" twice ?

The order of "-p tcp" and "-s 1.1.1.1" doesn't matter.

Antony.

Signature · 7 lines
In science, one tries to tell people
in such a way as to be understood by everyone
something that no-one ever knew before.

In poetry, it is the exact opposite.

 - Paul Dirac
author
#4 lore raw
In reply to Antony Stone

The exact error message is:
iptables-restore v1.2.5: Unknown arg --dport

Quoted 25 lines · --- Antony Stone
Quoted 8 lines · blah blah

I am having trouble with the following lines:

-A INPUT -i eth0 -p tcp -s 1.1.1.1 --dport 1234 -j ACCEPT
-A INPUT -i eth0 -p tcp -s 1.1.1.2 --dport 1233 -j ACCEPT

I get an error message about --dport being an

unknown arg.

What actual error message do you get ?

If you can type in the commands and then cut & paste what you type and what
comes back that would be good.

Quoted 1 line

If I use either of the 2 lines without the other

they work fine.

To me, that says there's no "unknown argument", otherwise it would still be
unknown when you haven't typed the other command....

Quoted 16 lines
Quoted 1 line

It always errors on the second line. I can

reverse the order and

Quoted 1 line

whichever is the second line will be flagged.

Show us a cut & paste so we can see what you mean.

Antony.

Signature · 5 lines
How I want a drink, alcoholic of course, after the
heavy chapters
involving quantum mechanics.

 - 3.14159265358979

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

#5 lore raw
Quoted 2 lines · blah blah

The exact error message is:
iptables-restore v1.2.5: Unknown arg --dport

Okay, so this is an error from iptables-restore, not the straight iptables command (which is what I'd mistakenly thought you meant at first).

What commands did you set up before using iptables-save, and what is your saved configuration ?

Antony.

Signature · 1 line
This email was created using 100% recycled electrons.