ipsec with a NAT'ing linux firewall inbetween ?

ipsec with a NAT'ing linux firewall inbetween ?

Post by Tom Van Overbek » Sun, 20 Apr 2003 22:27:27



Hi,

Our company allows us to dial in from home using a vpn software client.
their vpn solution is apparently the standard ipsec solution from
microsoft.

using 'real' ip adresses, this works fine. (we're all using windows 2k or
xp laptop's).

I have however a linux firewall at home, and i'd prefer much to simply
plugin my laptop to my home lan, and connect to the vpn server this way.
However, because i need to do nat'ing on the linux firewall, this does not
work.

However, the guys at work responsible for managing the vpn say that if i
were to use a windows xp machine instead of a linux, it would work.

and someone else told me that windows does indeed have some sort of
feature called upnp that would allow this.

Can anyone confirm that this is true, and how it works ? in my
understanding, the principal reason why nat'ing prevents ipsec to work is
that the source ip adress is changed in an ip packet, which causes ipsec
to think that someone could be trying to spoof ?

And being quite linux minded, i'm sure that if it would be possible using
windows xp, it sure as hell will be possible with linux.

All information is welcome .

thanks,

Tom.

 
 
 

ipsec with a NAT'ing linux firewall inbetween ?

Post by Whoeve » Mon, 21 Apr 2003 05:34:12



> Hi,

> Our company allows us to dial in from home using a vpn software client.
> their vpn solution is apparently the standard ipsec solution from
> microsoft.

Are you sure that it is IPSEC and not some other VPN solution like PTPTP?

 
 
 

ipsec with a NAT'ing linux firewall inbetween ?

Post by Tom Van Overbek » Mon, 21 Apr 2003 15:40:27




>> Hi,

>> Our company allows us to dial in from home using a vpn software client.
>> their vpn solution is apparently the standard ipsec solution from
>> microsoft.

> Are you sure that it is IPSEC and not some other VPN solution like PTPTP?

Yes,

PPTP is not a problem with NAT'ing, but they only support IPSEC for
security reasons.

Tom.

 
 
 

ipsec with a NAT'ing linux firewall inbetween ?

Post by Whoeve » Mon, 21 Apr 2003 16:27:53





> >> Hi,

> >> Our company allows us to dial in from home using a vpn software client.
> >> their vpn solution is apparently the standard ipsec solution from
> >> microsoft.

> > Are you sure that it is IPSEC and not some other VPN solution like PTPTP?

> Yes,

> PPTP is not a problem with NAT'ing, but they only support IPSEC for
> security reasons.

Then your network "experts" are spouting BS when they say that an XP
machine behind a NAT firewall would work.

However, there is a patch to the kernel for IPSEC passthru. With the patch
on your firewall, you should be able to use either an XP or a Linux
machine (with FreeS/WAN) behind the NAT box.

 
 
 

ipsec with a NAT'ing linux firewall inbetween ?

Post by Tom Van Overbek » Mon, 21 Apr 2003 16:50:22






>> >> Hi,

>> >> Our company allows us to dial in from home using a vpn software
>> >> client. their vpn solution is apparently the standard ipsec solution
>> >> from microsoft.

>> > Are you sure that it is IPSEC and not some other VPN solution like
>> > PTPTP?

>> Yes,

>> PPTP is not a problem with NAT'ing, but they only support IPSEC for
>> security reasons.

> Then your network "experts" are spouting BS when they say that an XP
> machine behind a NAT firewall would work.

No, you misunderstood. they say using windows xp as a NAT'ing firewall would work,
not behind the existing firewall.

Quote:

> However, there is a patch to the kernel for IPSEC passthru. With the patch
> on your firewall, you should be able to use either an XP or a Linux
> machine (with FreeS/WAN) behind the NAT box.

Hm, now this is interesting stuff. any idea where i can find more
information about this ?

thanks,

tom.

 
 
 

ipsec with a NAT'ing linux firewall inbetween ?

Post by Scot Harkin » Tue, 22 Apr 2003 01:51:19


Linux VPN Masquerade:
http://www.impsec.org/linux/masquerade/ip_masq_vpn.html (I work with this
chap; he's on the ball)

Linux FreeS/WAN Project Homepage: http://www.freeswan.org



Quote:> Hm, now this is interesting stuff. any idea where i can find more
> information about this ?

--
Scot Harkins (KA5KDU)
Greenbank, WA
360-678-5880

http://www.bigfoot.com/~scoth
 
 
 

ipsec with a NAT'ing linux firewall inbetween ?

Post by Tom Van Overbek » Tue, 22 Apr 2003 23:32:43


Hi Scot,

thanks for your link.

i read the ip masq vpn howto before, and didn't really follow up on it
because I thought it couldn't help my case.

here's why i think so:

ipsec has 2 main components:

AH & EPS

AH is used for authenticating that the source ip adress is actually the ip
adress of the other side of the ipsec tunnel, and not some spoofer. it does
this by encrypting the source ip adress with either a public/private key
(key exchange and all that) or via a shared key

EPS is used to encrypt the data in the packet. encryption is same principle
as for AH

(i believe that at my company they use shared keys BTW)

now, i understand that if AH is used, there's simply no way that a client
from behind a NAT'ing firewall can connect, because the source ip adress in
the ip header is no longer the same as the encrypted (original) source ip
adress in the data part of the ip packet.

only EPS can possibly be supported

Are my assumptions correct or did I (hopefull) make a mistake somewhere ?

thx,

thanks,

Tom.


> Linux VPN Masquerade:
> http://www.impsec.org/linux/masquerade/ip_masq_vpn.html (I work with this
> chap; he's on the ball)

> Linux FreeS/WAN Project Homepage: http://www.freeswan.org



> > Hm, now this is interesting stuff. any idea where i can find more
> > information about this ?

> --
> Scot Harkins (KA5KDU)
> Greenbank, WA
> 360-678-5880

> http://www.bigfoot.com/~scoth

 
 
 

1. IPSec (i.e. Freeswan 2.x), Linux kernel 2.6 no longer masquerading (NAT'ing) connections

I understand that KLIPS support has been rolled into the native 2.6
kernel and thus the virutal ipsecN interfaces once used for IPSec
traffic are now gone. While this makes sense (in fact I believe the
Cisco IPSec clients for Linux have done this for a while now), this
makes NAT'ing VPN traffic on a gateway difficult - if not impossible.

Since all the traffic is now being transported through the ethN
interfaces, is there a way to masquerade traffic from an internal
network across an IPSec tunnel? For example, say we have a VPN tunnel
established from a gateway to a VPN server:

/-----------\             /------------\         |
| Gateway   |------------>| FreeS/WAN  |         | LAN
| 12.10.4.1 |             | 15.13.12.1 |---------| 192.168.1.0/24
\-----------/             \------------/         |

Our gateway connects and can reach servers on the LAN. But since
Gateway is a router that allows NAT'ed clients behind it to reach
other networks, we also want the network behind it to get to the
192.168.1.0/24 network, as in:

           |   /-----------\      /------------\    |
LAN1       |   | Gateway   |----->| FreeS/WAN  |    | LAN2
10.0.0.0/16|---| 12.10.4.1 |      | 15.13.12.1 |----| 192.168.1.0/24
           |   \-----------/      \------------/    |

In the 2.4 kernel days we could just say:
iptables -A POSTROUTING -t nat -o ipsec0 -j MASQUERADE

And things would work exactly as listed above. But we don't have
ipsec0 any more... and just MASQUERADE'ing eth0 (or whatever your
public interface is) doesn't work. You can attach to the IPSec tunnel
on the Gateway machine and connect to the remote LAN, but you just
can't do step 2 and masq that connection. So... now what can a guy do?

2. OpenOffice 1.0 + MySQL + access-style front-end

3. NAT'ing IPSec

4. Linux Frequently Asked Questions with Answers (Part 4 of 6)

5. Firewall & NAT'ing

6. Faster NFS wanted: advice solicited

7. Openbsd vpn + nat'ing firewall

8. How do you forward mail in VMS?

9. IPSec Client behind a firewall (NAT'int)

10. ipsec/vpn with nat firewall...

11. Trying to VPN/IPSec through iptables NAT firewall... help?

12. Help! VPN'ing through a Linux firewall?

13. MASQ'ing a PPTP server with a Linux firewall (Kernel 2.2.12)