WireGuard DNS after latest upgrade Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Niwre
Posts: 36
Joined: Tue Apr 09, 2019 1:26 pm

Re: WireGuard DNS after latest upgrade

Post by Niwre »

@MichaIng
I have executed the commands as described, unfortunately always "NONE" is returned. I have set in Dietpi-config, the setting when booting to wait for network, synonymous unfortunately brings the same feedback. :?
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: WireGuard DNS after latest upgrade

Post by MichaIng »

@Niwre
That is strange, can you paste: ls -Al /sys/class/net/
Niwre
Posts: 36
Joined: Tue Apr 09, 2019 1:26 pm

Re: WireGuard DNS after latest upgrade

Post by Niwre »

@MichaIng
It looks like this under 6.24.1
ls -Al /sys/class/net/
insgesamt 0
lrwxrwxrwx 1 root root 0 Jun 24 07:04 eth0 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:02.0/net/eth0
lrwxrwxrwx 1 root root 0 Jun 24 07:04 lo -> ../../devices/virtual/net/lo

It looks like this under 6.21.1
ls -Al /sys/class/net/
insgesamt 0
lrwxrwxrwx 1 root root 0 Jun 24 07:08 eth0 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:02.0/net/eth0
lrwxrwxrwx 1 root root 0 Jun 24 07:08 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 Jun 24 07:08 wg0 -> ../../devices/virtual/net/wg0
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: WireGuard DNS after latest upgrade

Post by MichaIng »

@Niwre
Sorry for late reply.

Okay the network device is there. It is expected that wg0 is not there as the WireGuard service failed.

Lets go through it what /DietPi/dietpi/func/obtain_network_details does to debug why it does not print the existint eth0 interface to /DietPi/dietpi/.network.

1. It exits when it finds itself running and in case exits. So if one instance is hanging (e.g. from boot), that would explain it:
pgrep 'obtain_network_details'
2. It scrapes the IP address and checks is the connection is "UP" from: ip a s eth0
Niwre
Posts: 36
Joined: Tue Apr 09, 2019 1:26 pm

Re: WireGuard DNS after latest upgrade

Post by Niwre »

@MichaIng
attached the result.
PNG-Bild 2.png
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: WireGuard DNS after latest upgrade

Post by MichaIng »

@Niwre
state UNKNOWN is the issue. Hmm network/internet works well with this? What does ethtool eth0 say about link connection?

And could you print ip r to check if default route is set, which might be then the safer check for active adapter.

As a quick workaround you can do:

Code: Select all

sed -i 's/UP/\(UP\|UNKNOWN\)/g' /DietPi/dietpi/func/obtain_network_details
/DietPi/dietpi/func/obtain_network_details
systemctl restart wg-quick@wg0
Niwre
Posts: 36
Joined: Tue Apr 09, 2019 1:26 pm

Re: WireGuard DNS after latest upgrade

Post by Niwre »

@MichaIng

attached the result.
14C52449-4DFF-4C91-92A5-8C6AFC5BE52B.jpeg
Quick workaround solved the problem, no it works.

Thank you for your help.
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: WireGuard DNS after latest upgrade

Post by MichaIng »

@Niwre
Okay thanks for testing, great it works.

Hmm now I am thinking how to find a solution code wise. Actually we implemented the "UP" check just a short time ago due to issues/wrong entries if this was skipped. And now we have a case where it is exactly the other way round.

Strange that ip does not recognise it as "UP" as the default route is there and ethtool also shows it as connected :?.

ethtool cannot be used regularly since it yeah only works for Ethernet of course and also the connection state does not imply that it is connected to the gateway or even has in IP assigned.
Default route is already safer, but this changes (reasonably) when you're installing a VPN client, so is not 100% failsafe as well.
But ip r should always list the gateway link, so if we check for the word " via ", it should be safe.

Ah no, default route stays:

Code: Select all

root@VM-Stretch:~# ip r
0.0.0.0/1 via 10.8.0.1 dev tun0
default via 192.168.178.1 dev eth0 onlink
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.9
128.0.0.0/1 via 10.8.0.1 dev tun0
185.220.70.210 via 192.168.178.1 dev eth0
192.168.178.0/24 dev eth0 proto kernel scope link src 192.168.178.29
root@VM-Stretch:~# ip r s 0.0.0.0/0
default via 192.168.178.1 dev eth0 onlink
Niwre
Posts: 36
Joined: Tue Apr 09, 2019 1:26 pm

Re: WireGuard DNS after latest upgrade

Post by Niwre »

@MichaIng
Many thanks for your answer. I do not know if this information is still important, but the line with "via" shows the default route.
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: WireGuard DNS after latest upgrade

Post by MichaIng »

@Niwre
Yeah perhaps we should use this is more reliable method to determine the main active network device. But I want to assure that the default route also stays the same when using WireGuard as VPN client (you use it as server).

But that is something I will not touch for v6.25 any more. So when you run dietpi-update, remember to reapply the workaround. I will then have a closer look for v6.26 where I anyway plan some deeper rework of our network setup.
Post Reply