[SOLVED] Make this CLI dnsleaktest.sh execute on DD-WRT?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2
Author Message
oh-wtf
DD-WRT Novice


Joined: 22 Jan 2025
Posts: 11

PostPosted: Tue Feb 04, 2025 3:59    Post subject: Reply with quote
egc wrote:
You probably do not need bash

Replace the first line with:
Code:
#!/bin/sh


Actually there is no need for bash whatsoever


I did just that. Please read my initial post:
Quote:
1. Download Script:
curl https://raw.githubusercontent.com/macvk/dnsleaktest/master/dnsleaktest.sh -o dnsleaktest.sh
2. Make executable:
chmod +x dnsleaktest.sh
3. Edit file #bash File descriptor:
#!/usr/bin/env bash > #!/bin/sh
4. run script:
./dnsleaktest.sh -i eth1


I believe you are mistaken in this case.

Running this particular script with ASH vs BASH results in totally different outcomes on my Router+Firmware (with shebang '#!/bin/sh'):
    ASH -> 'No internet connection.' and in some cases 'line 105: syntax error: unexpected redirection'
    BASH -> No Errors - the script execute as expected.


Kind regards.


Last edited by oh-wtf on Tue Feb 04, 2025 4:27; edited 1 time in total
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 15522
Location: Texas, USA

PostPosted: Tue Feb 04, 2025 4:17    Post subject: Reply with quote
And as I already stated, eth* interfaces on Broadcom are for wifi, not WAN or LAN.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
oh-wtf
DD-WRT Novice


Joined: 22 Jan 2025
Posts: 11

PostPosted: Tue Feb 04, 2025 4:20    Post subject: Reply with quote
kernel-panic69 wrote:
And as I already stated, eth* interfaces on Broadcom are for wifi, not WAN or LAN.


Ok, yes. I get that. I read 'oet' first.

But how is your statement related to the output/execute difference between running a script with ASH vs BASH?
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1830
Location: WV, USA

PostPosted: Tue Feb 04, 2025 5:53    Post subject: Reply with quote
I can verify this script does not work under ash. It's probably a very small change to make it compatible (besides the first line, it's most likely an expression within) but I don't really care to look for it.

While it's a handy script for many people, it's not one I'd use personally. There are better methods available that are web based. When the results report "You might have a dns leak", well that's just not enough to satisfy my requirements.

_________________
- Linksys EA8500: I-Gateway, WAP/VAP 5ghz only. Features: WDS-AP, VLANs, Samba, WG, Entware - r59429
- Linksys EA8500: 802.11s Secondary w/VLAN Trunk over 5ghz - r59171
- Linksys MX4300: 802.11s Primary w/VLAN Trunk over 5ghz. 2.4ghz WAP/VAP only - r59171
- Linksys MX4300 (WAP/VAP (7)) Multiple VLANs over single trunk port. Entware/Samba r59451
- Linksys MR7350: WDS Station for extended Ethernet r59451
- Linksys Velop WHW03v1 x2: OpenWRT w/GRETAP tunnel for VLANs on VAPs
- OSes: Fedora 40, 10 RPis (2,3,4,5), 23 ESP8266s: Straight from Amiga to Linux in '95, never having owned a Windows PC.

- Forum member #248
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13532
Location: Netherlands

PostPosted: Tue Feb 04, 2025 6:37    Post subject: Reply with quote
lexridge wrote:
I can verify this script does not work under ash. It's probably a very small change to make it compatible (besides the first line, it's most likely an expression within) but I don't really care to look for it.

While it's a handy script for many people, it's not one I'd use personally. There are better methods available that are web based. When the results report "You might have a dns leak", well that's just not enough to satisfy my requirements.


I did make those small changes but it is not worth to bother with.
The script concludes that I have a DNS leak and I do not have one.

_________________
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
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1830
Location: WV, USA

PostPosted: Tue Feb 04, 2025 6:42    Post subject: Reply with quote
egc wrote:
The script concludes that I have a DNS leak and I do not have one.

Exactly! Smile

_________________
- Linksys EA8500: I-Gateway, WAP/VAP 5ghz only. Features: WDS-AP, VLANs, Samba, WG, Entware - r59429
- Linksys EA8500: 802.11s Secondary w/VLAN Trunk over 5ghz - r59171
- Linksys MX4300: 802.11s Primary w/VLAN Trunk over 5ghz. 2.4ghz WAP/VAP only - r59171
- Linksys MX4300 (WAP/VAP (7)) Multiple VLANs over single trunk port. Entware/Samba r59451
- Linksys MR7350: WDS Station for extended Ethernet r59451
- Linksys Velop WHW03v1 x2: OpenWRT w/GRETAP tunnel for VLANs on VAPs
- OSes: Fedora 40, 10 RPis (2,3,4,5), 23 ESP8266s: Straight from Amiga to Linux in '95, never having owned a Windows PC.

- Forum member #248
oh-wtf
DD-WRT Novice


Joined: 22 Jan 2025
Posts: 11

PostPosted: Tue Feb 04, 2025 6:51    Post subject: Reply with quote
egc wrote:
lexridge wrote:
I can verify this script does not work under ash. It's probably a very small change to make it compatible (besides the first line, it's most likely an expression within) but I don't really care to look for it.

While it's a handy script for many people, it's not one I'd use personally. There are better methods available that are web based. When the results report "You might have a dns leak", well that's just not enough to satisfy my requirements.


I did make those small changes but it is not worth to bother with.
The script concludes that I have a DNS leak and I do not have one.



I found this to be the case for me as well...

Do you have a definitive and reliable method for evaluating DNS leaks from DD-WRT SSH CLI (eliminating false positives caused by browser DNS leaks) that you can share?

Cheers!
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13532
Location: Netherlands

PostPosted: Tue Feb 04, 2025 6:57    Post subject: Reply with quote
I do not know a definitive and reliable method but have a look at the VPN and DNS guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397
_________________
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
oh-wtf
DD-WRT Novice


Joined: 22 Jan 2025
Posts: 11

PostPosted: Tue Feb 04, 2025 7:10    Post subject: Reply with quote
egc wrote:
I do not know a definitive and reliable method but have a look at the VPN and DNS guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397


Yes, I followed your guide to the best of my knowledge. But for my own sanity, I would like to confirm that I've got it all correctly and therefore would like to do so from DD-WRT SSH for a browser-independent result/diagnostics.

I was planning on installing Open-WRT on another router and follow your latest writeup to learn more:
https://github.com/egc112/OpenWRT-egc-add-on/tree/main/stop-dns-leak

Also, './dnsmonitor.sh' gives some useful insight into my DNS traffic.


Last edited by oh-wtf on Tue Feb 04, 2025 7:21; edited 2 times in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13532
Location: Netherlands

PostPosted: Tue Feb 04, 2025 7:14    Post subject: Reply with quote
OpenWRT also has a helpful forum if you have any questions feel free to ask there.

From the router keeping an eye on port 53 in the connection table (described in the guide I think) gives a rather good impression

_________________
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
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13532
Location: Netherlands

PostPosted: Tue Feb 04, 2025 15:33    Post subject: Reply with quote
Note that OpenWRT does not handle DNS servers from WireGuard and OpenVPN interfaces as DDWRT (and most other third party firmwares) does.

OpenWRT is powerful software but not for the faint of heart

_________________
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
oh-wtf
DD-WRT Novice


Joined: 22 Jan 2025
Posts: 11

PostPosted: Wed Feb 05, 2025 13:51    Post subject: Reply with quote
I appreciate your insights. Thanks for the heads up! Smile
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum