(Solved) Regaining WiFi results in no OpenVPN

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Pippin
Level 4
Level 4
Posts: 441
Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire

(Solved) Regaining WiFi results in no OpenVPN

Post by Pippin »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
User avatar
Pippin
Level 4
Level 4
Posts: 441
Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire

Re: Regaining WiFi results in no OpenVPN

Post by Pippin »

The problem turned out to be --persist-tun in the client config.
After removing that it works fine.
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
Locked

Return to “Networking”