All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: Craig Box <craig@itpartners.co.nz>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: PPTP conntracking saga continued
Date: Wed, 17 Sep 2003 10:52:34 +1000	[thread overview]
Message-ID: <3F67B052.8060707@snapgear.com> (raw)
In-Reply-To: <44AD3126A8CE26439BBD21AB2F9CC1D81286D2@commsserver.itpartners.co.nz>

Craig Box wrote:
> I've been trying to figure out PPTP connection tracking for some time,
> and spent half a day battling with old versions of the patches and then
> finally got the modules to compile, before reading that Harald has a new
> version out due out any day now.  

I have had success with the following:

1. Start with Linux 2.4.22
2. Apply patch-o-matic/pending/63_getorigdst-tuple-zero.patch
3. Apply patch-o-matic/extra/pptp-conntrack-nat.patch
4. Copy in the files from netfilter-extensions/helpers/pptp
5. Apply the patches from:
http://lists.netfilter.org/pipermail/netfilter-devel/2003-September/012362.html

> If I have a standard kernel.org kernel running iptables/netfilter (no
> patch-o-matic patches), I can observe the following behaivour:
> 
> * I have a DNAT on the firewall machine to send all VPN traffic (1723
> TCP/GRE) to an internal Windows PPTP server
> * From inside my LAN I can connect out to any other Windows PPTP server
> and establish a connection (the GRE replies are matched by the
> connection tracking and sent back to the internal machine, not blindly
> routed to the Windows server

Yes, because the DNAT rule is only used for packets that are not part
of an existing connection.

> * If I disconnect there is a 10 min time out in which I can't connect
> from any other machine behind my NAT (understandably; the timeout is
> counting down in /proc/net/ip_conntrack) - can someone confirm that this
> problem is worked around by the PPTP conntrack patches in p-o-m?

This is because it is using the generic protocol conntrack, which can
only distinguish between gre connections by IP address, and has a 10
minute timeout.  The pptp conntrack patch will fix this since it can
distinguish between gre connections using the call ID.

> - However -
> 
> * If I connect _outward_ to a Poptop VPN server, same network, the
> initial GRE replies come back and are DNAT'd to the internal Windows
> PPTP server, therefore the connection does not create

This is most likely because the Poptop server is faster than your client,
and it is sending an incoming GRE packet before your client sends the
outgoing packet.  There will be no existing conntrack for the incoming
packet, so it will match the DNAT rule.

> I am not sure if this is the fault of Poptop or the connection tracking.
> I would assume that, because the conntracking handles Windows servers
> right, that Poptop is at fault, and people on this list speak of a
> connid patch to Poptop that addresses this (although I can find no other
> mention of it.)

The Poptop connid bug is only a problem once you try multiple
simultaneous connections.

> Strangely enough, reading poptop's website, their FAQ
> (http://poptop.sourceforge.net/dox/qna.html) says:
> 
> "The only way to distinguish between those two clients is to filter them
> by destination call ID number found in the GRE header. In order for the
> client NAT firewall to correctly rewrite the PPTP server's replies,
> please check Philip Craig's netfilter pptp helper module available from
> the Netfilter CVS server. [..] It will be integrated in KernelMod, but
> until then, you'll have to build it yourself"
> 
> Are they referring to the same thing as Harald's PPTP conntracking
> patch?  Is there indeed a new version (that will compile cleanly against
> 2.4.22) due out soon?  Is poptop at fault, or is connection tracking?

I've never written a netfilter pptp helper, just submitted patches
for existing ones.  Harald's pptp conntracking patch is the only
one that will work, and it will fix the problems you are having.

-- 
Philip Craig - philipc@snapgear.com - http://www.SnapGear.com
SnapGear - Custom Embedded Solutions and Security Appliances

  reply	other threads:[~2003-09-17  0:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-16  3:39 PPTP conntracking saga continued Craig Box
2003-09-17  0:52 ` Philip Craig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-09-17 21:58 Craig Box

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F67B052.8060707@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=craig@itpartners.co.nz \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.