I use a openvpn config file connect to a vpnserver successfully.
But after I ctrl + C quit openvpn, ubuntu counld not access network.
I think the route table is wrong or openvpn is not shutdown correctly, but I don't know how to deal with it. Detail is as below:

kasim@ubuntu:~$ ip route show via dev tun0
default via dev eth0  metric 100 dev tun0  proto kernel  scope link  src via dev eth0 via dev tun0 dev eth0  proto kernel  scope link  src
kasim@ubuntu:~$ ping
PING ( 56(84) bytes of data.
--- ping statistics ---
16 packets transmitted, 0 received, 100% packet loss, time 15121ms

kasim@ubuntu:~$ ping www.yahoo.com
PING ds-any-fp3-real.wa1.b.yahoo.com ( 56(84) bytes of data.
--- ds-any-fp3-real.wa1.b.yahoo.com ping statistics ---
15 packets transmitted, 0 received, 100% packet loss, time 14085ms

When shutting down your OpenVpn client this shoud unmount the tun0 interface and delete the routes going through it. Maybe there is an option on your client or server conf that is putting those route permanently.

In the meantime, you could try flushing your route table : ip route flush

or deleting the routes manually :

route del -net gw
route del -net gw

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.