Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 431024 - net-misc/openvpn-2.2.2 does not change /etc/resolv.conf back
Summary: net-misc/openvpn-2.2.2 does not change /etc/resolv.conf back
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Dirkjan Ochtman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-11 23:25 UTC by Stefan Behte (RETIRED)
Modified: 2013-01-15 08:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Behte (RETIRED) gentoo-dev Security 2012-08-11 23:25:48 UTC
OpenVPN itself works. After connecting a new nameserver is written to /etc/resolv.conf:

# Generated by openvpn for interface tun0
nameserver XXX.XXX.XXX.XXX

The original file is moved to /etc/resolv.conf-tun0.sv
After stopping openvpn, it's not moved back, though. It seems that /etc/openvpn/down.sh is never called.

Here is my config:

## openvpn.conf
script-security 2
client
dev tun
proto udp
remote XXX.XXX.XXX 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/XXXXX.crt
key /etc/openvpn/keys/XXXXX.key
ns-cert-type server
tls-auth /etc/openvpn/keys/ta.key 1
comp-lzo
verb 3
cipher DES-EDE3-CBC
Comment 1 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-01-12 14:04:29 UTC
Do you have an idea of how to fix this? It seems to me that, in the init script, we pass --down-pre --down /etc/openvpn/down.sh to openvpn when starting. Isn't that enough?
Comment 2 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-01-12 14:36:37 UTC
I just committed openvpn-2.3.0 which comes with a down-root plugin that probably solves your problem; I'm closing this bug for now, feel free to reopen if it still fails.
Comment 3 Stefan Behte (RETIRED) gentoo-dev Security 2013-01-15 01:42:17 UTC
You have to add this line:

plugin /usr/lib64/openvpn/openvpn-plugin-down-root.so "/etc/openvpn/down.sh"

/etc/openvpn/down.sh is already provided by gentoo. :)

Thank you! :)
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-01-15 08:03:55 UTC
In the ebuild, or in the config file?