All of lore.kernel.org
 help / color / mirror / Atom feed
* Why would certain packets not reach nat PREROUTING chain?
@ 2005-11-10  1:57 Adam Rosi-Kessel
  2005-11-10  1:59 ` Adam Rosi-Kessel
  2005-11-10 10:15 ` Sandro Dentella
  0 siblings, 2 replies; 32+ messages in thread
From: Adam Rosi-Kessel @ 2005-11-10  1:57 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

I'm troubeshooting an issue of accessing a VPN through NAT. Right now the
problem can be reduced to the following question:

Under what conditions would inbound packets not be routing through the nat
PREROUTING chain?

These packets are arriving on inbound UDP port 500. They show up with
tcpdump, but when I add a log rule, e.g.

iptables -t nat -I PREROUTING -p udp -j LOG

The packets are not logged.  (They are also not DNAT'd to the proper
internal host, but that makes sense if they're not reaching the PREROUTING
chain at all).

I have nothing in the mangle table.

I am not running any IPSec services on the NAT box.

There is nothing between the NAT box and the Internet.

Most of the iptables tutorials warn against filtering in nat PREROUTING,
because "it will be bypassed in certain cases."  But what cases are those?

The iptables LOG targets are working generally--traffic coming from the
internal client to the NAT box and then the NAT box to the external VPN
server are all logged.  The only thing that is not being logged--and
presumably not arriving at the nat PREROUTING chain--are the inbound
packets.  Yet they are definitely arriving, as tcpdump -i eth0 indicates.

Any suggestions?
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: Why would certain packets not reach nat PREROUTING chain?
@ 2005-11-10 13:13 Gabriel
  0 siblings, 0 replies; 32+ messages in thread
From: Gabriel @ 2005-11-10 13:13 UTC (permalink / raw)
  To: netfilter

On Thu, 10 Nov 2005 14:44:53 +0200, Adam Rosi-Kessel  
<adam@rosi-kessel.org> wrote:

> George Alexandru Dragoi wrote:
>> Better use mangle table, all packets traverse it. And
doesn't require
>> conntrack.
>
> But I can't do DNAT in mangle, right?

You cannot. nat and mangle are two different chains.

"Note that the DNAT target is only available within the
PREROUTING and  
OUTPUT chains in the nat table" from  
http://iptables-tutorial.frozentux.net/iptables-tutorial.html#DNATTARGET

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: Why would certain packets not reach nat PREROUTING chain?
@ 2005-11-10 13:45 Adam Rosi-Kessel
  2005-11-10 14:50 ` Sandro Dentella
  0 siblings, 1 reply; 32+ messages in thread
From: Adam Rosi-Kessel @ 2005-11-10 13:45 UTC (permalink / raw)
  To: netfilter

Sandro Dentella Wrote:

> > I'm troubeshooting an issue of accessing a VPN through NAT. Right now
> > the problem can be reduced to the following question:
> > Under what conditions would inbound packets not be routing through the
> > nat PREROUTING chain?
> That's a problem that puzzles me too. Do you have fancy routing tables?
> (several different tables setup w/ iproute2).

Nope. At least for the purposes of this experiment, this is the only
thing I'm trying to do. The entire task of iptables is SNATting outbound
packet from the LAN, and then attempting to DNAT inbound packets on udp
port 500 to a specific machine with the LAN. The outbound SNAT works
fine; but the inbound packets don't ever reach the nat PREROUTING chain.

> I also have a setup in which icmp packets will not get to PREROUTING.
> My understanding is that the kernel does not understand they are destined
> for that box: could that be your situation?

I don't think that's related, although I admit I don't have a thorough
understanding of the issue... why would icmp packets matter when the
issue is inbound UDP 500 packets that are showing up in tcpdump? Wouldn't
showing up in tcpdump indicate that the kernel understands the packet is
destined for that box?
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org


^ permalink raw reply	[flat|nested] 32+ messages in thread
[parent not found: <20051218055403.002CDA00EA@bostoncoop.net>]

end of thread, other threads:[~2006-01-25  1:16 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-10  1:57 Why would certain packets not reach nat PREROUTING chain? Adam Rosi-Kessel
2005-11-10  1:59 ` Adam Rosi-Kessel
2005-11-10  3:18   ` Alexander Samad
2005-11-10  3:27     ` Adam Rosi-Kessel
     [not found]       ` <3063e50511100055m41abd50hc3af78a67896db7d@mail.gmail.com>
2005-11-10 12:44         ` Adam Rosi-Kessel
2005-11-10 10:15 ` Sandro Dentella
2005-11-10 16:44   ` Jozsef Kadlecsik
2005-11-14 14:53     ` Adam Rosi-Kessel
2005-11-14 15:03       ` Jozsef Kadlecsik
2005-11-14 15:09         ` Adam Rosi-Kessel
2005-11-15  9:07           ` Jozsef Kadlecsik
2005-11-15 13:43             ` Adam Rosi-Kessel
2005-11-15 14:00               ` Jozsef Kadlecsik
2005-11-15 23:53                 ` Adam Rosi-Kessel
2005-11-15 23:57                   ` Adam Rosi-Kessel
2005-11-16  0:02                     ` Adam Rosi-Kessel
2005-11-16  9:42                   ` Jozsef Kadlecsik
2005-11-18  1:52                     ` Adam Rosi-Kessel
2005-11-18 11:07                       ` Jozsef Kadlecsik
2005-11-19  3:46                         ` Adam Rosi-Kessel
2005-11-19 20:34                           ` Jozsef Kadlecsik
2005-11-20 17:20                             ` Adam Rosi-Kessel
2005-11-24 11:00                               ` Jozsef Kadlecsik
2005-11-24 13:36                                 ` Adam Rosi-Kessel
2005-12-17 22:59                         ` Adam Rosi-Kessel
2005-12-18  6:42                       ` Leonardo Rodrigues Magalhães
  -- strict thread matches above, loose matches on Subject: below --
2005-11-10 13:13 Gabriel
2005-11-10 13:45 Adam Rosi-Kessel
2005-11-10 14:50 ` Sandro Dentella
     [not found] <20051218055403.002CDA00EA@bostoncoop.net>
2005-12-18 13:16 ` Adam Rosi-Kessel
2005-12-19 15:39   ` Re[2]: " Marcin Krol
2005-12-19 15:40     ` Adam Rosi-Kessel
2006-01-25  1:16     ` Adam Rosi-Kessel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.