Why would certain packets not reach nat PREROUTING chain?
Quoted 4 lines · Leonardo Rodrigues Magalhes
Adam, have you tried adding a properly PREROUTING rule for this
specific traffic ? It would be like
iptables -t nat -A PREROUTING -p udp -dEXTERNAL_IP_OF_NAT_BOT--dport 500 -j DNAT --toLOCAL_CLIENT
I have tried that--same result. In fact, I've tried creating a "tunnel" between the internal and external client by leaving out the port limitation, i.e.:
iptables -t nat -A PREROUTING -s SERVER_IP -j DNAT --to LOCAL_CLIENT
None of these have any effect because the packets never reach the nat PREROUTING chain. If I put a LOG rule at the start of nat PREROUTING, I don't see the inbound packets from the server on the Internet. (I do see those packets in the mangle PREROUTING though).
Quoted 3 lines
Other test I would suggest ....... have you tried some other UDP
traffic, just like DNS and see if it works ? Have you tried some TCP traffic and see if it works fine ?
Everything else seems to work fine. I have another internal box to which certain ssh connections from the Internet go, and that's fine. I'm not sure exactly how I'd test other UDP traffic... Certainly UDP traffic that is FORWARDed through the NAT box (e.g., RealPlayer streams) seems fine.
Signature · 2 lines
Adam Rosi-Kessel http://adam.rosi-kessel.org
Hello Adam,
Look at point 6.3 here:
http://iptables-tutorial.frozentux.net/iptables-tutorial.html
There was smth in the tutorial about only the first packet from NEW connection hitting the chains and the rest of them being handled by conntrack, although can't remember where exactly this was located in tutorial.
This would explain the UDP traffic being handled in its entirety since UDP is connectionless and conntrack.
Note that this is my hypothesis, it's not like I have tested this thoroughly.
Regards,
Marcin
Sunday, December 18, 2005, 2:16:21 PM, you wrote:
Quoted 4 lines · Leonardo Rodrigues Magalhes
Quoted 4 lines
Adam, have you tried adding a properly PREROUTING rule for this
specific traffic ? It would be like
iptables -t nat -A PREROUTING -p udp -dEXTERNAL_IP_OF_NAT_BOT--dport 500 -j DNAT --toLOCAL_CLIENT
ARK> I have tried that--same result. In fact, I've tried creating a "tunnel" ARK> between the internal and external client by leaving out the port ARK> limitation, i.e.:
ARK> iptables -t nat -A PREROUTING -s SERVER_IP -j DNAT --to LOCAL_CLIENT
ARK> None of these have any effect because the packets never reach the nat ARK> PREROUTING chain. If I put a LOG rule at the start of nat PREROUTING, I ARK> don't see the inbound packets from the server on the Internet. (I do see ARK> those packets in the mangle PREROUTING though).
Quoted 3 lines
Quoted 3 lines
Other test I would suggest ....... have you tried some other UDP
traffic, just like DNS and see if it works ? Have you tried some TCP traffic and see if it works fine ?
ARK> Everything else seems to work fine. I have another internal box to which ARK> certain ssh connections from the Internet go, and that's fine. I'm not ARK> sure exactly how I'd test other UDP traffic... Certainly UDP traffic that ARK> is FORWARDed through the NAT box (e.g., RealPlayer streams) seems fine.
Signature · 2 lines
Best regards, Marcin mailto:[email protected]
Quoted 9 lines · Marcin Krol
Hello Adam,
Look at point 6.3 here:
http://iptables-tutorial.frozentux.net/iptables-tutorial.html
There was smth in the tutorial about only the first packet from NEW connection hitting the chains and the rest of them being handled by conntrack, although can't remember where exactly this was located in tutorial.
This would explain the UDP traffic being handled in its entirety since UDP is connectionless and conntrack.
Hi Marcin:
I'm not exactly sure what you mean by the last sentence--did you leave off a word or two?
I think what you're saying is that the subsequent packets aren't showing up in nat PREROUTING because they're being tracked. This makes sense--once a connection is tracked or ASSURED the packets don't go through nat PREROUTING anymore. And the connection in question *is* being tracked -- it shows up in /proc/net/ip_conntrack as ASSURED.
Even though the connection is tracked, the traffic *doesn't* show up when watching the inward facing network card with ethereal or tcpdump. With other tracked connections (for example, an ssh or http connection) I see all traffic with tcpdump: coming from internal client to nat box, nat box to external server, then back from external server to nat box, and from nat box to internal client. With this connection, however, I see 3 out of 4 with tcpdump -- the traffic comes back into the nat box from the outside, is apparently properly tracked according to /proc/net/ip_conntrack, but it never leaves again on the internal facing network card.
Signature · 2 lines
Adam Rosi-Kessel http://adam.rosi-kessel.org
I'm following up on a thread that started at
<https://lists.netfilter.org/pipermail/netfilter/2005-November/063703.html>.
The problem was trying to connect to a SonicWALL VPN through a NAT box running iptables. Packets went from client to NAT box, then NAT box to VPN server, then back from the VPN serve to the NAT box, but disappeared into an abyss somewhere between mangle PREROUTING and nat PREROUTING. The connection showed up as tracked in /proc/net/ip_conntrack, but tcpdump showed no packets going out the inward facing ethernet card.
As it turns out, an upgrade to 2.6.15.1 seems to have totally fixed the problem. I also went through the kernel options one-by-one and turned off absolutely everything that was not essential for the server. So either explanation could account for the fix.
People had suspected before that the Debian stock kernel IPSec functionality was getting in the way; the Debian kernel does come with IPSec modules but none of them were loaded.
In any case, I thought I'd just post this to put some finality to the discussion. Thanks for everyone who helped earlier.
Signature · 2 lines
Adam Rosi-Kessel http://adam.rosi-kessel.org