Linux to IPsec VPN Hints
* ContentsÂ
- IntroductionÂ
- LinksÂ
- Routing tipsÂ
- Firewalling tipsÂ
* IntroductionÂ
This Nano-HowTo was made when connecting a Linux Gateway to aÂ
WatchGuard X6000 VPN appliance using IKE, IPsec, ESP, 3DES, MD5, PF2.Â
The actual target was Ö-Ticket, Austria's largest event ticket company.Â
Since linux kernel 2.6 introduced ipsec to the vanilla kernel ("26sec"),Â
there are plenty of methods to connect Linux to an IPsec based VPN.Â
This text describes how to connect to Oe-Ticket's VPN with 2 solutions:Â
- isakmpd (originating from OpenBSD)Â
- racoon & ipsec-tools (AKA KAME-tools)Â
The hints in the tips sections would have saved me 2 long work days!Â
* Important Links:Â
Main IPsec-HowTo, Introduction and (too) short examples:Â
www.ipsec-howto.orgÂ
especially:Â
KAMEÂ
isakmpdÂ
Firewalling problems and strategies:Â
IPseconLinux.pdfÂ
Introduction and samples in German:Â
kernel-ipsec.htmlÂ
Raccoon error message decoder ring:Â
www.fefe.de/racoon.txtÂ
* Routing TipsÂ
Since 26sec, you don't have a ipsec0 interface and you do not see theÂ
ipsec tunnel in the netstat -rn output. This sucks, but do not try toÂ
add weird routes!Â
When having routing or even ping'ing problems, do not forget thatÂ
traffic from the gateway itself is treated differently than trafficÂ
from the tunneled internal network!Â
If you want to connect from the ipsec'ing, you must not use the defaultÂ
source interface (i.e. the world interface that hosts the ipsec tunnel)Â
but have to use an source address within the tunneled internal network.Â
Use e.g.Â
ping -I 10.0.1.1 10.0.2.1Â
orÂ
telnet -b 10.0.1.1 10.0.2.1 80Â
etc. (I don't know the squid hack yet)Â
* Firewalling TipsÂ
If you run netfilters (iptables), know these:Â
- you have to accept port 500 and 4500 udp+tcp traffic (from the VPN server) for IKE key exchangeÂ
- you have to accept -p esp traffic! (from the VPN server) to be able to receive answersÂ
- some TCP applications have problems with too large packets, so force down the MTU size for tunneled packets, using something like this:Â
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -d 10.1.1.0/24 -j TCPMSS --set-mss 1300
From: IBCL BLog.
Originally posted: 2006-09-21