<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:Consolas'>I’m trying to migrate from L2TP/IPsec to IPsec & IKE. L2TP/IPsec is working with strongswan, and I can access both my private subnet & the public internet through the VPN server. However, with IPsec & IKE I can only access my private subnet. My client is usually behind NAT, but from the strongswan documentation that should not be an issue.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>When testing IPsec, I flush my firewall and set everything to ACCEPT. Then I add the necessary POSTROUTING SNAT rule, which works fine with L2TP/IPsec. So I am fairly confident it is not an iptables problem.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>Establishing VPN connection is also not a problem, that goes over without a hitch. So I am suspecting there is a routing problem, but the routing tables are my biggest weakness on Linux, so I’m hoping I could get some thoughts from the strongswan community. It might also have to do with routing that happens inside strongswan- I’m still fuzzy on how much packet handling strongswan does.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>My interfaces are perhaps laid out unusually?<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>venet0 - 127.0.0.1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>venet0:0 - <PUBLIC SERVER IP><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>venet0:1 - <PRIVATE VLAN><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>Ipsec.conf:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>conn IKEv1-PSK-NAT<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> auto=add<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> left=<PUBLIC SERVER IP><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> rightsourceip=10.1.0.1/23<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> rightsubnet=10.1.0.0/23<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> authby=xauthpsk<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> keyexchange=ikev1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> leftcert=server.crt<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> leftsubnet=0.0.0.0/0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'> xauth=server<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>Iptables:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>-A POSTROUTING -s 10.0.0.0/8 -o venet0 -m policy --dir out --pol ipsec -j ACCEPT<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>-A POSTROUTING -s 10.0.0.0/8 -o venet0 -j SNAT --to-source <PUBLIC SERVER IP><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'># ip route list<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><VLAN SUBNET> dev venet0 proto kernel scope link src <VLAN IP><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><ANOTHER VLAN> dev venet0 scope link metric 1002<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>default dev venet0 scope link<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'># ip route list table 220<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>10.1.0.2 via <CLIENT IP> dev venet0 proto static<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas'>-Patrick<o:p></o:p></span></p></div></body></html>