You are not logged in.

#1 2015-11-03 00:38:06

66666thats6sixes
Member
Registered: 2015-05-25
Posts: 11

OpenVPN connection tunnels internet for a few minutes and then fails

So I can connect to my OpenVPN server just fine using NetworkManager.  Internet traffic flows through just fine, and tests confirm that it is using the VPN and not the local network.  Then after a few minutes, it just stops.  The tunnel is still there, and I can freely ping the server through the VPN connection, and I can ping things on my local network, but nothing happens when I try to ping anything else.  I suspect it's a problem with my routing.  I ran netstat -nr 3 times, once before connecting, once after connecting while the internet worked, and once after the internet stopped working, and here are the results:

[user@tcl ~]$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG        0 0          0 enp2s0
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 enp2s0
[user@tcl ~]$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.8.0.5        0.0.0.0         UG        0 0          0 tun0
0.0.0.0         10.0.0.1        0.0.0.0         UG        0 0          0 enp2s0
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 enp2s0
10.8.0.1        10.8.0.5        255.255.255.255 UGH       0 0          0 tun0
10.8.0.5        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.8.0.6        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
"server ip"  10.0.0.1        255.255.255.255 UGH       0 0          0 enp2s0
[user@tcl ~]$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 tun1
0.0.0.0         10.0.0.1        0.0.0.0         UG        0 0          0 enp2s0
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 enp2s0
10.8.0.1        10.8.0.5        255.255.255.255 UGH       0 0          0 tun0
10.8.0.5        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.8.0.5        0.0.0.0         255.255.255.255 UH        0 0          0 tun1
10.8.0.6        0.0.0.0         255.255.255.255 UH        0 0          0 tun1
"server ip"  10.0.0.1        255.255.255.255 UGH       0 0          0 enp2s0

Any idea what might be causing the routing tables to change?

Offline

#2 2015-11-09 19:39:11

BGK
Member
From: France
Registered: 2013-07-06
Posts: 30

Re: OpenVPN connection tunnels internet for a few minutes and then fails

Why do you have a second tun interface in your third output?
Have you tried to start the VPN manually with

openvpn --config [your_conf_file] 

To see what kind of output you get, and whether or not the routing table get screwed after a few minutes?

Looks like a second instance is started after a while, without cleaning the first connection / routes first, and you end up with duplicate routing entries, on different interfaces.
When the connection stop working. have you tried to remove all routes using the first tun interface (tun0).

I've never used NetworkManager to manage my openvpn connection, but I guess you should have a mean to provide the configuration you set in network manager for this vpn connection?

Offline

Board footer

Powered by FluxBB