Skip to contentSkip to conversation

NAT failure with TCP, too

DISCUSSION Bernardo Innocenti 2 participants 2 messages Oct 22, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · Cristian Grigoriu

Hi,

I can confirm the same bug you reported here http://www.ussg.iu.edu/hypermail/linux/kernel/0509.2/0279.html
This time it happens with TCP connections originating from the same TCP port (1234) from multiple machines. The SNAT simply doesn't take place and the normal routing occurs.

Kernel is Debian stock 2.6.18-1.

Please let me know if you have find a workaround.

It turned out that the real thing that was triggering the bug for me was unloading and reloading the ip_nat module without also reloading ip_conntrack.

The connection tracking tuple would remain in the kernel, visible in /proc/net/ip_conntrack, but no longer linked to the SNAT rule. I'd consider this a bug, but very few users will ever be affected.

The workaround for me was to remove my hand-cracted iptables rules from ppp's ip-up.local and move them to the distro-supplied iptables firewall instead. The only downside is that I must now hardcode the destination ip of the SNAT rule because it's too early to read the interface address of ppp0.

Signature · 2 lines
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/
#2 lore raw
Quoted 20 lines · Bernardo Innocenti
Quoted 8 lines · Cristian Grigoriu

Hi,

I can confirm the same bug you reported here http://www.ussg.iu.edu/hypermail/linux/kernel/0509.2/0279.html
This time it happens with TCP connections originating from the same TCP port (1234) from multiple machines. The SNAT simply doesn't take place and the normal routing occurs.

Kernel is Debian stock 2.6.18-1.

Please let me know if you have find a workaround.

It turned out that the real thing that was triggering the bug for me was unloading and reloading the ip_nat module without also reloading ip_conntrack.

The connection tracking tuple would remain in the kernel, visible in /proc/net/ip_conntrack, but no longer linked to the SNAT rule. I'd consider this a bug, but very few users will ever be affected.

Quoted 6 lines

The workaround for me was to remove my hand-cracted iptables rules from ppp's ip-up.local and move them to the distro-supplied iptables firewall instead. The only downside is that I must now hardcode the destination ip of the SNAT rule because it's too early to read the interface address of ppp0.

You may want to use the MASQUERADE target instead of the SNAT target.

-hpa