You are not logged in.

#1 2019-05-11 21:00:09

TheChosenOne
Member
Registered: 2012-09-27
Posts: 130

OpenVPN loses connection after some time

I'm running openvpn through this command:

sudo openvpn --config vpn.ovpn

which works. I can ping several websites.

After a while, I cannot ping anything anymore, including ip addresses. I can still ping an internal ip.
The openvpn command is still running.

Is there a way to enable logging or check some logs?

Thanks.

Offline

#2 2019-05-11 21:02:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: OpenVPN loses connection after some time

Make some effort to help yourself.

man openvpn | less -p logging

Better, actually read the wiki and start it correctly and get logging for free: https://wiki.archlinux.org/index.php/Op … figuration


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-05-12 19:34:51

TheChosenOne
Member
Registered: 2012-09-27
Posts: 130

Re: OpenVPN loses connection after some time

After the Initialization Sequence Completed:

Sun May 12 15:58:59 2019 [XXX] Inactivity timeout (--ping-restart), restarting
Sun May 12 15:58:59 2019 SIGUSR1[soft,ping-restart] received, process restarting
Sun May 12 15:58:59 2019 Restart pause, 5 second(s)
Sun May 12 15:59:04 2019 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Sun May 12 15:59:04 2019 TCP/UDP: Preserving recently used remote address: [AF_INET]XXX.XXX.XXX.XXX:443
Sun May 12 15:59:04 2019 Socket Buffers: R=[163840->163840] S=[163840->163840]
Sun May 12 15:59:04 2019 UDP link local: (not bound)
Sun May 12 15:59:04 2019 UDP link remote: [AF_INET]XXX.XXX.XXX.XXX:XXX

'Restart pause' happens at increasing intervals.

According to the man page:

OpenVPN to exit after n seconds of inactivity on the TUN/TAP device. The time length of inactivity is measured since the last incoming or outgoing tunnel packet.  The default value  is  0 seconds, which disables this feature.

So now I'm confused.

Edit: The command I'm using right now is:

sudo openvpn --log-append vpn.log --script-security 2 --setenv PATH '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --up /etc/openvpn/scripts/update-systemd-resolved --down /etc/openvpn/scripts/update-systemd-resolved --down-pre --config vpn.ovpn &

As I followed this guide: https://github.com/jonathanio/update-systemd-resolved

Last edited by TheChosenOne (2019-05-12 19:42:12)

Offline

#4 2019-05-13 16:35:23

alfalfa
Member
Registered: 2017-06-30
Posts: 63
Website

Re: OpenVPN loses connection after some time

Offline

#5 2019-05-13 19:51:22

TheChosenOne
Member
Registered: 2012-09-27
Posts: 130

Re: OpenVPN loses connection after some time

Nope. This file does not exist.

Offline

Board footer

Powered by FluxBB