I am running openvpn client in my system which connects to remote openvpn server via Internet. My system is connected to two networks (multi homed) wlan0 and ppp0. Both provides internet connectivity to my system but not simultaneously. At any point of time, either wlan0 or ppp0 will be used as default gateway.
The issue is after openvpn client connected with server when i change the default gateway manually from wlan0 to ppp0 or vice versa, the openvpn client disconnect with server and restarts the connection. The following is the log when the disconnection happens.
Fri Nov 13 15:26:37 2015 write UDPv4 []: Network is unreachable (code=101)
Fri Nov 13 15:26:43 2015 [UNDEF] Inactivity timeout (--ping-restart), restarting
Fri Nov 13 15:26:43 2015 TCP/UDP: Closing socket
Fri Nov 13 15:26:43 2015 SIGUSR1[soft,ping-restart] received, process restarting
Fri Nov 13 15:26:43 2015 Restart pause, 2 second(s)
My question is what is the reason behind disconnection and reconnection? and is there any way i could change default gateway without making openvpn client to restart?