<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>I do the same thing with OSPF (with BIRD 2). </div><div><br class=""></div><div>I’m going to take a guess that StrongSWAN is working fine and your router is not sensing the transition of it, so it doesn’t know when (or where) to route. But I can’t exactly tell if you are setting up interfaces with an updown script, I don’t see them here. See <a href="https://wiki.strongswan.org/projects/strongswan/wiki/RouteBasedVPN#XFRM-Interfaces-on-Linux" class="">https://wiki.strongswan.org/projects/strongswan/wiki/RouteBasedVPN#XFRM-Interfaces-on-Linux</a> and <a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/_updown/_updown.in" class="">https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/_updown/_updown.in</a>.</div><div><br class=""></div><div>After you have interfaces working properly, have your OSPF configured against the interfaces (I just use something like `vti*` wildcard so I can name them anything) and you should see correct behavior.</div><div><br class=""></div><div>Last point of note, I just define `0.0.0.0/0` on left/rightsubnet. If your deployment gets supersized, you won’t want to be going back and updating networks on every gateway, though you will probably want to do that from LDAP for road warriors. </div><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 19, 2020, at 10:53 PM, TomK <<a href="mailto:tomkcpr@mdevsys.com" class="">tomkcpr@mdevsys.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 6/19/2020 10:56 PM, Brian Topping wrote:<br class=""><blockquote type="cite" class="">Sounds like you’re unable to look at traffic on both sides. Unless you’re looking closely at the logs and know what’s happening, it’s hard to debug. It also looks as if you’ve rather heavily sanitized the console logs, for instance the ping destination.<br class="">This line concerns me:<br class=""><blockquote type="cite" class="">Jun 19 19:57:11 14[KNL] error installing route with policy 10.3.0.0/24 === 10.10.0.0/24 out<br class=""></blockquote>If your are coming from or going to 100.100.100.100 and using transport instead of tunnel, these routes being installed are wrong, which becomes a configuration issue.<br class="">Best way to post is to take the console output verbatim, then replace the first two octets of every IP address you want to sanitize with unique letters so the addresses can be distinguished.  Easier if you can put the content into something like pastebin or gist instead of mailing to the list for viewing purposes.<br class="">Sent from my iPhone<br class=""><blockquote type="cite" class="">On Jun 19, 2020, at 19:28, TomK <<a href="mailto:tomkcpr@mdevsys.com" class="">tomkcpr@mdevsys.com</a>> wrote:<br class=""><br class="">Jun 19 19:57:11 14[KNL] error installing route with policy 10.3.0.0/24 === 10.10.0.0/24 out<br class=""></blockquote></blockquote><br class="">Thank you.  Attached the logs.<br class=""><br class="">https COLON //www DOT microdevsys DOT com/WordPressFiles/charon.log<br class="">https COLON //www DOT microdevsys DOT com/WordPressFiles/var-log-messages.txt<br class=""><br class=""><br class="">Config files:<br class=""><br class="">root@DD-WRT:~# cat /opt/etc/ipsec.conf<br class=""># ipsec.conf - strongSwan IPsec configuration file<br class=""><br class=""># basic configuration<br class=""><br class="">config setup<br class="">        # strictcrlpolicy=yes<br class="">        # uniqueids = no<br class=""><br class=""># Add connections here.<br class=""><br class="">conn REMOTE-VLAN1<br class="">        authby=secret<br class="">        auto=start<br class="">        type=tunnel<br class="">        keyexchange=ikev2<br class="">        keylife=3600s<br class="">        ikelifetime=28800s<br class="">        rekey=yes<br class="">        rekeymargin=3m<br class="">        keyingtries=1<br class="">        mobike=no<br class="">        dpdaction=none<br class="">        lifebytes=102400000<br class="">        left=100.100.100.100                 # IP address of your on-premises gateway<br class="">leftsubnet=192.168.0.0/24,10.0.0.0/24,10.1.0.0/24,10.2.0.0/24,10.3.0.0/24       # Home LAB - Local<br class="">        # leftnexthop=%defaultroute<br class="">        right=123.123.123.123                   # Remote VPN gateway IP address<br class="">rightsubnet=10.10.0.0/24,10.10.1.0/24,10.10.2.0/24,10.10.3.0/24,10.10.4.0/24    # Remote network subnet defined in public cloud<br class="">        ike=aes256-sha1-modp1024<br class="">        esp=aes256-sha1<br class=""><br class="">root@DD-WRT:~#<br class=""><br class=""><br class=""><br class="">root@DD-WRT:~# cat /opt/etc/strongswan.conf<br class=""># strongswan.conf - strongSwan configuration file<br class="">#<br class=""># Refer to the strongswan.conf(5) manpage for details<br class="">#<br class=""># Configuration changes should be made in the included files<br class=""># Verbosity levels<br class=""># -1: Absolutely silent<br class=""># 0: Very basic auditing logs, (e.g. SA up/SA down)<br class=""># 1: Generic control flow with errors, a good default to see whats going on<br class=""># 2: More detailed debugging control flow<br class=""># 3: Including RAW data dumps in Hex<br class=""># 4: Also include sensitive material in dumps, e.g. keys<br class="">charon {<br class="">        load_modular = yes<br class="">        plugins {<br class="">                include strongswan.d/charon/*.conf<br class="">        }<br class="">        filelog {<br class="">                charon {<br class="">                        path = /opt/tmp/charon.log<br class="">                        time_format = %b %e %T<br class="">                        append = no<br class="">                        default = 2 # in case troubleshoot is required switch this to 2<br class="">                }<br class="">                stderr {<br class="">                        ike = 2 # in case troubleshoot is required switch this to 2<br class="">                        knl = 3 # in case troubleshoot is required switch this to 3<br class="">                        ike_name = yes<br class="">                }<br class="">        }<br class="">        syslog {<br class="">                # enable logging to LOG_DAEMON, use defaults<br class="">                daemon {<br class="">                }<br class="">                # minimalistic IKE auditing logging to LOG_AUTHPRIV<br class="">                auth {<br class="">                        default = 2 # in case troubleshoot is required switch this to 2<br class="">                        ike = 2 # in case troubleshoot is required switch this to 2<br class="">                }<br class="">        }<br class="">}<br class="">include strongswan.d/*.conf<br class="">root@DD-WRT:~#<br class=""><br class=""><br class="">root@DD-WRT:~# ipsec statusall<br class="">Status of IKE charon daemon (strongSwan 5.8.2, Linux 4.4.190, armv7l):<br class="">  uptime: 28 seconds, since Jun 19 23:04:51 2020<br class="">  malloc: sbrk 892928, mmap 0, used 493392, free 399536<br class="">  worker threads: 6 of 16 idle, 6/0/4/0 working, job queue: 0/0/0/0, scheduled: 4<br class="">  loaded plugins: charon test-vectors ldap pkcs11 aes des blowfish rc2 sha2 sha1 md4 md5 random nonce x509 revoca                       tion constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl gcrypt fips-prf gmp gmpdh curve255                       19 agent xcbc cmac hmac ctr ccm gcm curl mysql sqlite attr kernel-libipsec kernel-netlink resolve socket-default socket-dynamic farp stroke vici smp updown eap-identity eap-md5 eap-mschapv2 eap-radius eap-tls xauth-generic xau th-eap dhcp whitelist led duplicheck addrblock unity<br class="">Listening IP addresses:<br class="">  100.100.100.100<br class="">  192.168.0.6<br class="">  192.168.45.1<br class="">  192.168.75.1<br class="">  10.1.1.1<br class="">Connections:<br class=""> AZURE-VLAN1:  100.100.100.100...123.123.123.123  IKEv2<br class=""> AZURE-VLAN1:   local:  [100.100.100.100] uses pre-shared key authentication<br class=""> AZURE-VLAN1:   remote: [123.123.123.123] uses pre-shared key authentication<br class=""> AZURE-VLAN1:   child:  192.168.0.0/24 10.0.0.0/24 10.1.0.0/24 10.2.0.0/24 10.3.0.0/24 === 10.10.0.0/24 10.10.1.0 /24 10.10.2.0/24 10.10.3.0/24 10.10.4.0/24 TUNNEL<br class="">Security Associations (1 up, 0 connecting):<br class=""> AZURE-VLAN1[1]: ESTABLISHED 27 seconds ago, 100.100.100.100[100.100.100.100]...123.123.123.123[123.123.123.123]<br class=""> AZURE-VLAN1[1]: IKEv2 SPIs: 5464f1e04af780fd_i* fa01060f92607d17_r, pre-shared key reauthentication in 7 hours<br class=""> AZURE-VLAN1[1]: IKE proposal: AES_CBC_256/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1024<br class="">root@DD-WRT:~#<br class=""><br class=""><br class="">root@DD-WRT:~# opkg list-installed|grep -Ei strongswan<br class="">strongswan - 5.8.2-1<br class="">strongswan-charon - 5.8.2-1<br class="">strongswan-ipsec - 5.8.2-1<br class="">strongswan-libtls - 5.8.2-1<br class="">strongswan-mod-addrblock - 5.8.2-1<br class="">strongswan-mod-aes - 5.8.2-1<br class="">strongswan-mod-af-alg - 5.8.2-1<br class="">strongswan-mod-agent - 5.8.2-1<br class="">strongswan-mod-attr - 5.8.2-1<br class="">strongswan-mod-attr-sql - 5.8.2-1<br class="">strongswan-mod-blowfish - 5.8.2-1<br class="">strongswan-mod-ccm - 5.8.2-1<br class="">strongswan-mod-cmac - 5.8.2-1<br class="">strongswan-mod-constraints - 5.8.2-1<br class="">strongswan-mod-coupling - 5.8.2-1<br class="">strongswan-mod-ctr - 5.8.2-1<br class="">strongswan-mod-curl - 5.8.2-1<br class="">strongswan-mod-curve25519 - 5.8.2-1<br class="">strongswan-mod-des - 5.8.2-1<br class="">strongswan-mod-dhcp - 5.8.2-1<br class="">strongswan-mod-dnskey - 5.8.2-1<br class="">strongswan-mod-duplicheck - 5.8.2-1<br class="">strongswan-mod-eap-identity - 5.8.2-1<br class="">strongswan-mod-eap-md5 - 5.8.2-1<br class="">strongswan-mod-eap-mschapv2 - 5.8.2-1<br class="">strongswan-mod-eap-radius - 5.8.2-1<br class="">strongswan-mod-eap-tls - 5.8.2-1<br class="">strongswan-mod-farp - 5.8.2-1<br class="">strongswan-mod-fips-prf - 5.8.2-1<br class="">strongswan-mod-gcm - 5.8.2-1<br class="">strongswan-mod-gcrypt - 5.8.2-1<br class="">strongswan-mod-gmp - 5.8.2-1<br class="">strongswan-mod-gmpdh - 5.8.2-1<br class="">strongswan-mod-ha - 5.8.2-1<br class="">strongswan-mod-hmac - 5.8.2-1<br class="">strongswan-mod-kernel-libipsec - 5.8.4-1<br class="">strongswan-mod-kernel-netlink - 5.8.2-1<br class="">strongswan-mod-ldap - 5.8.2-1<br class="">strongswan-mod-led - 5.8.2-1<br class="">strongswan-mod-load-tester - 5.8.2-1<br class="">strongswan-mod-md4 - 5.8.2-1<br class="">strongswan-mod-md5 - 5.8.2-1<br class="">strongswan-mod-mysql - 5.8.2-1<br class="">strongswan-mod-nonce - 5.8.2-1<br class="">strongswan-mod-openssl - 5.8.2-1<br class="">strongswan-mod-pem - 5.8.2-1<br class="">strongswan-mod-pgp - 5.8.2-1<br class="">strongswan-mod-pkcs1 - 5.8.2-1<br class="">strongswan-mod-pkcs11 - 5.8.2-1<br class="">strongswan-mod-pkcs12 - 5.8.2-1<br class="">strongswan-mod-pkcs7 - 5.8.2-1<br class="">strongswan-mod-pkcs8 - 5.8.2-1<br class="">strongswan-mod-pubkey - 5.8.2-1<br class="">strongswan-mod-random - 5.8.2-1<br class="">strongswan-mod-rc2 - 5.8.2-1<br class="">strongswan-mod-resolve - 5.8.2-1<br class="">strongswan-mod-revocation - 5.8.2-1<br class="">strongswan-mod-sha1 - 5.8.2-1<br class="">strongswan-mod-sha2 - 5.8.2-1<br class="">strongswan-mod-smp - 5.8.2-1<br class="">strongswan-mod-socket-default - 5.8.2-1<br class="">strongswan-mod-socket-dynamic - 5.8.2-1<br class="">strongswan-mod-sql - 5.8.2-1<br class="">strongswan-mod-sqlite - 5.8.2-1<br class="">strongswan-mod-sshkey - 5.8.2-1<br class="">strongswan-mod-stroke - 5.8.2-1<br class="">strongswan-mod-test-vectors - 5.8.2-1<br class="">strongswan-mod-unity - 5.8.2-1<br class="">strongswan-mod-updown - 5.8.2-1<br class="">strongswan-mod-vici - 5.8.2-1<br class="">strongswan-mod-whitelist - 5.8.2-1<br class="">strongswan-mod-x509 - 5.8.2-1<br class="">strongswan-mod-xauth-eap - 5.8.2-1<br class="">strongswan-mod-xauth-generic - 5.8.2-1<br class="">strongswan-mod-xcbc - 5.8.2-1<br class="">strongswan-pki - 5.8.2-1<br class="">strongswan-scepclient - 5.8.2-1<br class="">strongswan-swanctl - 5.8.2-1<br class="">root@DD-WRT:~#<br class=""><br class=""><br class="">Firewall config.  I had lines like this:<br class=""><br class=""><br class="">iptables -I FORWARD -s 10.10.0.0/24 -d 192.168.0.0/24 -j ACCEPT<br class="">iptables -I INPUT -p icmp -s 10.10.0.0/24 -d 192.168.0.0/24 -j ACCEPT<br class=""><br class=""><br class="">But when I took them out, it made no difference at all. So I effectively have nothing for StrongSwan in my local F/W configuration at the moment.<br class=""><br class=""><br class="">100.100.100.100 is my local environment.  123.123.123.123 is a remote cloud provider, Azure.   I'm also running OSPF on the DD-WRT LOCAL routers so none of my routers are configured as Gateways as typically would be the case.  OSPF handles my local routing.  Works like a charm.<br class=""><br class=""><br class="">ISSUE DESCRIPTION ------------------------------<br class=""><br class=""><br class="">When I try to ping the remote cloud VM on 10.10.0.4 from my local router that I'm using for StrongSwan:<br class=""><br class=""><br class="">root@DD-WRT:~# ping 10.10.0.4<br class="">PING 10.10.0.4 (10.10.0.4): 56 data bytes<br class=""><br class=""><br class="">Nothing happens.  There is no activity on the ipsec0 interface at all:<br class=""><br class=""><br class=""># tcpdump -i ipsec0 -s 0 -n arp or icmp<br class="">tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br class="">listening on ipsec0, link-type RAW (Raw IP), snapshot length 262144 bytes<br class="">(EMPTY)<br class=""><br class=""><br class="">At this point I SSH to the cloud VM via the public IP and initiate a ping in return to any IP on my LOCAL on-PREM environment VLAN 192.168.0.0/24 and this works fine:<br class=""><br class=""><br class="">[root@cm-azure-wn03 ~]# ping 192.168.0.154<br class="">PING 192.168.0.154 (192.168.0.154) 56(84) bytes of data.<br class="">(short pause)<br class="">64 bytes from 192.168.0.154: icmp_seq=4 ttl=63 time=46.5 ms<br class="">64 bytes from 192.168.0.154: icmp_seq=5 ttl=63 time=48.5 ms<br class="">64 bytes from 192.168.0.154: icmp_seq=6 ttl=63 time=46.6 ms<br class=""><br class=""><br class="">SSH and everything else works great from REMOTE to LOCAL as well.<br class=""><br class=""><br class="">[root@cm-azure-wn03 ~]# ip route show<br class="">default via 10.10.0.1 dev eth0 proto dhcp metric 100<br class="">10.10.0.0/24 dev eth0 proto kernel scope link src 10.10.0.4 metric 100<br class="">168.63.100.16 via 10.10.0.1 dev eth0 proto dhcp metric 100<br class="">169.254.100.254 via 10.10.0.1 dev eth0 proto dhcp metric 100<br class="">[root@cm-azure-wn03 ~]#<br class=""><br class=""><br class="">and sure enough, traffic is registered on the tcpdump running against the ipsec01 interface when pinging from REMOTE to LOCAL, as expected:<br class=""><br class=""><br class="">root@DD-WRT:~# tcpdump -i ipsec0 -s 0 -n arp or icmp<br class="">tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br class="">listening on ipsec0, link-type RAW (Raw IP), snapshot length 262144 bytes<br class="">23:46:03.793056 IP 10.10.0.4 > 192.168.0.154: ICMP echo request, id 7426, seq 1, length 64<br class="">23:46:03.796663 IP 192.168.0.154 > 10.10.0.4: ICMP echo reply, id 7426, seq 1, length 64<br class="">23:46:04.869369 IP 10.10.0.4 > 192.168.0.154: ICMP echo request, id 7426, seq 2, length 64<br class="">23:46:04.872168 IP 192.168.0.154 > 10.10.0.4: ICMP echo reply, id 7426, seq 2, length 64<br class=""><br class=""><br class="">So from REMOTE to LOCAL it works fine.  But now here's where it get's interesting.  I'll go back to the LOCAL terminal whence I started the first ping and repeat the ping once more:<br class=""><br class=""><br class="">root@DD-WRT:~# ping 10.10.0.4<br class="">PING 10.10.0.4 (10.10.0.4): 56 data bytes<br class=""><br class=""><br class="">And now I see ICMP echo requests going out and registering on ipsec0.<br class=""><br class=""><br class=""># tcpdump -i ipsec0 -s 0 -n icmp<br class="">tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br class="">listening on ipsec0, link-type RAW (Raw IP), snapshot length 262144 bytes<br class="">23:59:25.566796 IP 100.100.100.100 > 10.10.0.4: ICMP echo request, id 63869, seq 5, length 64<br class="">23:59:26.576196 IP 100.100.100.100 > 10.10.0.4: ICMP echo request, id 63869, seq 6, length 64<br class="">23:59:27.585537 IP 100.100.100.100 > 10.10.0.4: ICMP echo request, id 63869, seq 7, length 64<br class="">23:59:28.598500 IP 100.100.100.100 > 10.10.0.4: ICMP echo request, id 63869, seq 8, length 64<br class=""><br class=""><br class="">but no reply is coming back.  Next, I tried to add some NAT rules:<br class=""><br class=""><br class="">root@DD-WRT:~# iptables -t nat -I POSTROUTING -s 10.10.0.0/24 -m policy --dir out --pol ipsec -j ACCEPT<br class="">iptables v1.3.7: Couldn't find match `policy'<br class=""><br class="">but no luck.<br class=""><br class="">At this point I'm thinking it could be one of these four items:<br class=""><br class=""><br class="">1) Azure VPN Gateway is blocking ping from LOCAL to REMOTE.  Having trouble figuring out how to pin point this via their logs or StrongSwan logs.<br class=""><br class="">2) StrongSwan is misconfigured so pings towards one of the REMOTE VLAN's is never sent over the StrongSwan VPN Gateway at all.  Leaning towards this since packets aren't even making it into ipsec0 interface to begin with unless I ping from REMOTE to LOCAL.  At that point it appears they terminate at the ipsec0 interface and go no further, hence suspecting misconfiguration.  But can't prove it yet.<br class=""><br class="">3) I need NAT rules such as the one above.<br class=""><br class="">4) I'm missing kernel modules on DD-WRT.  Or a module isn't loaded, when it should be.<br class=""><br class=""><br class="">-- <br class="">Thx,<br class="">TK.<br class=""></div></div></blockquote></div><br class=""></body></html>