Skip to contentSkip to conversation

Command not working in latest version

DISCUSSION Storm D. J. Petersen 2 participants 2 messages Feb 18, 2003

lore
Share & tools
lore
#0 lore raw

Hi, I believe that I am having the same problem too. I have linux-2.4.20 kernel and iptables-1.2.7a

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE   returns   iptables:
Invalid argument.
I also reviewed
http://www.e-infomax.com/ipmasq/howto/c-html/ipmasq-compiling3.1.html  and
am certain the kernel is configured correctly.  Does anyone have masquerade
working in 2.4.20 kernel?
Any help would be greatly appreciate!
S.

Message: 11
From: "Paulo Jorge O. C. Matos" <[email protected]>
To: Khanh Tran <[email protected]>,
[email protected]
Subject: Re: Command not working in latest version
Date: Mon, 17 Feb 2003 23:13:37 +0000

Unfortunately enabling Full NAT into the kernel didn't solve the problem. I don't know what else to do.
Any ideas?

Best regards,
Paulo

Quoted 149 lines · Khanh Tran

Well, Full NAT might take care of your "arguments" problem. I don't know exactly what it affects, but it's NAT and that's what you are trying to do. Plus, the instructions say so! What kernel are you using? What OS/distribution?

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 6:55 PM
To: Khanh Tran; [email protected]
Subject: Re: Command not working in latest version

Quoted 2 lines

You may not have all of the proper elements compiled into your kernel.

Try:

Quoted 2 lines

http://www.e-infomax.com/ipmasq/howto/c-html/ipmasq-compiling3.1.ht
ml

Hi Khanh,

I've compiled the kernel specifically like they said in your reference except those new options of 2.4.20 but still I get 'Invalid Arguments' from iptables 1.2.7a. What's Full NAT in kernel config, is that useful for iptables?

I've run the line:

# iptables -v -t nat -A POSTROUTING -o eth1 -j SNAT --to
217.129.146.56 SNAT all opt -- in * out eth1 0.0.0.0/0 -> 0.0.0.0/0
to:217.129.146.56 iptables: Invalid Argument

This is indeed strange. Do you have any idea of what could I do now?

Is there any other iptables command line with the same outcome?

Best regards,

Paulo

Quoted 24 lines

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 11:04 AM
To: Khanh Tran; [email protected]
Subject: Re: Command not working in latest version

Quoted 1 line

You should also make sure you are loading modules ip_tables and

ip_conntrack

Quoted 1 line

before you load your other modules.

Iptables are built into the kernel, even after loading ipt_conntrack I receive invalid argument.

I just do:
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 217.129.146.56

Quoted 24 lines

First line is ok, second returns invalid argument. Getting desperate. Any ideas?

Best regards,

Paulo

Quoted 17 lines

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 9:45 AM
To: Khanh Tran; [email protected]
Subject: Re: Command not working in latest version

Quoted 6 lines

You'll now want to do:

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to $EXTIP

where eth0 is the interface going out to the Internet and $EXTIP is

the

Quoted 55 lines
Quoted 55 lines
Quoted 1 line

public IP on that interface.

Hi Khanh, strangely I still get Invalid Argument. iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 217.129.146.56

where eth1 is the interface that gives access to the internet with IP 217.129.146.56 (given by DHCP server).

Thx for your patience,

Paulo

Quoted 12 lines

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 9:00 AM
To: [email protected]
Subject: Command not working in latest version

Quoted 4 lines

Hi all,

I've changed from my old distribution to a new one that comes with

iptables

Quoted 7 lines

1.2.7a.
I have iptables in the kernel (2.4.20) and I've loaded the modules iptable_nat, ipt_REDIRECT and ipt_MASQUERADE. I had in my previous distributions the following lines:
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Quoted 8 lines

This would give total access from lan attached to eth0 to the internet through my computer. But now, line 1 executes ok, line 2 gives: iptables: Invalid Argument

If I do :
iptables -t nat -A POSTROUTING -o eth0
everything runs ok but lan has still no access to the internet as

expected.

Quoted 5 lines

What's happening, any ideas?

Best regards,

Paulo

#1 lore raw

Hi,

You should recompile userspace iptables with the new kernel headers. That will solve the problem.
Ah, your command line will not work anymore. This one should replace it (I think):
iptables -t nat -A POSTROUTING -o $EXTINT -j SNAT --to $EXTIP

$EXTINT is the interface for the internet. (eth1 in my case) $EXTIP is the IP of that interface.

I'm telling you what other told me. You seem to have the exact same configuration I have. I get no more invalid arguments after recompile but I was not yet able to share net with that line.

See that $EXTINT was eth0, now it seems to be eth1 afaik.

If you manage to work everything out send me a msg pls.

Best regards,
Paulo

Quoted 177 lines

Hi, I believe that I am having the same problem too. I have linux-2.4.20 kernel and iptables-1.2.7a

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE   returns  
iptables: Invalid argument.
I also reviewed
http://www.e-infomax.com/ipmasq/howto/c-html/ipmasq-compiling3.1.html
 and am certain the kernel is configured correctly.  Does anyone have
masquerade working in 2.4.20 kernel?
Any help would be greatly appreciate!
S.

Message: 11
From: "Paulo Jorge O. C. Matos" <[email protected]>
To: Khanh Tran <[email protected]>,
[email protected]
Subject: Re: Command not working in latest version
Date: Mon, 17 Feb 2003 23:13:37 +0000

Unfortunately enabling Full NAT into the kernel didn't solve the problem. I don't know what else to do.
Any ideas?

Best regards,
Paulo

Quoted 151 lines · Khanh Tran

Well, Full NAT might take care of your "arguments" problem. I don't know exactly what it affects, but it's NAT and that's what you are trying to do. Plus, the instructions say so! What kernel are you using? What OS/distribution?

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 6:55 PM
To: Khanh Tran; [email protected]
Subject: Re: Command not working in latest version

Quoted 2 lines

You may not have all of the proper elements compiled into your kernel.

Try:

Quoted 2 lines

http://www.e-infomax.com/ipmasq/howto/c-html/ipmasq-compiling3.1.
ht ml

Hi Khanh,

I've compiled the kernel specifically like they said in your reference except those new options of 2.4.20 but still I get 'Invalid Arguments' from iptables 1.2.7a. What's Full NAT in kernel config, is that useful for iptables?

I've run the line:

# iptables -v -t nat -A POSTROUTING -o eth1 -j SNAT --to
217.129.146.56 SNAT all opt -- in * out eth1 0.0.0.0/0 -> 0.0.0.0/0
to:217.129.146.56 iptables: Invalid Argument

This is indeed strange. Do you have any idea of what could I do now?

Is there any other iptables command line with the same outcome?

Best regards,

Paulo

Quoted 25 lines

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 11:04 AM
To: Khanh Tran; [email protected]
Subject: Re: Command not working in latest version

Quoted 1 line

You should also make sure you are loading modules ip_tables and

ip_conntrack

Quoted 1 line

before you load your other modules.

Iptables are built into the kernel, even after loading ipt_conntrack I receive invalid argument.

I just do:
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 217.129.146.56

Quoted 24 lines

First line is ok, second returns invalid argument. Getting desperate. Any ideas?

Best regards,

Paulo

Quoted 17 lines

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 9:45 AM
To: Khanh Tran; [email protected]
Subject: Re: Command not working in latest version

Quoted 6 lines

You'll now want to do:

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to $EXTIP

where eth0 is the interface going out to the Internet and $EXTIP is

the

Quoted 55 lines
Quoted 55 lines
Quoted 1 line

public IP on that interface.

Hi Khanh, strangely I still get Invalid Argument. iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 217.129.146.56

where eth1 is the interface that gives access to the internet with IP 217.129.146.56 (given by DHCP server).

Thx for your patience,

Paulo

Quoted 12 lines

Khanh Tran
Network Operations
Sarah Lawrence College

-----Original Message-----
From: Paulo J. Matos [mailto:[email protected]]
Sent: Sunday, February 16, 2003 9:00 AM
To: [email protected]
Subject: Command not working in latest version

Quoted 4 lines

Hi all,

I've changed from my old distribution to a new one that comes with

iptables

Quoted 7 lines

1.2.7a.
I have iptables in the kernel (2.4.20) and I've loaded the modules iptable_nat, ipt_REDIRECT and ipt_MASQUERADE. I had in my previous distributions the following lines:
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Quoted 8 lines

This would give total access from lan attached to eth0 to the internet through my computer. But now, line 1 executes ok, line 2 gives: iptables: Invalid Argument

If I do :
iptables -t nat -A POSTROUTING -o eth0 everything runs ok but lan has still no access to the internet as

expected.

Quoted 5 lines

What's happening, any ideas?

Best regards,

Paulo