-2

I have set up a vpn server using the scripts in https://github.com/hwdsl2/setup-ipsec-vpn.

I am connecting from my Mac to my personal vpn running on an Ubuntu server.

It disconnects after 3 minutes and 30 seconds.

Here is what i see from Mac vpn client logs:

tail -100f /var/log/ppp.log

Mon Apr 27 13:34:51 2020 : L2TP received StopCCN
Mon Apr 27 13:34:51 2020 : L2TP hangup
Mon Apr 27 13:34:51 2020 : ipcp: down
Mon Apr 27 13:34:51 2020 : Connection terminated.
Mon Apr 27 13:34:51 2020 : L2TP clearing port-mapping for en0
Mon Apr 27 13:34:51 2020 : Connect time 2.6 minutes.
Mon Apr 27 13:34:51 2020 : Sent 1028457 bytes, received 5762343 bytes.
Mon Apr 27 13:34:51 2020 : L2TP disconnecting...
Mon Apr 27 13:34:51 2020 : L2TP sent CDN
Mon Apr 27 13:34:51 2020 : L2TP sent StopCCN
Mon Apr 27 13:34:51 2020 : L2TP disconnected

Here is what i see on the server side:

tail -f /var/log/auth.log

Apr 27 10:34:20 ip-172-31-40-152 pluto[3459]: "l2tp-psk"[2] 149.0.138.78 #1: IKEv1 DPD action - clearing connection kind CK_INSTANCE
Apr 27 10:34:20 ip-172-31-40-152 pluto[3459]: "l2tp-psk" #2: deleting state (STATE_QUICK_R2) aged 120.084s and sending notification
Apr 27 10:34:20 ip-172-31-40-152 pluto[3459]: "l2tp-psk" #2: ESP traffic information: in=1MB out=6MB
Apr 27 10:34:20 ip-172-31-40-152 pluto[3459]: "l2tp-psk" #1: deleting state (STATE_MAIN_R3) aged 121.125s and sending notification
Apr 27 10:34:20 ip-172-31-40-152 pluto[3459]: "l2tp-psk"[2] 149.0.138.78: deleting connection "l2tp-psk"[2] 149.0.138.78 instance with peer 149.0.138.78 {isakmp=#0/ipsec=#0}


tail -f /var/log/syslog

Apr 27 10:52:03 ip-172-31-40-152 xl2tpd[3043]: Maximum retries exceeded for tunnel 39830.  Closing.
Apr 27 10:52:03 ip-172-31-40-152 pppd[4266]: Modem hangup
Apr 27 10:52:03 ip-172-31-40-152 systemd-networkd[700]: ppp0: Link DOWN
Apr 27 10:52:03 ip-172-31-40-152 pppd[4266]: Connect time 3.6 minutes.
Apr 27 10:52:03 ip-172-31-40-152 systemd-networkd[700]: ppp0: Lost carrier
Apr 27 10:52:03 ip-172-31-40-152 pppd[4266]: Sent 94682 bytes, received 107101 bytes.
Apr 27 10:52:03 ip-172-31-40-152 systemd-timesyncd[526]: Network configuration changed, trying to establish connection.
Apr 27 10:52:03 ip-172-31-40-152 xl2tpd[3043]: Terminating pppd: sending TERM signal to pid 4266
Apr 27 10:52:03 ip-172-31-40-152 xl2tpd[3043]: Connection 24 closed to 149.0.138.78, port 59243 (Timeout)
Apr 27 10:52:03 ip-172-31-40-152 pppd[4266]: Connection terminated.
Apr 27 10:52:03 ip-172-31-40-152 pppd[4266]: Exit.
Apr 27 10:52:03 ip-172-31-40-152 systemd-timesyncd[526]: Synchronized to time server 91.189.91.157:123 (ntp.ubuntu.com).

The server runs on AWS. I tried changing server IP address, recreating the server from the image. But they didn't work.

(!) I used to connect the vpn server without hassle before. After I changed my ISP, I started to have this problem. ISP support has no idea about the issue.

What could be wrong with the setup?

Halil
  • 115
  • 1
  • 5

1 Answers1

1

After experimenting some configuration changes in /etc/ipsec.conf, I found out increasing dpdtimeout resolved my problem:

I updated dpdtimeout value from 120 to 1200.

dpdtimeout=1200

Now, I do not get disconnected from VPN server any more.

Halil
  • 115
  • 1
  • 5