# DietPi-VPN cannot access local web UI

**URL:** <https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185>\
**Category:** Troubleshooting\
**Created:** [14 January 2022 20:37 UTC](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185 "2022-01-14T20:37:38Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [31 January 2022 14:40 UTC](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185/21 "2022-01-31T14:40:45Z")

</div>

> [@](#):
>
> > [@](#):
> >
> > When the VPN server pushes a DNS server, I would expect that OpenVPN applies this to /etc/resolv.conf automatically, without any additional scripts, but not 100% sure to be true.
> 
> Apparently not, because it is not able to revert the resolv.conf to the original state after disconnection without the help from resolvconf package.

Ah that actually makes sense. To not bypass the defined DNS, the original entry must be removed, and as long as it does not store the original file/entries internally, it has no chance to revert. However, then probably it works automatically after:

```plaintext
apt install resolvconf

```

---

<div class="post-metadata">

**Author:** ![RaspyPi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@RaspyPi](https://dietpi.com/forum/u/RaspyPi)\
**Post date:** [10 February 2022 05:47 UTC](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185/22 "2022-02-10T05:47:35Z")

</div>

Hi everyone, thank you for the help and guidance 🙂 I am still trying to figure out where nameserver:192.168.1.1 is being inject in /etc/resolv.conf

I installed the package resolvconf and also dbus ( dbus was needed to run the command resolvectl status)

If I run command

```nohighlight
 head /etc/resolv.conf

```

It’s contents are:

```nohighlight
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "resolvectl status" to see details about the actual nameservers.

nameserver 192.168.1.1
nameserver 127.0.0.53

```

If I run the command

```nohighlight
ls -l /etc/resolv.conf

```

I get back

```nohighlight
 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

```

the symlink conf file contains nameserver 192.168.1.1 …

What seems to be working is :

```nohighlight
ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

```

And then modify /etc/systemd/resolved.conf entries to

```nohighlight
DNS=9.9.9.9
FallbackDNS=8.8.8.8
Domains=~.

```

dig does now return:

```nohighlight
;; Query time: 12 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)

```

MichaIng Do I add

```nohighlight
post-up /etc/openvpn/update-resolv-conf
post-down /etc/openvpn/update-resolv-conf

```

to dietpi-vpn edit up script as is?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [10 February 2022 10:34 UTC](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185/23 "2022-02-10T10:34:55Z")

</div>

I guess 192.168.1.1 is assigned via DHCP, isn’t it?

---

<div class="post-metadata">

**Author:** ![RaspyPi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@RaspyPi](https://dietpi.com/forum/u/RaspyPi)\
**Post date:** [15 February 2022 06:04 UTC](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185/24 "2022-02-15T06:04:17Z")

</div>

> [@](#):
>
> I guess 192.168.1.1 is assigned via DHCP, isn’t it?

Hi Joulinar! I think it came from /etc/network/interfaces.d/ now the DNS is commented out #dns-nameservers 192.168.1.1

I noticed the VPN didn’t connect on reboot it timedout. If the vpn is disconnected and the killswitch is on, shouldn’t there not be any connections from the PI to the Internet? But in my case my PI can communicate with the outside world when the VPN is disconnected which is not what I want 😢

```plaintext
 systemctl status dietpi-vpn.service

● dietpi-vpn.service - VPN Client (DietPi)
     Loaded: loaded (/etc/systemd/system/dietpi-vpn.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Mon 2022-02-14 23:58:46 EST; 34min ago
    Process: 456 ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client.ovpn (code=exited, status=0/SUCCESS)
   Main PID: 456 (code=exited, status=0/SUCCESS)
     Status: "Initialization Sequence Completed"
        CPU: 272ms

Feb 10 01:09:57 Pi openvpn[618]: net.ipv6.conf.all.disable_ipv6 = 1
Feb 10 01:09:57 Pi openvpn[621]: net.ipv6.conf.default.disable_ipv6 = 1
Feb 10 01:09:58 Pi openvpn[456]: Initialization Sequence Completed
Feb 14 23:58:46 Pi openvpn[456]: [openvpn2.vpnunlimitedapp.com] Inactivity timeout (--ping-exit), exiting
Feb 14 23:58:46 Pi openvpn[456]: sitnl_send: rtnl: generic error (-3): No such process
Feb 14 23:58:46 Pi openvpn[456]: ERROR: Linux route delete command failed
Feb 14 23:58:46 Pi openvpn[456]: net_addr_ptp_v4_del: 10.200.0.55 dev tun0
Feb 14 23:58:46 Pi openvpn[456]: /var/lib/dietpi/dietpi-vpn/static_down.sh tun0 1500 1553 10.200.0.55 10.200.0.54 init
Feb 14 23:58:46 Pi openvpn[456]: SIGTERM[soft,ping-exit] received, process exiting
Feb 14 23:58:46 Pi systemd[1]: dietpi-vpn.service: Succeeded.

```

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [15 February 2022 18:58 UTC](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185/25 "2022-02-15T18:58:31Z")

</div>

First of all, the /etc/resolv.conf symlink to …/run/resolvconf/resolv.conf was correct, as this is how resolvconf sets it up to function. If you manually change it to the systemd-resolved template (which is not used, no systemd-resolved running, which would conflict with resolvconf, and 127.0.0.53 being invalid), it basically becomes a static file and all attempts to use resolvconf will fail to achieve anything.

/etc/systemd/resolved.conf similarly is the wrong place to configure DNS.

The dns-nameservers entry in /etc/network/interfaces is what controls the /etc/resolv.conf entry when a static IP is configured. If DHCP is used, it shouldn’t have any effect. I suggest, if you use a static IP, to set dns-nameserver 9.9.9.9 in /etc/network/interfaces.

OpenVPN in the logs shows an inactivity timeout after being up since some days. Not sure whether this is something it does by default, or defined in your ovpn client config? Does it work again when running systemctl restart dietpi-vpn?

[Previous page](https://dietpi.com/forum/t/dietpi-vpn-cannot-access-local-web-ui/6185.md?page=1)
