<div dir="ltr">Hi Noel,<div><br></div><div>We actually want that all traffic from Host A shall be directed via SeGW towards different Hosts behind Linux Box( which includes Host B as 1 one of the host ).</div><div>There is only 1 tunnel and 1 child SA between SeGW and Linux Box.</div><div>The Reason for keeping leftsubnet and rightsubnet as <a href="http://0.0.0.0/32">0.0.0.0/32</a> is that there are multiple logical IPs (upto 3 IPs) configured on Host A which send traffic towards different destinations behind Linux Box (which also includes Host B)</div><div>Is there any alternate want to configure the strongswan stack and linux Box routing to handle this?</div><div><br></div><div>BR</div><div>Sajal</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 9, 2015 at 4:41 AM, Noel Kuntze <span dir="ltr"><<a href="mailto:noel@familie-kuntze.de" target="_blank">noel@familie-kuntze.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
Hello Sajal,<br>
<br>
Tunneling <a href="http://0.0.0.0/32" target="_blank">0.0.0.0/32</a> == <a href="http://0.0.0.0/32" target="_blank">0.0.0.0/32</a> does not work. What do you try to do?<br>
You need to decide on the subnets you want to tunnel or negotiate <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> == <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a><br>
and then use mark(,_in,_out) to give the kernel information how to handle the packets.<br>
<br>
Mit freundlichen Grüßen/Kind Regards,<br>
Noel Kuntze<br>
<br>
GPG Key ID: 0x63EC6658<br>
Fingerprint: 23CA BB60 2146 05E7 7278 6592 3839 298F 63EC 6658<br>
<span class=""><br>
Am 08.05.2015 um 12:53 schrieb Sajal Malhotra:<br>
> Hi,<br>
><br>
> I am using following Setup in my Lab:<br>
><br>
> Host A<---->SeGW<-----(ESP Tunnel)---->(eth1)Strongswan (Linux PC) (eth0)<--->Host B<br>
><br>
> So there is one Tunnel Established between SeGW and Linux PC which is running Strongswan Stack v5.2.2.<br>
> The Linux is connected to SeGW via its eth1 interface<br>
> and Host B is connected via eth0 Interface.<br>
><br>
> What we want is that:<br>
> 1. Any traffic that we want to send from Host A to Host B should go via SeGW where it is sent encrypted towards Linux Box.<br>
> 2. The Linux Box running strongswan should then decrypt the traffic and route it to Host B<br>
> 3. As expected, the reverse path to be followed for traffic from Host B to Host A.<br>
><br>
> What we observe is that:<br>
> 1. SeGW is successfully able to encrypt the traffic and send ESP frames to Linux PC<br>
> 2. the linux PC also decrypts it successfully<br>
</span>> 3. However after decryption *it is not able to route *the traffic towards interface connected to Host B. *On the contrary we see that decrypted traffic is seen on the same interface from which it received the ESP frames. i.e. the interface connected to SeGW. i.e. both Encrypted and decrypted packet seen on same interface.*<br>
<span class="">><br>
> The routing configured on Linux PC also looks to be correct as when I send ping traffic from Host A to Host B (this traffic is not encrypted), i see that Linux PC is correctly able to route this ICMP traffic towards Host B without any Issue.<br>
><br>
> Can you let me know what could be the possible issue here. Or provide some indication on how to debug it.<br>
><br>
> Below are the logs and configuration. Let me know if any additional detail is needed that i missed--:<br>
><br>
> Here is the ipsec.conf connection setting:<br>
><br>
><br>
><br>
> conn saM<br>
><br>
> ikelifetime=24h<br>
><br>
> keyexchange=ikev2<br>
><br>
> keyingtries=%forever<br>
><br>
> keylife=5m<br>
><br>
> reauth=no<br>
><br>
> rekey=yes<br>
><br>
> mobike=no<br>
><br>
> dpdaction=clear<br>
><br>
> dpddelay=10<br>
><br>
> rekeymargin=1m<br>
><br>
> ike=aes128-sha1-modp1024,3des-sha1-modp1024!<br>
><br>
> esp=aes128-sha1-modp1024,3des-sha1-modp1024!<br>
><br>
> authby=rsasig<br>
><br>
> left=31.31.31.22<br>
><br>
</span>> leftsubnet=<a href="http://0.0.0.0/32" target="_blank">0.0.0.0/32</a> <<a href="http://0.0.0.0/32" target="_blank">http://0.0.0.0/32</a>><br>
><br>
> right=31.31.31.31<br>
><br>
> rightsubnet=<a href="http://0.0.0.0/32" target="_blank">0.0.0.0/32</a> <<a href="http://0.0.0.0/32" target="_blank">http://0.0.0.0/32</a>><br>
<span class="">><br>
> leftprotoport=%any/%any<br>
><br>
> rightprotoport=%any/%any<br>
><br>
> leftcert=/usr/local/etc/ipsec.d/certs/linux.pem<br>
><br>
> rightid=%any<br>
><br>
> auto=add<br>
><br>
><br>
> Host A IP: 172.18.21.232<br>
><br>
> Host B IP: 10.3.4.22<br>
><br>
><br>
</span>> *Routing Table on Linux PC:*<br>
<span class="">><br>
><br>
> Kernel IP routing table<br>
><br>
> Destination Gateway Genmask Flags Metric Ref Use Iface<br>
><br>
> 172.18.21.0 * 255.255.255.0 U 0 0 0 eth1<br>
><br>
</span>> *10.3.4.0 * 255.255.255.0 U 1 0 0 eth0 <<<this route should have worked*<br>
<span class="">><br>
> 192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0<br>
><br>
> 31.31.31.0 * 255.255.255.0 U 0 0 0 eth1<br>
><br>
> 172.18.0.0 * 255.255.0.0 U 0 0 0 eth1<br>
><br>
> default 10.3.4.1 0.0.0.0 UG 0 0 0 eth0<br>
><br>
> default 10.3.4.1 0.0.0.0 UG 0 0 0 eth0<br>
><br>
><br>
</span>> *ifconfig output:*<br>
<span class="">> [root@root ~]# ifconfig<br>
> eth0 Link encap:Ethernet HWaddr A4:1F:72:8E:66:F5<br>
> inet addr:10.3.4.139 Bcast:10.3.4.255 Mask:255.255.255.0<br>
> inet6 addr: fe80::a61f:72ff:fe8e:66f5/64 Scope:Link<br>
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
> RX packets:33355 errors:0 dropped:0 overruns:0 frame:0<br>
> TX packets:32425 errors:0 dropped:0 overruns:0 carrier:0<br>
> collisions:0 txqueuelen:1000<br>
> RX bytes:18132226 (17.2 MiB) TX bytes:28624412 (27.2 MiB)<br>
> Interrupt:46 Base address:0x2000<br>
><br>
> eth1 Link encap:Ethernet HWaddr 00:0A:F7:16:7E:5D<br>
> inet addr:31.31.31.22 Bcast:31.31.31.255 Mask:255.255.255.0<br>
> inet6 addr: fe80::20a:f7ff:fe16:7e5d/64 Scope:Link<br>
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
> RX packets:2807 errors:0 dropped:0 overruns:0 frame:0<br>
> TX packets:265 errors:0 dropped:0 overruns:0 carrier:0<br>
> collisions:0 txqueuelen:1000<br>
> RX bytes:395217 (385.9 KiB) TX bytes:35486 (34.6 KiB)<br>
> Interrupt:17<br>
><br>
> eth1:1 Link encap:Ethernet HWaddr 00:0A:F7:16:7E:5D<br>
> inet addr:172.18.21.1 Bcast:172.18.255.255 Mask:255.255.0.0<br>
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
> Interrupt:17<br>
><br>
> Wireshark logs captured on eth1 interface are attached, which show both encrypted and decrypted packets on same interface.<br>
</span>> *<br>
> *<br>
> Thanks and Regards<br>
> Sajal<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.strongswan.org">Users@lists.strongswan.org</a><br>
> <a href="https://lists.strongswan.org/mailman/listinfo/users" target="_blank">https://lists.strongswan.org/mailman/listinfo/users</a><br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
iQIcBAEBCAAGBQJVTUKcAAoJEDg5KY9j7GZYEGYP/jpjpvawlNjYUMOKMTEjjnaj<br>
8uYnMqXOWwCyOYXw8Dcz3/qNheuPj4GsyvijWi/jnY4MU/Q5oxOgRfF/r+ptBlg2<br>
vOPRCguGqIFmXNS0vXciICwCGwO3FuxelxGBtCJ8vZa8ZWbJcG3PnMjhulVJ9mDg<br>
jxN88GHhvr5jRTNMgxqSQF7i5Q7MY8/DIScdQjukTqTWe9QGBibWnNNCep7/onkk<br>
VH8aTsgNiquoZqucuzAWUIQLfUdGfedUnZxfFjMF36HddVqmdpy0ulmLIR9sn+0e<br>
aTKgleTjllo7D7CK55bzfXiminfibT7Q37q8gSAVqeGBGlEXgYKZUjOB4yKYltuP<br>
XY8uXjK6VeWu7Du8ZXm1uu4v53ipDpgIvCG4iPL/a9n29yHqng71/wpmKisC1J/S<br>
Ubyth2yi9L4RV3HOzv0xVlcOTsh/X5VCFmlQBZpYQiS/eHjlyDmzJoAi4DkH0kIy<br>
YfVXCgUVYVsA19/zaZgQGM0+wR4O6r+K5cRz2OVD7QF3ZrlP9zPk8vEnbu/RQuHQ<br>
ek1sdmk+xqR38rU3iMqZSNJdzjWFg1Obk8L3BxYNdQIXoXSfgNq9mKfBBb+C7Sl2<br>
hYwVumONbvHT6BcqWRQqPMoaZK5RDkeghs4Lmyg2Vfe0yrcMBVr5o9OKRYCriShd<br>
Td5xUest5XOdDn44kgp5<br>
=tg6H<br>
-----END PGP SIGNATURE-----<br>
<br>
</blockquote></div><br></div>