(Solved) Regaining WiFi results in no OpenVPN

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
Pippin
Level 4
Level 4
Posts: 272
Joined: Wed Dec 13, 2017 11:14 am
Location: NL/DE/TH

(Solved) Regaining WiFi results in no OpenVPN

Post by Pippin » Tue Dec 19, 2017 5:04 pm

If someone has a better title please write so.

Problem:
Connected to WiFi
OpenVPN as a client works
Routes:

Code: Select all

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0             192.168.168.1   128.0.0.0           UG     0      0        0 tun0
0.0.0.0             192.168.168.1   0.0.0.0               UG     0      0        0 tun0
0.0.0.0             192.168.43.1     0.0.0.0               UG     600    0        0 wlp2s0
SE.RV.ER.IP   192.168.43.1     255.255.255.255 UGH   0      0        0 wlp2s0
128.0.0.0          192.168.168.1   128.0.0.0            UG     0      0        0 tun0
169.254.0.0       0.0.0.0              255.255.0.0        U      1000   0        0 wlp2s0
192.168.2.0       192.168.168.1   255.255.255.0     UG    0      0        0 tun0
192.168.25.0     192.168.168.1   255.255.255.0     UG    0      0        0 tun0
192.168.43.0     0.0.0.0              255.255.255.0     U      600    0        0 wlp2s0
192.168.51.0     192.168.168.1   255.255.255.0     UG    0      0        0 tun0
WiFi goes down
Routes on wlp2s0 get deleted:

Code: Select all

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0            192.168.168.1    128.0.0.0         UG    0      0        0 tun0
0.0.0.0            192.168.168.1    0.0.0.0             UG    0      0        0 tun0
128.0.0.0         192.168.168.1   128.0.0.0          UG    0      0        0 tun0
192.168.2.0      192.168.168.1   255.255.255.0   UG    0      0        0 tun0
192.168.25.0    192.168.168.1   255.255.255.0   UG    0      0        0 tun0
192.168.51.0    192.168.168.1   255.255.255.0   UG    0      0        0 tun0
192.168.168.0   0.0.0.0             255.255.255.0   U       0      0        0 tun0
192.168.178.0   192.168.168.1   255.255.255.0   UG    0      0        0 tun0
WiFi comes back
Routes being added again except the one to the OpenVPN server:

Code: Select all

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0           192.168.168.1   128.0.0.0          UG    0      0        0 tun0
0.0.0.0           192.168.168.1    0.0.0.0            UG     0      0        0 tun0
0.0.0.0           192.168.43.1     0.0.0.0              UG    600    0        0 wlp2s0
128.0.0.0        192.168.168.1   128.0.0.0          UG    0      0        0 tun0
169.254.0.0     0.0.0.0             255.255.0.0       U      1000   0        0 wlp2s0
192.168.2.0     192.168.168.1   255.255.255.0   UG     0      0        0 tun0
192.168.25.0    192.168.168.1   255.255.255.0   UG    0      0        0 tun0
192.168.43.0    0.0.0.0             255.255.255.0   U      600    0        0 wlp2s0
192.168.51.0    192.168.168.1   255.255.255.0   UG    0      0        0 tun0
192.168.168.0   0.0.0.0             255.255.255.0   U       0      0        0 tun0
192.168.178.0   192.168.168.1   255.255.255.0   UG    0      0        0 tun0
This route is set by the still running OpenVPN client which is unaware of the IF going down.
A solution could be to restart OpenVPN as soon IF comes back?

Someone knows how to solve this in a proper way?

Thanks.
Last edited by Pippin on Wed Dec 20, 2017 6:52 pm, edited 1 time in total.
Everything is electric.

Pippin
Level 4
Level 4
Posts: 272
Joined: Wed Dec 13, 2017 11:14 am
Location: NL/DE/TH

Re: Regaining WiFi results in no OpenVPN

Post by Pippin » Wed Dec 20, 2017 6:52 pm

The problem turned out to be --persist-tun in the client config.
After removing that it works fine.
Everything is electric.

Post Reply

Return to “Other networking topics”