@Sob Thanks. I activated some logging, and did see something. See below.
@pe1chl I sadly have no clue what the other side uses as vpn server / router. Its a commercial VPN service (nordvpn).
Here’s my config:
/interface l2tp-client
add connect-to=xyz.nordvpn.com ipsec-secret=secret name=myvpn password=\
mypassword profile=default use-ipsec=yes user=username
As soon as I disable IPsec, the VPN connection is stable. Enabled, it goes up and down and up and down…
So, after I enabled logging (both for ipsec and l2tp), I saw this in the logs (I just replaced the remote ip address with 111.111.111.111):
Jul/04/2017 21:03:26 l2tp,debug,packet sent control message to 111.111.111.111:1701 from 0.0.0.0:1701
Jul/04/2017 21:03:26 l2tp,debug,packet tunnel-id=0, session-id=0, ns=0, nr=0
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Message-Type=SCCRQ
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Protocol-Version=0x01:00
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Framing-Capabilities=0x1
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Bearer-Capabilities=0x0
Jul/04/2017 21:03:26 l2tp,debug,packet Firmware-Revision=0x1
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Host-Name="MikroTik"
Jul/04/2017 21:03:26 l2tp,debug,packet Vendor-Name="MikroTik"
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Assigned-Tunnel-ID=1
Jul/04/2017 21:03:26 l2tp,debug,packet (M) Receive-Window-Size=4
Jul/04/2017 21:03:30 ipsec,debug KA: 192.168.178.54[4500]->111.111.111.111[4500]
Jul/04/2017 21:03:30 ipsec,debug 1 times of 1 bytes message will be sent to 111.111.111.111[4500]
Jul/04/2017 21:03:30 ipsec,debug,packet ff
Jul/04/2017 21:03:31 ipsec,debug ===== received 92 bytes from 111.111.111.111[4500] to 192.168.178.54[4500]
... // a bunch of ipsec messages, all debug output, a lot of byte blocks, nothing that looks like an error...
Jul/04/2017 21:03:31 ipsec,debug hash validated.
Jul/04/2017 21:03:31 ipsec,debug begin.
Jul/04/2017 21:03:31 ipsec,debug seen nptype=8(hash) len=24
Jul/04/2017 21:03:31 ipsec,debug seen nptype=11(notify) len=32
Jul/04/2017 21:03:31 ipsec,debug succeed.
Jul/04/2017 21:03:31 ipsec 111.111.111.111 notify: R_U_THERE
Jul/04/2017 21:03:31 ipsec,debug 111.111.111.111 DPD R-U-There received
Jul/04/2017 21:03:31 ipsec,debug compute IV for phase2
Jul/04/2017 21:03:31 ipsec,debug phase1 last IV:
... // a bunch of other bytes, showing that something gets encrypted and decrypted, without error messages...
Jul/04/2017 21:03:31 ipsec,debug HASH computed:
Jul/04/2017 21:03:31 ipsec,debug 5936534c 303b793a 13246fd1 98a6d548 13193314
Jul/04/2017 21:03:31 ipsec,debug hash validated.
Jul/04/2017 21:03:31 ipsec,debug begin.
Jul/04/2017 21:03:31 ipsec,debug seen nptype=8(hash) len=24
Jul/04/2017 21:03:31 ipsec,debug seen nptype=11(notify) len=12
Jul/04/2017 21:03:31 ipsec,debug succeed.
Jul/04/2017 21:03:31 ipsec 111.111.111.111 notify: INVALID-HASH-INFORMATION
Jul/04/2017 21:03:31 ipsec 111.111.111.111 fatal INVALID-HASH-INFORMATION notify messsage, phase1 should be deleted.
Jul/04/2017 21:03:34 l2tp,debug tunnel 1 received no replies, disconnecting
Jul/04/2017 21:03:34 l2tp,debug tunnel 1 entering state: dead
Jul/04/2017 21:03:34 l2tp,debug session 1 entering state: dead
Jul/04/2017 21:03:34 l2tp,ppp,info myvpn: terminating... - session closed
Jul/04/2017 21:03:34 l2tp,ppp,debug myvpn: LCP lowerdown
Jul/04/2017 21:03:34 l2tp,ppp,debug myvpn: LCP down event in initial state
Jul/04/2017 21:03:34 l2tp,ppp,info myvpn: disconnected