Answer the question
In order to leave comments, you need to log in
How to turn off the OpenVPN client correctly
Good afternoon, hackers!
Given: console OpenVPN client running pure Ubuntu 12.04 LTS
Conditions:
There are no complaints about working with the server, everything is OK. VPN connection is used for alternative Internet access.
After stopping the OpenVPN client, default routes are not returned and, accordingly, Internet access via the main channel is lost.
The reason is presumably the work of the client without root rights.
With reduced rights, it starts correctly - it will raise the tun0 interface + new routes.
OpenVPN client config
Log of starting and stopping the OpenVPN client
Question:
How to properly shut down the OpenVPN client, returning the old routes.
Answer the question
In order to leave comments, you need to log in
sudo /etc/init.d/openvpn stop
writes in the log that there are no rights to delete routes
Either write with sudo scripts - he can execute a script to break the connection, or - do not reset the rights. You can leave him not root, but give him only the root feature CAP_NET_ADMIN (man 7 capabilities) - he will be able to change the routing table after resetting the rights, but, for example, the FS will not be unmounted or the rights system will be rebooted.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question