J
J
juffinhalli2013-11-05 14:36:35
linux
juffinhalli, 2013-11-05 14:36:35

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

2 answer(s)
V
Vovanys, 2013-11-05
@Vovanys

sudo /etc/init.d/openvpn stop
writes in the log that there are no rights to delete routes

M
merlin-vrn, 2013-11-05
@merlin-vrn

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 question

Ask a Question

731 491 924 answers to any question