Eu tive o mesmo problema, mas consegui resolvê-lo usando o seguinte hack:
Em vez de up /etc/openvpn/update-resolv-conf
, criei um arquivo chamado up.sh em / etc / openvpn.
Execute o comando sudo gedit /etc/openvpn/up.sh
e cole o seguinte:
#! /bin/bash
DEV=
if [ ! -d /tmp/openvpn ]; then
mkdir /tmp/openvpn
fi
CACHE_NAMESERVER="/tmp/openvpn/$DEV.nameserver"
echo -n "" > $CACHE_NAMESERVER
dns=dns
for opt in ${!foreign_option_*}
do
eval "dns=${$opt#dhcp-option DNS }"
if [[ $dns =~ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} ]]; then
if [ ! -f /etc/resolv.conf.default ]; then
cp /etc/resolv.conf /etc/resolv.conf.default
fi
cat /etc/resolv.conf | grep -v ^# | grep -v ^nameserver > /tmp/resolv.conf
echo "nameserver $dns" >> /tmp/resolv.conf
echo $dns >> $CACHE_NAMESERVER
cat /etc/resolv.conf | grep -v ^# | grep -v "nameserver $dns" | grep nameserver >> /tmp/resolv.conf
mv /tmp/resolv.conf /etc/resolv.conf
fi
done
Salve e execute sudo chmod +x /etc/openvpn/up.sh
Em seguida, crie outro arquivo /etc/openvpn/down.sh
e cole o seguinte nele
#! /bin/bash
echo "Restoring original nameservers"
rm -f /etc/resolv.conf
ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
echo "Done restoring nameservers cheers"
Salve e execute sudo chmod +x /etc/openvpn/down.sh
Agora remova as linhas:
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
E substitua-os por:
script-security 2
up /etc/openvpn/up.sh
down /etc/openvpn/down.sh