Skip to contentSkip to conversation

Changes in kernel >= 2.4.20 ?

DISCUSSION Martin Petruzzi 3 participants 8 messages Nov 17, 2003 – Nov 19, 2003

lore
Share & tools
lore
#0 lore raw

Hello

Apparently there have been changes in kernel since 2.4.20 concerning netfilters. NAT, masqerading, forwarding or whatever it is called does not work the same as before. I have the rules as following:

#!/bin/bash
/sbin/modprobe iptable_nat
/opt/sbin/iptables -F
/opt/sbin/iptables -X
/opt/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward
...
and so on.

This worked perfect with kernels < 2.4.20. Now I'm on 2.4.22 and NAT only works partially. The system is RH7.2. I tried the latest iptables from updates.redhat.com and also compiled the latest from netfilter.org. I had no errors at all, nor while compiling (kernel/iptables) neigther while installing or inserting the roules.

The behaviour is:
- ftp works fine
- http works partially (i.e. google works but most websites do not).
- ssh connections do work, certain commands ok, but for example "last" hangs.

This behaviour is reproducable.

Latest iptables also work fine with older kernel (that's how I run it now).

Any idea, what the problem is? What do I need to change?

Thank you very much.

Martin

#1 lore raw
Quoted 6 lines · Martin Petruzzi

Hello

Apparently there have been changes in kernel since 2.4.20 concerning netfilters. NAT, masqerading, forwarding or whatever it is called does not work the same as before. I have the rules as following:

Quoted 6 lines

#!/bin/bash
/sbin/modprobe iptable_nat
/opt/sbin/iptables -F
/opt/sbin/iptables -X
/opt/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward

Running slackware and 2.4.x kernels, I have NOT had to change my iptables
rules from 2.4.9 through 2.4.22. on iptables 1.2.7a
I have yet to upgrade to latest iptables ... but note that this is likely a
kernel config issue. ... perhaps tcp_ecn got turned on somewhere?
ipmtu issue maybe? are you on DSL?

Quoted 24 lines

...
and so on.

This worked perfect with kernels < 2.4.20. Now I'm on 2.4.22 and NAT only works partially. The system is RH7.2. I tried the latest iptables from updates.redhat.com and also compiled the latest from netfilter.org. I had no errors at all, nor while compiling (kernel/iptables) neigther while installing or inserting the roules.

The behaviour is:
- ftp works fine
- http works partially (i.e. google works but most websites do not).
- ssh connections do work, certain commands ok, but for example "last" hangs.

This behaviour is reproducable.

Latest iptables also work fine with older kernel (that's how I run it now).

Any idea, what the problem is? What do I need to change?

Thank you very much.

Martin

Signature · 6 lines
	Alistair Tonner
	nerdnet.ca
	Senior Systems Analyst - RSS
	
     Any sufficiently advanced technology will have the appearance of magic.
	Lets get magical!
#2 lore raw
In reply to Martin Petruzzi

Are you sure you're not having a PMTU problem? It's unlikely that iptables will work sometimes but not others. Try adding this rule:

$IPT -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Petruzzi
Sent: Monday, November 17, 2003 2:07 AM
To: [email protected]
Subject: Changes in kernel >= 2.4.20 ?

Hello

Apparently there have been changes in kernel since 2.4.20 concerning netfilters. NAT, masqerading, forwarding or whatever it is called does not work the same as before. I have the rules as following:

#!/bin/bash
/sbin/modprobe iptable_nat
/opt/sbin/iptables -F
/opt/sbin/iptables -X
/opt/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward ...
and so on.

This worked perfect with kernels < 2.4.20. Now I'm on 2.4.22 and NAT only works partially. The system is RH7.2. I tried the latest iptables from updates.redhat.com and also compiled the latest from netfilter.org. I had no errors at all, nor while compiling (kernel/iptables) neigther while installing or inserting the roules.

The behaviour is:
- ftp works fine
- http works partially (i.e. google works but most websites do not).
- ssh connections do work, certain commands ok, but for example "last" hangs.

This behaviour is reproducable.

Latest iptables also work fine with older kernel (that's how I run it now).

Any idea, what the problem is? What do I need to change?

Thank you very much.

Martin

#3 lore raw

Re: Changes in kernel >= 2.4.20 ? -> YES

Alistair, Mark

Quoted 5 lines · On Mon, 17 Nov 2003 08:31:21 -0500 Alistair Tonner <[email protected]> wrote:

Running slackware and 2.4.x kernels, I have NOT had to change my iptables
rules from 2.4.9 through 2.4.22. on iptables 1.2.7a
I have yet to upgrade to latest iptables ... but note that this is likely a
kernel config issue. ... perhaps tcp_ecn got turned on somewhere?
ipmtu issue maybe? are you on DSL?

Quoted 5 lines · On Mon, 17 Nov 2003 20:19:58 -0800 "Mark E. Donaldson"…

Are you sure you're not having a PMTU problem? It's unlikely that iptables will work sometimes but not others. Try adding this rule:

$IPT -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

You are both right with MTU! And, yes Alistair I am on DSL with an Alcatel Speedtouch USB.

I didn't have to add the mentioned roule to iptables, it was enough to add the mtu/mru options in the pppd-options.

For other Alcatel users reading this, put:
mtu 1430
mru 1430
...into /etc/ppp/options

You still see the messages (which confused me):
... pppd[...]: Couldn't increase MTU to 1500
... pppd[...]: Couldn't increase MRU to 1500

But then NAT/masquerading works!

This is only since kernel 2.4.20, no problem before and no matter what version of iptables.

I think the same issue concerns Fritz!DSL, a PCI card for ADSL on ISDN lines (To be checked!)

Thank you very much indeed.

Martin

#4 lore raw

Re: Changes in kernel >= 2.4.20 ? -> YES

Quoted 17 lines · Martin Petruzzi

Alistair, Mark

On Mon, 17 Nov 2003 08:31:21 -0500

Quoted 5 lines · Alistair Tonner

Running slackware and 2.4.x kernels, I have NOT had to change my
iptables rules from 2.4.9 through 2.4.22. on iptables 1.2.7a
I have yet to upgrade to latest iptables ... but note that this is
likely a kernel config issue. ... perhaps tcp_ecn got turned on
somewhere? ipmtu issue maybe? are you on DSL?

On Mon, 17 Nov 2003 20:19:58 -0800

Quoted 3 lines · Mark E. Donaldson

Are you sure you're not having a PMTU problem? It's unlikely that iptables will work sometimes but not others. Try adding this rule:

Quoted 8 lines
Quoted 2 lines

$IPT -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

You are both right with MTU! And, yes Alistair I am on DSL with an Alcatel Speedtouch USB.

I didn't have to add the mentioned roule to iptables, it was enough to add the mtu/mru options in the pppd-options.

The advantage of putting in the clamp rule is that you end up with the max
MSS possible on each connection. I've seen three different sizes on my DSL connection depending on what DsLAM I bind to on the other end. It eliminates
guessing and gets you the largest possible size. Your system (the firewall)
will always have this advantage, but you need to put the rule in the FORWARD chain so that your clients (inside) get the benefit of the largest transfer unit possible.
(i've been through a few changes lately and I tell ya .. DsLam configuration
must be a completely lost art amongst the techies... *sigh*)

Quoted 5 lines

For other Alcatel users reading this, put:
mtu 1430
mru 1430
...into /etc/ppp/options

Doing this works, but you are forcing yourself to a certain size which
1) might be smaller than optimal,
2) could change one night unexpectedly.

Personally I trust the clamp mss to mtu ... it works. (for what its worth .. my MTU is somewhat larger than that... on a GVC DSL modem to ALCATEL DsLAM)

Quoted 4 lines

You still see the messages (which confused me):
... pppd[...]: Couldn't increase MTU to 1500
... pppd[...]: Couldn't increase MRU to 1500

Normal ... pppd by default tries to make the MTU/MRU as big as possible on
these connections to increase efficiency .... its just hit a limit.

Quoted 12 lines

But then NAT/masquerading works!

This is only since kernel 2.4.20, no problem before and no matter what version of iptables.

I think the same issue concerns Fritz!DSL, a PCI card for ADSL on ISDN lines (To be checked!)

Thank you very much indeed.

Martin

Signature · 6 lines
	Alistair Tonner
	nerdnet.ca
	Senior Systems Analyst - RSS
	
     Any sufficiently advanced technology will have the appearance of magic.
	Lets get magical!
#5 lore raw

Re: Changes in kernel >= 2.4.20 ? -> YES

Quoted 5 lines · On Tue, 18 Nov 2003 20:43:18 -0500 Alistair Tonner <[email protected]> wrote:
Quoted 4 lines

For other Alcatel users reading this, put:
mtu 1430
mru 1430
...into /etc/ppp/options

Quoted 7 lines

Doing this works, but you are forcing yourself to a certain size which
1) might be smaller than optimal,
2) could change one night unexpectedly.

Personally I trust the clamp mss to mtu ... it works. (for what its worth .. my MTU is somewhat larger than that... on a GVC DSL modem to ALCATEL DsLAM)

Is there a way to find out what DSLAM device my provider has or even better what mtu it uses?

I guess/claim that the support people of my provider don't know that and it would cost me a fortune to confirm this suspect. But if I'm right, you say with the clamp rule the problem is solved (seems to by dynamic then) and I don't need to know at all? Any idea why this was no problem with kernels < 2.4.20 (only wondering, not a need to know)?

By the way, I found the number 1430 a couple of times in different other maillists to be the size always working with the Alcatel Speedtouch USB, I have no idea about a technical background of exactly that size.

Martin

#6 lore raw

Re: Changes in kernel >= 2.4.20 ? -> YES

Quoted 12 lines · Martin Petruzzi

On Tue, 18 Nov 2003 20:43:18 -0500

Quoted 9 lines · Alistair Tonner
Quoted 4 lines

For other Alcatel users reading this, put:
mtu 1430
mru 1430
...into /etc/ppp/options

Doing this works, but you are forcing yourself to a certain size which
1) might be smaller than optimal,
2) could change one night unexpectedly.

Quoted 6 lines
Quoted 3 lines

Personally I trust the clamp mss to mtu ... it works. (for what its worth .. my MTU is somewhat larger than that... on a GVC DSL modem to ALCATEL DsLAM)

Is there a way to find out what DSLAM device my provider has or even better what mtu it uses?

There is signature data in an ethereal TCP dump from the ethernet devices
that connect to the modem, but I'm not sure about what your modem does. On my GVC modem I can log into it, and it appears to be able to decode the DsLam type from what it gets on the line.

Quoted 4 lines

I guess/claim that the support people of my provider don't know that and it would cost me a fortune to confirm this suspect. But if I'm right, you say with the clamp rule the problem is solved (seems to by dynamic then) and I

it is indeed dynamic. --- I only noticed the differences due to a borked win
3.11 tcp stack. -- it REALLY doesn't behave well... (WFW ... Workgroups ..
yeah... it seemd to blatantly disregard the concept of PMTU discovery...
might not have been in there at all from the way it behaved)

Quoted 2 lines

don't need to know at all? Any idea why this was no problem with kernels < 2.4.20 (only wondering, not a need to know)?

I would suspect that you changed something in your kernel compile at 2.4.20
that caused this ... I don't think ipMTU functionality has changed much in any of the kernels from 2.4.9 up. -- possibly path ipmtu disocovery ... but not sure. -- it could be that you opened up the MTU on your LAN device and didn't notice it ...

Quoted 4 lines

By the way, I found the number 1430 a couple of times in different other maillists to be the size always working with the Alcatel Speedtouch USB, I have no idea about a technical background of exactly that size.

As I pointed out the # will vary depending on the configuration of the device
on the other end .. .look at the defined MTU of your ppp device when it comes up .. .thats your maximum ... and should always be (at least 8 bytes) less than the MTU of the ethernet device which is connected to the modem.
(on a side note ... dunno if this true for USB modems... hmm
my DSL is pppoe - my modem is connected by ethernet to a NIC on
my box .. )
MSS is MTU - (sum of all packet headers) -- i.e. PPP packet header + TCP
packet header + whatever proprietary subspecies you might have packet header
if I recall correctly .. (and if I don't someone will jump all over me) -- with DSL the ppp tunnel adds a ppp wrapper packet around the TCP/UDP/
whatever packet.(again --- if I recall correctly) this ppp packet has an 8 byte header .. .it makes life easier on the system as a whole if the TCP/UDP packets are bundled correctly at the source, and small enough to withstand having the 8 bytes wrapped around them and still fit through the PPP tunnel in a single go.

Specially considering that there are some OS out there that don't understand
the idea of PMTU discovery.

Quoted 2 lines

Martin

Signature · 6 lines
	Alistair Tonner
	nerdnet.ca
	Senior Systems Analyst - RSS
	
     Any sufficiently advanced technology will have the appearance of magic.
	Lets get magical!
#7 lore raw

Re: Changes in kernel >= 2.4.20 ? -> YES

Quoted 17 lines · On Wed, 19 Nov 2003 09:19:06 -0500 Alistair Tonner <[email protected]> wrote:
Quoted 16 lines · Martin Petruzzi

On Tue, 18 Nov 2003 20:43:18 -0500

Quoted 12 lines · Alistair Tonner
Quoted 4 lines

For other Alcatel users reading this, put:
mtu 1430
mru 1430
...into /etc/ppp/options

Doing this works, but you are forcing yourself to a certain size which
1) might be smaller than optimal,
2) could change one night unexpectedly.

Personally I trust the clamp mss to mtu ... it works. (for what its worth .. my MTU is somewhat larger than that... on a GVC DSL modem to ALCATEL DsLAM)

Quoted 7 lines
Quoted 2 lines

Is there a way to find out what DSLAM device my provider has or even better what mtu it uses?

There is signature data in an ethereal TCP dump from the ethernet devices
that connect to the modem, but I'm not sure about what your modem does. On my GVC modem I can log into it, and it appears to be able to decode the DsLam type from what it gets on the line.

And how do I get that signature? Pardon me if that is a stupid question...

Quoted 10 lines
Quoted 4 lines

I guess/claim that the support people of my provider don't know that and it would cost me a fortune to confirm this suspect. But if I'm right, you say with the clamp rule the problem is solved (seems to by dynamic then) and I

it is indeed dynamic. --- I only noticed the differences due to a borked win
3.11 tcp stack. -- it REALLY doesn't behave well... (WFW ... Workgroups ..
yeah... it seemd to blatantly disregard the concept of PMTU discovery...
might not have been in there at all from the way it behaved)

Quoted 8 lines
Quoted 2 lines

don't need to know at all? Any idea why this was no problem with kernels < 2.4.20 (only wondering, not a need to know)?

I would suspect that you changed something in your kernel compile at 2.4.20
that caused this ... I don't think ipMTU functionality has changed much in any of the kernels from 2.4.9 up. -- possibly path ipmtu disocovery ... but not sure. -- it could be that you opened up the MTU on your LAN device and didn't notice it ...

I claim no, I actually did a make oldconfig with the .config of 2.4.14 and only added the Speedtouch module, which is new since 2.4.22 (of the stable ones), and I saw the same problem on an other box with a Fritz!DSL earlier (with 2.4.20), it was just a couple of webpages that didn't work there (lots less than with my box), and the configuration (as well as the provider) were the same apart from different DSL device. Also I noticed that i.e. RedHat rpms want a kernel 2.4.20 or later with their latest iptables update, that's how I came to this idea in the beginning. But anyway, it'd just be interesting to know, not necessairy.

Quoted 5 lines
Quoted 4 lines

By the way, I found the number 1430 a couple of times in different other maillists to be the size always working with the Alcatel Speedtouch USB, I have no idea about a technical background of exactly that size.

Quoted 16 lines

As I pointed out the # will vary depending on the configuration of the device
on the other end .. .look at the defined MTU of your ppp device when it comes up .. .thats your maximum ... and should always be (at least 8 bytes) less than the MTU of the ethernet device which is connected to the modem.
(on a side note ... dunno if this true for USB modems... hmm
my DSL is pppoe - my modem is connected by ethernet to a NIC on
my box .. )
MSS is MTU - (sum of all packet headers) -- i.e. PPP packet header + TCP
packet header + whatever proprietary subspecies you might have packet header
if I recall correctly .. (and if I don't someone will jump all over me) -- with DSL the ppp tunnel adds a ppp wrapper packet around the TCP/UDP/
whatever packet.(again --- if I recall correctly) this ppp packet has an 8 byte header .. .it makes life easier on the system as a whole if the TCP/UDP packets are bundled correctly at the source, and small enough to withstand having the 8 bytes wrapped around them and still fit through the PPP tunnel in a single go.

Thank you for the explanation.

Quoted 2 lines

Specially considering that there are some OS out there that don't understand
the idea of PMTU discovery.

Martin