Hi, I am having a problem where OpenVPN is clearing static routes from the routing table when OpenVPN closes the VPN connection.
I have a simple network setup. No default gateway is setup and only a single route exists towards the address of the VPN server. This is so that no network traffic can flow outside the local lan until the VPN has been established.
Once OpenVPN starts, it adds the appropriate routes to the routing table and everything operates as expected.
When I stop OpenVPN, instead of just removing the routes it has created, it also removes the static route towards the OpenVPN server, thus if OpenVPN is started again, it cannot access the VPN server. A problematic situation.
I am creating the static route in /etc/network/interfaces with a "post-up route add" statement.
client
dev tun
proto udp
remote {remote address} {port}
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass {password file}
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.pem