/system logging
add action=memory topic=ipsec,!debug
Hi Bene007, can you share how can you connect with this configuration to strong swan? I need to keep this ipsec configuration, I can't upgrade to version 7 for other vpn options, I need to stay on version 6, thanksI have exactly the same problem. A connection can be established from the VPN client (Android 13, also Android 14 - IKEv2/IPSec RSA), but nothing can be reached either in the local network or on the Internet. Clients in the network can reach the VPN client.
No settings have been changed and no updates have been made recently.
It stopped working from one day to the next.
Edit:
I no longer use the native VPN in Android, but Strongswan instead. It works then again. However, it's still very strange.
If somebody could enable IPsec logging and post the log here, I would be glad to help:
@johnb175a, in your case, the VPN tunnel establishes, so the problem is somewhere else. That's why I would additionally need a full export of the config:
/export file=anynameyouwish (minus sensitive info)
/ip address
add address=192.168.10.1/24 interface=lo1
/ip ipsec policy group
add name=ikev2-policies
/ip ipsec policy
add dst-address=192.168.10.0/24 group=ike2-policies proposal=proposal1 src-address=0.0.0.0/0 template=yes
I get "input does not match any value of interface". I see a lo interface, but not a lo1.Code: Select all/ip address add address=192.168.10.1/24 interface=lo1
So the name is lo:I get "input does not match any value of interface". I see a lo interface, but not a lo1.
/ip address
add address=192.168.10.1/24 interface=lo
Should I assign the IP to lo or create a bridge-loopback and assign it there? I was reading another article that seemed to indicate a bridge-loopback interface needed to be added with no members. It's so strange that this all worked without all these changes a while back. Although I am not sure if it was working before I jumped to 7.x or after.So the name is lo:Code: Select all/ip address add address=192.168.10.1/24 interface=lo
It's one and the same. The lo interface was exposed precisely to eliminate the need for a loopback bridgeShould I assign the IP to lo or create a bridge-loopback and assign it there?
Quite odd indeed, although changes regarding IPsec were introduced, of which I'm not fully aware.It's so strange that this all worked without all these changes a while back. Although I am not sure if it was working before I jumped to 7.x or after.
Ok, I applied all the changes you suggested but the problem persist. Any other things to try? I'm at a loss. It connects fine and passes traffic from the router and from machines behind the router to the android road warrior, but from the android road warrior to the router or anything behind it, nothing.It's one and the same. The lo interface was exposed precisely to eliminate the need for a loopback bridge
This forum does not support automatic notifications when someone mentions you so the only reliable way of paging someone is to find a recent topic to which that user has contributed and post an off-topic message there (usually with a reference to the topic you want them to assist with). For me in particular, @anav sometimes works as a relay but that only works with wireguard and topics dealing with policy routing and similar, not with IPsec.That's why I'll once again ask @sindy to have a look at your case
I also set the lo interface to 192.168.10.1/24 and the pool from 192.168.10.2 to 192.168.10.6. However when I configure it like that from a machine behind the router I can no longer ping the vpn client. I get TTL expired in transit. If I remove the lo interface I can then ping the client and get a reply, but the client can still not ping the router or any device behind it.
/ip ipsec installed-sa print detail
Code: Select allFlags: S - seen-traffic; H - hw-aead; A - AH, E - ESP 0 S E spi=0xCE3600B src-address=1.2.3.4:56214 dst-address=5.6.7.8:4500 state=mature enc-algorithm=aes-gcm enc-key-size=288 enc-key="799494a783fde01832988a637a2b04047458a273b030f44bb4c7870982c159b77931f445" addtime=2024-08-22 15:57:12 expires-in=28m40s add-lifetime=24m20s/30m25s current-bytes=46573 current-packets=315 replay=128 1 S E spi=0xCC3E4387 src-address=5.6.7.8:4500 dst-address=1.2.3.4:56214 state=mature enc-algorithm=aes-gcm enc-key-size=288 enc-key="7537f3cdcf7750f4928319f227cfc2d25635ddbc987b174079af4aeace468fe9062a5f23" addtime=2024-08-22 15:57:12 expires-in=28m40s add-lifetime=24m20s/30m25s current-bytes=20344 current-packets=158 replay=128
/ip ipsec/statistics/print
Code: Select allin-errors: 0 in-buffer-errors: 0 in-header-errors: 0 in-no-states: 233 in-state-protocol-errors: 0 in-state-mode-errors: 0 in-state-sequence-errors: 1 in-state-expired: 0 in-state-mismatches: 0 in-state-invalid: 0 in-template-mismatches: 0 in-no-policies: 0 in-policy-blocked: 0 in-policy-errors: 0 out-errors: 0 out-bundle-errors: 0 out-bundle-check-errors: 0 out-no-states: 0 out-state-protocol-errors: 0 out-state-mode-errors: 0 out-state-sequence-errors: 0 out-state-expired: 0 out-policy-blocked: 0 out-policy-dead: 0 out-policy-errors: 0
I had to change this to /tool/sniffer/quick ip-protocol=icmp ip-address=192.168.1.2 as it would not accept just protocol=icmp in the above command./tool/sniffer/quick protocol=icmp ip-address=x.x.x.x
Columns: INTERFACE, TIME, NUM, DIR, SRC-MAC, DST-MAC, SRC-ADDRESS, DST-ADDRESS, PROTOCOL, SIZE, CPU
INTERFACE TIME NUM DIR SRC-MAC DST-MAC SRC-ADDRESS DST-ADDRESS PROTOCOL SIZE CPU
ether1 0.411 1 <- F8:F5:32:23:57:70 78:9A:18:4E:D1:DA 192.168.10.5 192.168.1.2 ip:icmp 98 2
bridge1-private 0.411 2 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 0.411 3 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 0.411 4 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
bridge1-private 0.411 5 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
ether1 2.557 6 <- F8:F5:32:23:57:70 78:9A:18:4E:D1:DA 192.168.10.5 192.168.1.2 ip:icmp 98 2
bridge1-private 2.557 7 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 2.557 8 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 2.558 9 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
bridge1-private 2.558 10 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
ether1 4.668 11 <- F8:F5:32:23:57:70 78:9A:18:4E:D1:DA 192.168.10.5 192.168.1.2 ip:icmp 98 2
bridge1-private 4.669 12 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 4.669 13 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 4.669 14 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
bridge1-private 4.669 15 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
ether1 6.794 16 <- F8:F5:32:23:57:70 78:9A:18:4E:D1:DA 192.168.10.5 192.168.1.2 ip:icmp 98 2
bridge1-private 6.794 17 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 6.794 18 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.10.5 192.168.1.2 ip:icmp 98 2
ether5 6.794 19 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
bridge1-private 6.794 20 <- 88:AE:DD:01:3C:FE 78:9A:18:4E:D1:DC 192.168.1.2 192.168.10.5 ip:icmp 98 3
Columns: INTERFACE, TIME, NUM, DIR, SRC-MAC, DST-MAC, SRC-ADDRESS, DST-ADDRESS, PROTOCOL, SIZE, CPU
INTERFACE TIME NUM DIR SRC-MAC DST-MAC SRC-ADDRESS DST-ADDRESS PROTOCOL SIZE CPU
lo 24.36 2986 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2987 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2988 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2989 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2990 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2991 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2992 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2993 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2994 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2995 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2996 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2997 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2998 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 2999 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 3000 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 3001 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 3002 -> 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
lo 24.36 3003 <- 00:00:00:00:00:00 00:00:00:00:00:00 192.168.1.2 192.168.10.5 ip:icmp 98 3
bridge1-private 24.36 3004 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.1.1 192.168.1.2 ip:icmp 126 3
ether5 24.36 3005 -> 78:9A:18:4E:D1:DC 88:AE:DD:01:3C:FE 192.168.1.1 192.168.1.2 ip:icmp 126 3
Sorry, mea culpa.I had to change this ...
Disabled, but never mind, we've smashed two flies with a single sweep. The less important one is that indeed IPsec treats lo differently from other interfaces so if you ever need to provide a route to the addresses that are ultimately accessible via IPsec peers, do not create it by attaching an IP address to lo.I wasn't sure if you wanted the test done with it enabled or disabled.
/log/print follow-only where topics~"firewall"
10:13:09 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:09 firewall,info plaintext icmp response postrou: in:bridge1-private out:ether1, connection-state:established src-mac 88:AE:DD:01:3C:FE, proto ICMP (type 0, code 0), 192.168.1.2->192.168.10.5, len 84
10:13:09 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:10 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:10 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 136
10:13:10 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:10 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:10 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:11 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 320
10:13:11 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 144
10:13:11 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:11 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:11 firewall,info plaintext icmp response postrou: in:bridge1-private out:ether1, connection-state:established src-mac 88:AE:DD:01:3C:FE, proto ICMP (type 0, code 0), 192.168.1.2->192.168.10.5, len 84
10:13:11 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:12 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 304
10:13:13 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:13 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:13 firewall,info plaintext icmp response postrou: in:bridge1-private out:ether1, connection-state:established src-mac 88:AE:DD:01:3C:FE, proto ICMP (type 0, code 0), 192.168.1.2->192.168.10.5, len 84
10:13:13 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:15 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 176
10:13:15 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:15 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 136
10:13:15 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:15 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:16 firewall,info plaintext icmp response postrou: in:bridge1-private out:ether1, connection-state:established src-mac 88:AE:DD:01:3C:FE, proto ICMP (type 0, code 0), 192.168.1.2->192.168.10.5, len 84
10:13:16 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:16 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 320
10:13:16 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 144
10:13:17 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 224
10:13:17 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
10:13:17 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 304
10:13:18 firewall,info plaintext icmp response postrou: in:bridge1-private out:ether1, connection-state:established src-mac 88:AE:DD:01:3C:FE, proto ICMP (type 0, code 0), 192.168.1.2->192.168.10.5, len 84
10:13:18 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 148
10:13:18 firewall,info encrypted icmp response output: in:(unknown 0) out:ether1, connection-state:established proto UDP, 1.2.3.4:4500->5.6.7.8:35968, len 124
It's not just ICMP. I tried to VNC and RDP onto the 192.168.1.2 machine from the Samsung VPN client and nothing. Yes, I am using the native Android VPN client. This exact setup did work a while back. I can try from another android device. This is so strange to me. So in your opinion the VPN tunnel is working correctly? It's strange that 192.168.1.2 can ping 192.168.10.5 and get a response, but 192.168.10.5 cannot get a response from 192.168.1.2 or any other workstation behind the router.So you can disable or remove the mangle rules, and proceed by praying or cursing as per your personal preferences. Do you have a chance to try with another Android phone? Do you use a native VPN client on the Samsung or something else?
Same here. All explanations I can imagine seem equally crazy to me.This is so strange to me.
On Mikrotik side, yes. It receives the transport packet carrying the request, decrypts it, extracts the plaintext payload, delivers it to the destination, gets a response (so the request must have been decrypted correctly), routes it, the IPsec stack catches it, encrypts it, and sends it to the Samsung.So in your opinion the VPN tunnel is working correctly?
Do you have any recommendations for a third party vpn client I can try on the Android? Something you are familiar with maybe. I would like to get something to work. I thought I read somewhere about strongSwan working, but I can't find it and also have no experience with it.
Guilty. When I looked at the config and the IPsec exports and everything seemed normal, I had to call you in as an IPsec expert.@TheCat12, on top of the above, the case brought in by @johnb175a is very different from the other two.
Nope, turns out it's me who has commited diagonal reading - the OP's issue is actually the same like @johnb175a's, except that the OP did not take as much effort to analyse it as @johnb175aGuilty.
The only other way is configuring User Manager (your router has a beefy flash, so no worries for installing) which could be or could be not more complicated to set up. But let's try anyway.Is there a way to make strongSwan work without going the certificate route?
As in "the Samsung bug is only related to PSK authentication", which the thread dealing with that bug suggests. It implies that the same stock VPN client that fails to work with PSK should behave properly if using other authentication methods, such as username/password to authentify the client to the server and a certificate to authenticate the server to the client, which is the simplest way you could get with Strongswan.In this case I think you won't need to install strongSwan
On Android, no.Is there a way to make strongSwan work without going the certificate route?
128 MB of flash are sufficient to run user-manager.I am running a hAP ac3 (RBD53iG-5HacD2HnD).
You can try with the native client, and if it still does not work, install Strongswan. The steps of installing a Let's Encrypt certificate and installing and configuring user-manager are the same for both cases and they require far more clicks than the installation of Strongswan to the phone.What would you recommend as the simplest option to get a working connection from Android to the Mikrotik? Would it be to use the native VPN client or strongSwan?
Somewhere at the beginning of that Samsung thread someone said that these "security updates" are downloaded in the background and installed without asking at reboot. So they broke it weeks/months ago this way, and now they fixed it this way.No updates were installed, just like the user posted on the Samsung site. Somehow, magically it started working. This is very strange.