<html 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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Baskerville;
panose-1:2 2 5 2 7 4 1 2 3 3;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Baskerville",serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-IN" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US">Hi Noel, Rajiv<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US">Many thanks for your prompt responses. Deeply appreciated!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US">The issue turned out not to be a forwarding issue on linux, but incorrect ESP trailer encoding from the cloud service router due to which post-decryption check was
failing on StrongSwan causing it to discard the packet.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif">Mohit<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Baskerville",serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.strongswan.org> on behalf of Rajiv Kulkarni <rajivkulkarni69@gmail.com><br>
<b>Date: </b>Thursday, 27 January 2022 at 2:33 PM<br>
<b>To: </b>"users@lists.strongswan.org" <users@lists.strongswan.org><br>
<b>Subject: </b>Re: [strongSwan] Having forwarding issue in a basic StrongSwan setup<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Hi<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On the Strongswan peer-gateway (ubuntu), try by adding the below before(preferably) or after the ipsec tunnel is up<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><b>root# ip route add <a href="http://172.16.1.0/24">172.16.1.0/24</a> dev ens224 table 220</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think it will then start the forwarding of the inbound (after decryption) packets correctly as expected.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">best regards<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Jan 27, 2022 at 1:03 AM Noel Kuntze <noel.kuntze+strongswan-users-ml@thermi.consulting> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hello Mohit,<br>
<br>
Please enable logging of martians. I suspect the return path filter and route installation into table 220 break it because the return path filter default mode of 1 just looks up the route in the main routing table, not routing table 220 into which strongSwan
installs the routews. Assuming this is a fixed installation and the addresses of next hops and so on don't change you can disable the route installation by strongSwn and manage the required routes manually and put them into the main routing table.<br>
Mode 2 for the return path filter looks for routes in any routing table. Thus because the route installed in table 220 will likely match satisfy the return path filter, you'd have to change its mode to 2, or 0 (which disables it).<br>
<br>
You probably also want to use a VTI or an XFRM interface. For the first route installation needs to be disabled, and for the latter the return path filter won't cause any problems and strongSwan won't install any routes so you don't need to change that setting
either.<br>
<br>
Kind regards<br>
Noel<br>
<br>
Am 26.01.22 um 14:30 schrieb MOHIT CHALLA (mochalla):<br>
> Hello group,<br>
> <br>
> I am trying to run some tests in my lab setup with a Cisco cloud service router on one side and running StrongSwan version 5.8.2 on the other side (Ubuntu 20.04LTS).<br>
> <br>
> I am using loopback interface on the Cisco side, and a normal interface on the Ubuntu side to simulate LAN networks and there is no NAT involved in-between.<br>
> <br>
> The connection has come up properly (verified on both sides). However, end-to-end ping connectivity from the LAN to LAN is not going through due to what appears to me to be a forwarding issue on the Ubuntu side.<br>
> <br>
> I suspect I am missing something basic here, but I am not able to figure it out. Any pointers are deeply appreciated.<br>
> <br>
> root@mochalla:~# swanctl -l<br>
> <br>
> csr: #2, ESTABLISHED, IKEv2, e3613778f4d39f6d_i ec5d278f976b8165_r*<br>
> <br>
> local '192.168.1.2' @ 192.168.1.2[500]<br>
> <br>
> remote '192.168.1.1' @ 192.168.1.1[500]<br>
> <br>
> AES_CBC-256/HMAC_SHA2_512_256/PRF_HMAC_SHA2_512/MODP_2048<br>
> <br>
> established 581s ago, rekeying in 13147s<br>
> <br>
> csr: #3, reqid 1, INSTALLED, TUNNEL, ESP:AES_CBC-128/HMAC_SHA1_96<br>
> <br>
> installed 15s ago, rekeying in 262s, expires in 315s<br>
> <br>
> in c33426a5, 0 bytes, 0 packets<br>
> <br>
> out a790e4e9, 0 bytes, 0 packets<br>
> <br>
> local <a href="http://172.16.1.0/24" target="_blank">172.16.1.0/24</a><br>
> <br>
> remote <a href="http://172.17.1.0/24" target="_blank">172.17.1.0/24</a><br>
> <br>
> root@mochalla:~# ip add<br>
> <br>
> <…><br>
> <br>
> 3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000<br>
> <br>
> link/ether 00:50:56:bd:6d:f7 brd ff:ff:ff:ff:ff:ff<br>
> <br>
> altname enp11s0<br>
> <br>
> inet <a href="http://192.168.1.2/24" target="_blank">192.168.1.2/24</a> brd 192.168.1.255 scope global noprefixroute ens192<br>
> <br>
> valid_lft forever preferred_lft forever<br>
> <br>
> inet6 fe80::145d:7f77:fb57:e349/64 scope link noprefixroute<br>
> <br>
> valid_lft forever preferred_lft forever<br>
> <br>
> 4: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000<br>
> <br>
> link/ether 00:50:56:bd:aa:76 brd ff:ff:ff:ff:ff:ff<br>
> <br>
> altname enp19s0<br>
> <br>
> inet <a href="http://172.16.1.1/24" target="_blank">172.16.1.1/24</a> brd 172.16.1.255 scope global noprefixroute ens224<br>
> <br>
> valid_lft forever preferred_lft forever<br>
> <br>
> inet6 fe80::f1b7:4eb:7e:fd89/64 scope link noprefixroute<br>
> <br>
> valid_lft forever preferred_lft forever<br>
> <br>
> On the Cisco side, I can see that the ping packets are getting encrypted<br>
> <br>
> Router#sh cry sess de | i pkts<br>
> <br>
> Inbound: #pkts dec'ed 0 drop 0 life (KB/Sec) 4608000/3590<br>
> <br>
> Outbound: #pkts enc'ed 0 drop 0 life (KB/Sec) 4608000/3590<br>
> <br>
> Router#ping 172.16.1.1 so 172.17.1.1 re 10 ti 1<br>
> <br>
> Type escape sequence to abort.<br>
> <br>
> Sending 10, 100-byte ICMP Echos to 172.16.1.1, timeout is 1 seconds:<br>
> <br>
> Packet sent with a source address of 172.17.1.1<br>
> <br>
> ..........<br>
> <br>
> Success rate is 0 percent (0/10)<br>
> <br>
> Router#sh cry sess de | i pkts<br>
> <br>
> Inbound: #pkts dec'ed 0 drop 0 life (KB/Sec) 4608000/3526<br>
> <br>
> Outbound: #pkts enc'ed 10 drop 0 life (KB/Sec) 4607999/3526<br>
> <br>
> The ESP packets can be seen reaching the ens192 interface on Ubuntu in tcpdump.<br>
> <br>
> root@mochalla:~# tcpdump -i ens192<br>
> <br>
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br>
> <br>
> listening on ens192, link-type EN10MB (Ethernet), capture size 262144 bytes<br>
> <br>
> 18:47:29.855345 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x1), length 148<br>
> <br>
> 18:47:30.854815 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x2), length 148<br>
> <br>
> 18:47:31.854795 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x3), length 148<br>
> <br>
> 18:47:32.855670 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x4), length 148<br>
> <br>
> 18:47:33.855818 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x5), length 148<br>
> <br>
> 18:47:34.856440 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x6), length 148<br>
> <br>
> 18:47:35.856364 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x7), length 148<br>
> <br>
> 18:47:36.855871 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x8), length 148<br>
> <br>
> 18:47:37.856339 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0x9), length 148<br>
> <br>
> 18:47:38.856668 IP 192.168.1.1 > mochalla: ESP(spi=0xce02423e,seq=0xa), length 148<br>
> <br>
> Looks like the route is also getting installed in table 220 as expected.<br>
> <br>
> root@mochalla:~# ip route show table 220<br>
> <br>
> <a href="http://172.17.1.0/24" target="_blank">172.17.1.0/24</a> via 192.168.1.1 dev ens192 proto static src 172.16.1.1<br>
> <br>
> If I try pinging from StrongSwan side to Cisco, I can see the reply ESP packets are reaching the ens192 interface, but not getting forwarded to ens224.<br>
> <br>
> root@mochalla:~# ping 172.17.1.1 -I ens224 -c10 -W1<br>
> <br>
> PING 172.17.1.1 (172.17.1.1) from 172.16.1.1 ens224: 56(84) bytes of data.<br>
> <br>
> root@mochalla:~# tcpdump -i ens192<br>
> <br>
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br>
> <br>
> listening on ens192, link-type EN10MB (Ethernet), capture size 262144 bytes<br>
> <br>
> 18:54:31.317527 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0x9), length 132<br>
> <br>
> 18:54:31.317771 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x1d), length 132<br>
> <br>
> 18:54:32.325385 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0xa), length 132<br>
> <br>
> 18:54:32.325675 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x1e), length 132<br>
> <br>
> 18:54:33.349423 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0xb), length 132<br>
> <br>
> 18:54:33.349699 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x1f), length 132<br>
> <br>
> 18:54:34.373418 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0xc), length 132<br>
> <br>
> 18:54:34.373637 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x20), length 132<br>
> <br>
> 18:54:35.397405 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0xd), length 132<br>
> <br>
> 18:54:35.397704 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x21), length 132<br>
> <br>
> 18:54:36.421384 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0xe), length 132<br>
> <br>
> 18:54:36.421756 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x22), length 132<br>
> <br>
> 18:54:37.445419 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0xf), length 132<br>
> <br>
> 18:54:37.445743 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x23), length 132<br>
> <br>
> 18:54:38.469436 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0x10), length 132<br>
> <br>
> 18:54:38.469731 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x24), length 132<br>
> <br>
> 18:54:39.493356 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0x11), length 132<br>
> <br>
> 18:54:39.493734 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x25), length 132<br>
> <br>
> 18:54:40.517449 IP mochalla > <a href="http://192.168.1.1" target="_blank">192.168.1.1</a>: ESP(spi=0x2816000e,seq=0x12), length 132<br>
> <br>
> 18:54:40.517762 IP 192.168.1.1 > mochalla: ESP(spi=0xc9a37c21,seq=0x26), length 132<br>
> <br>
> root@mochalla:~# sysctl -p<br>
> <br>
> net.ipv4.ip_forward = 1<br>
> <br>
> net.ipv6.conf.all.forwarding = 1<br>
> <br>
> root@mochalla:~# iptables-save<br>
> <br>
> # Generated by iptables-save v1.8.4 on Wed Jan 26 18:57:04 2022<br>
> <br>
> *filter<br>
> <br>
> :INPUT ACCEPT [1438:141334]<br>
> <br>
> :FORWARD ACCEPT [0:0]<br>
> <br>
> :OUTPUT ACCEPT [1780:162854]<br>
> <br>
> :ufw-after-forward - [0:0]<br>
> <br>
> :ufw-after-input - [0:0]<br>
> <br>
> :ufw-after-logging-forward - [0:0]<br>
> <br>
> :ufw-after-logging-input - [0:0]<br>
> <br>
> :ufw-after-logging-output - [0:0]<br>
> <br>
> :ufw-after-output - [0:0]<br>
> <br>
> :ufw-before-forward - [0:0]<br>
> <br>
> :ufw-before-input - [0:0]<br>
> <br>
> :ufw-before-logging-forward - [0:0]<br>
> <br>
> :ufw-before-logging-input - [0:0]<br>
> <br>
> :ufw-before-logging-output - [0:0]<br>
> <br>
> :ufw-before-output - [0:0]<br>
> <br>
> :ufw-logging-allow - [0:0]<br>
> <br>
> :ufw-logging-deny - [0:0]<br>
> <br>
> :ufw-not-local - [0:0]<br>
> <br>
> :ufw-reject-forward - [0:0]<br>
> <br>
> :ufw-reject-input - [0:0]<br>
> <br>
> :ufw-reject-output - [0:0]<br>
> <br>
> :ufw-skip-to-policy-forward - [0:0]<br>
> <br>
> :ufw-skip-to-policy-input - [0:0]<br>
> <br>
> :ufw-skip-to-policy-output - [0:0]<br>
> <br>
> :ufw-track-forward - [0:0]<br>
> <br>
> :ufw-track-input - [0:0]<br>
> <br>
> :ufw-track-output - [0:0]<br>
> <br>
> :ufw-user-forward - [0:0]<br>
> <br>
> :ufw-user-input - [0:0]<br>
> <br>
> :ufw-user-limit - [0:0]<br>
> <br>
> :ufw-user-limit-accept - [0:0]<br>
> <br>
> :ufw-user-logging-forward - [0:0]<br>
> <br>
> :ufw-user-logging-input - [0:0]<br>
> <br>
> :ufw-user-logging-output - [0:0]<br>
> <br>
> :ufw-user-output - [0:0]<br>
> <br>
> COMMIT<br>
> <br>
> I am not sure why the ping packets are not getting forwarded to the ens224 interface. Though the ipv4 forwarding option is set, I observe that the FORWARD chain counter is not increasing.<br>
> <br>
> Am I missing something basic here? Any pointers are deeply appreciated.<br>
> <br>
> Thanks,<br>
> <br>
> Mohit<br>
> <o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>