[SOLVED]Wireguard with Windscribe VPN: route problem?

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Sat Aug 06, 2022 14:21    Post subject: Reply with quote
So after NTP is done wireguard doesn't restart again making the previous attempt m00t up to the 5 seconds? Cause after NTP is done everything restarts again (firewall, cron and anything that is dnsmasq etc etc will all restart... which is stupid generally speaking. Nothing should start at all until NTP is done and a valid time is set.
_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
Sponsor
howard@sci1.com
DD-WRT Novice


Joined: 11 Jul 2022
Posts: 44

PostPosted: Sun Aug 07, 2022 0:07    Post subject: Reply with quote
@egc

I definitely think you are onto something.

I deleted the "DNS servers from tunnel" entry and rebooted the router and the correct routes still came back without having to manually enter them.

Re-enabling "DNS servers from tunnel" generally hosed things up and required a router reboot with it again disabled to recover.

------------------

Here is the relevant part of the log when it works:

Aug 6 16:33:48 Netgear R9000 user.info root: WireGuard number of non failed tunnels in fail set: 0
Aug 6 16:33:48 Netgear R9000 user.info root: WireGuard: Deleted endpoint route to 104.129.56.68 from 104.129.56.68
Aug 6 16:33:48 Netgear R9000 user.info root: Flush delete PBR interface oet1, table : 21
Aug 6 16:33:48 Netgear R9000 user.info root: Enable WireGuard interface oet1 on port 51820
Aug 6 16:33:48 Netgear R9000 user.info root: Establishing WireGuard tunnel with peer endpoint 104.129.56.68:1194
Aug 6 16:33:48 Netgear R9000 user.info root: WireGuard setting route for oet1 to endpoint 104.129.56.68:1194 via 71.236.228.1 dev vlan2
Aug 6 16:33:48 Netgear R9000 user.info root: WireGuard 100.104.252.39/24 added to oet1
Aug 6 16:33:49 Netgear R9000 user.info root: WireGuard set /tmp/oet.lock
Aug 6 16:33:49 Netgear R9000 user.info root: WireGuard waited 11 seconds to set routes for oet
Aug 6 16:33:49 Netgear R9000 user.info root: WireGuard route 0.0.0.0/1 added via oet1
Aug 6 16:33:49 Netgear R9000 user.info root: WireGuard route 128.0.0.0/1 added via oet1

----------------------

Subsequently disabling and re-enabling the tunnel (without rebooting the router) removes and re-enters routing table entries as desired.

My DNS (which runs on a separate local Linux server and forwards to OpenDNS) still seems to work fine when the tunnel is up even with "DNS servers from tunnel" empty. Is there a downside to just leaving the DNS servers through the tunnel field blank? dnsleaktest.com doesn't show any leaks.

Thanks again for all of your help! I couldn't have figured this out on my own.
howard@sci1.com
DD-WRT Novice


Joined: 11 Jul 2022
Posts: 44

PostPosted: Sun Aug 07, 2022 0:26    Post subject: Reply with quote
nvram still shows the questionable entries, but they don't seem to be hurting anything:

Code:
root@Netgear R9000:~# nvram show | grep oet
oet1_isolation=0
oet1_rtdownscript=
oet1_mit=1
oet1_endpoint0=1
oet1_multicast=0
size: 36612 bytes (94460 left)
oet1_dpbr_ip=104.129.56.4/32
oet1_peerkey0=89DUtbYYyXcAktaB2cnCVA/YiZQEddYHuOz2K0vBAn4=
oet1_aip_rten0=1
oet1_usepsk0=1
oet1_namep0=
oet1_spbr=0
oet1_dns=
oet_tunnels=1
oet1_port=51820
oet1_dpbr=0
oet1_failgrp=0
oet1_hwaddr=00:00:00:00:00:00
oet1_peerport0=1194
oet1_failstate=0
oet1_mtu=1420
oet1_clend0=
oet1_wdog=0
oet1_clka0=
oet1_dns_redirect=0
oet1_ka0=25
oet1_fwmark=
oet1_cldns0=0.0.0.0
oet1_en=1
oet1_ip0=0.0.0.0
oet1_bloop=0
oet1_rtupscript=
oet1_rem0=104.129.56.68
oet1_txq=1
oet1_peers=1
oet1_psk0=C22yPk44TEwNxVSw1Wu2YnUXy/BJYehKNxzOFL//vog=
oet1_ipaddrmask=100.104.252.39/24
oet1_spbr_ip=100.104.252.39/32
oet1_clconfig0=0
oet1_showadvanced=1
oet1_killswitch=0
oet1_dns_ipaddr=0.0.0.0
oet2_bloop=0
oet1_rem=192.168.90.1
oet1_natout=1
oet1_netmask=255.255.255.0
oet1_proto=2
oet3_nat=1
oet1_bridged=0
oet1_private=QMMHKQnoG333kv2mkGY0kykuwxD4KvteB91c+UzcMmc=
oet1_lanac=0
oet1_ipaddr=100.104.252.39
oet2_nat=1
bat_oet1_bridge=br0
oet1_failip=8.8.8.8
oet1_dnspbr=0
oet1_id=1
oet1_nat=1
oet3_bloop=0
oet1_public=KF6+rIhIzscOC9fozD7f8Zk6nPwebNCML0hzECcUiFc=
oet1_local=0.0.0.0
oet1_aip0=0.0.0.0/1,128.0.0.0/1
oet1_firewallin=1
root@Netgear R9000:~#
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Sun Aug 07, 2022 6:25    Post subject: Reply with quote
You already answered my next questions:

Quote:
My DNS (which runs on a separate local Linux server and forwards to OpenDNS) still seems to work fine when the tunnel is up even with "DNS servers from tunnel" empty. Is there a downside to just leaving the DNS servers through the tunnel field blank? dnsleaktest.com doesn't show any leaks.


So you likely have DNSMasq disabled on the router.

Setting a DNS server when DNSMasq is not used is not very useful (as some would call it a "user error")

From the updated Wireguard Client setup guide:
Quote:
1. Do not set a DNS Server if you do not use DNSMasq e.g. if on Basic Setup page "Use dnsmasq for DNS" or on Services Page " Enable dnsmasq" is disabled.
2. Wireguard uses the built-in DNSMasq, so this is not compatible with other DNS systems like Unbound, Smart DNS, DNScrypt etc.
3. Wireguard relies on the use of resolv.dnsmaq, so do not use the no-resolv directive in DNSMasq.
4. To avoid DNS leaks make sure Ignore WAN DNS on Setup page is enabled/checked.
5. It is good practice to set at least two DNS servers in Static DNS 1 and 2 on Setup page.


Of course a good program/GUI should shield users from errors.

This program also checks for this and if DNSMasq is not working/is disabled it will time out and log an error.
Only it does not work as there is a typo in the code Sad
I will patch it of course in the coming builds

This typo is already present in builds as early as 44980.
I actually had trouble reproducing this problem on my R7800 (I could but had to do some tricks), after a reboot it was working on my router, so probably the fact that that error surfaced on a very fast router has something to do with it (and of course most people will use DNSMasq in combination with VPN otherwise you can have a DNS leak).

About the DNS leak, yes you can have one depending on if your own Linux DNS server is routed via the tunnel, so it might be better to use DNSMasq on the router in combination with your own DNS server.
We have an excellent tutorial about using a Pihole as DNS server but the same applies to your situation:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=331414

Thanks for staying with me so we could solve this problem, the management apologizes for the inconvenience Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
howard@sci1.com
DD-WRT Novice


Joined: 11 Jul 2022
Posts: 44

PostPosted: Sun Aug 07, 2022 9:18    Post subject: Reply with quote
dnsmasq *was* disabled on my Basic Setup page. Can't remember why I did that. dnsmasq was still enabled on the Services page.

So I tried enabling dnsmasq on the Basic Setup page and then re-enabled the "DNS Servers via Tunnel" configuration on the Wireguard tunnel, and *voila* all the routes are still correct and the VPN works fine. Also, the WAN status page now shows IPv4 DNS 0 is my VPN's DNS server.

So thanks to your help, everything seems to be working perfectly now.

DHCP seems to be interrelated to this discussion according to some of the reading I did. I do not use the DD-WRT Netgear R9000 router as a DHCP server. Looks like if I had then dnsmasq would have been automatically enabled. Perhaps that's why I didn't see this issue on my older DD-WRT router because I was using that as a DHCP server.

In case it's useful, my dnsmasq infrastructure settings are shown in the attached image.

Sorry for the user error. I am a former programmer, but not a networking expert and am not up on the interaction between DNS and dnsmasq. I will try to find some reading about this as I should be informed.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Sun Aug 07, 2022 9:24    Post subject: Reply with quote
Like I said we should shield users from "errors".

Only the code which should do that had a typo (my mistake and mine alone Sad )

Glad this is solved Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum