Hi everyone!
In a routed vpn when the server is restarted the client can't re-establish the vpn and the client's openvpn exits. If I manually restart the openvpn process in the client, it works again. Both systems run openvpn as a non-priviledged user. There is already a similar
bug report about this issue.
But in my case there are no ip address changes at all:
Nov 5 16:51:10 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: [OpenVPN_PAW_Server] Peer Connection Initiated with [AF_INET]79.223.29.138:1194
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: SENT CONTROL [OpenVPN_PAW_Server]: 'PUSH_REQUEST' (status=1)
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: PUSH: Received control message: 'PUSH_REPLY,route 192.168.193.0 255.255.255.0,route-gateway 10.205.76.1,topology subnet,pi
ng 10,ping-restart 60,ifconfig 10.205.76.2 255.255.255.0,peer-id 0'
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: OPTIONS IMPORT: timers and/or timeouts modified
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: OPTIONS IMPORT: --ifconfig/up options modified
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: OPTIONS IMPORT: route options modified
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: OPTIONS IMPORT: route-related options modified
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: OPTIONS IMPORT: peer-id set
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: OPTIONS IMPORT: adjusting link_mtu to 1572
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: Preserving previous TUN/TAP instance: tun0
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: NOTE: Pulled options changed on restart, will need to close and reopen TUN/TAP device.
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: /sbin/ip route del 192.168.193.0/24
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: ERROR: Linux route delete command failed: external program exited with error status: 2
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: Closing TUN/TAP interface
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: /sbin/ip addr del dev tun0 10.205.76.2/24
Nov 5 16:51:13 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: Linux ip addr del failed: external program exited with error status: 2
Nov 5 16:51:14 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: ROUTE_GATEWAY 192.168.0.1/255.255.255.0 IFACE=eth0 HWADDR=00:15:5d:00:0a:0f
Nov 5 16:51:14 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: ERROR: Cannot ioctl TUNSETIFF tun0: Operation not permitted (errno=1)
Nov 5 16:51:14 vm-openvpn ovpn-OpenVPN_PAW_Client1[6750]: Exiting due to fatal error
Nov 5 16:51:14 vm-openvpn systemd[1]: openvpn@OpenVPN_PAW_Client1.service: Main process exited, code=exited, status=1/FAILURE
Nov 5 16:51:14 vm-openvpn systemd[1]: openvpn@OpenVPN_PAW_Client1.service: Unit entered failed state.
Nov 5 16:51:14 vm-openvpn systemd[1]: openvpn@OpenVPN_PAW_Client1.service: Failed with result 'exit-code'.
How can I prevent the client from deleting routes an re-creating tun interface since it is not really necessary in my opinion?
Thanks!