What's new

Use old DdWrt/OpenWrt/Tomato Router As Pihole-Like Device?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Ppl worry too much about RAM usage.
As a data point, here's my Pihole VM, which has close to a year of uptime now:

Code:
[root@pihole ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            973         165         282          50         525         600
Swap:          1023           9        1014
[root@pihole ~]# uptime
 11:50:18 up 315 days, 12:15,  1 user,  load average: 0.00, 0.01, 0.05

Pihole can be pretty light on memory usage, provided you don't go over the top with your blocklists.
 
As a data point, here's my Pihole VM, which has close to a year of uptime now:

Code:
[root@pihole ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            973         165         282          50         525         600
Swap:          1023           9        1014
[root@pihole ~]# uptime
11:50:18 up 315 days, 12:15,  1 user,  load average: 0.00, 0.01, 0.05

Pihole can be pretty light on memory usage, provided you don't go over the top with your blocklists.
As a data point, here's my Pihole VM, which has close to a year of uptime now:

Code:
[root@pihole ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            973         165         282          50         525         600
Swap:          1023           9        1014
[root@pihole ~]# uptime
11:50:18 up 315 days, 12:15,  1 user,  load average: 0.00, 0.01, 0.05

Pihole can be pretty light on memory usage, provided you don't go over the top with your blocklists.
thanks for the data point. maybe i should just run the above script on my router? wish merlin was available. but i can muddle along until it is. cheers
 
thanks for the data point. maybe i should just run the above script on my router? wish merlin was available. but i can muddle along until it is. cheers
I have no idea if that would work, or how well that would work. Keep in mind that FTL has been optimized for this specific type of use, no idea how well stock (possibly outdated depending on the router firmware) dnsmasq handles large blocklists.
 
Yep, I was afraid of that. That's the problem w/ the old stuff sometimes. Just too limited in resources.

The only other possibility would be to download it on-demand and run it from memory, or better yet, download to some local store and use SSH or CIFS to copy it from there into memory at startup. But it wouldn't be persistent across a reboot. Essentially your persistence would be external to the router itself. It might work because you have a lot more memory on that router (32MB) than flash (4MB).

I sometimes do that when I want access to Entware on a router that doesn't have JFFS or even USB. I might want to access say tcpdump for diagnostic purposes, and so I'll map the /opt directory to /tmp/opt and install Entware into memory. Again, it's NOT persistent across a reboot, but in that case, I don't really care. I'm just trying to gain access to the utility for limited purposes.
I am starting to understand enough here to be dangerous to myself. I thought of something along those lines on the re-purposed router. But it seems the command set on that thing is just not up to what the script requires (even swapping wget for curl).

However, your comment above makes me think a bit. On my new GT-AX3000, I have already used the USB drive to "semi-permanently" install Entware so I could have tcpdump at my beck and call. I did this by following this post's <https://github.com/Entware/Entware/wiki/Install-on-Asus-stock-firmware> instructions. So I have jffs enabled and am hooking the nvram script_usbmount in order to get Entware loaded and running.

I wonder if I might not be able to put the ddwrt-blacklist-domains.sh on the usb drive along with the Entware install and then have the script that mounts Entware from the USB drive also invoke the ddwrt-blacklist-domains.sh and just let this work in the way that installing Diversion on Merlin works? I am no expert and, like I said, I am getting dangerous. Any comments?
 
As a rule, I'm *very* conservative when it comes to writing scripts for third-party firmware. I'm well aware they typically lack certain utilities and features due to the limited flash. So I keep things as basic and simple as possible for maximum compatibility, be it modern ARM routers, or older MIPS routers. Of course, I can't be 100% sure every single router will work.

FWIW, I just ran it successfully (sort of) on an old ASUS WL-500gP v2 router running dd-wrt. Had to run it from /tmp since it has no JFFS either. Even so, because the firmware is running an old version of wget (no curl) that did NOT support https (only http), some of the URLs can't be downloaded because they've now been moved from http to https!

Just another example of why dealing w/ these older routers can be problematic. Even if they worked in the past, the rest of the internet has moved forward, and in this case, the blacklist providers are sometimes requiring secure connections.

Seems to me to be fully functional you'd need to install either the latest version of wget or curl from Entware.

I also tried it on the latest Merlin firmware (386.7), as-is, and it runs fine there as well (the benefit of keeping things generic I suppose). Of course, it's NOT my intention to support it on Merlin, esp. given there are alternatives like Diversion.

You can use the dd-wrt installer provided you redirect it to /tmp as I suggested either (I didn't bother compressing it).

Code:
curl -kLs bit.ly/ddwrt-installer|tr -d '\r'|sh -s -- --dir /tmp aySi7RhY

Of course, updating DNSMasq and the scheduler would be slightly different on Merlin than DD-WRT.
 
I'm not sure how much more I can help. You're delving into more and more custom configuration here. I'm not even sure I know exactly the situation there. But if you're suggesting use of the script only for generating the hosts file, wherever most convenient, then importing that into DNSMasq by whatever protocols are available to you, sure, whatever it takes.
 
Similar threads
Thread starter Title Forum Replies Date
C OpenWRT on EdgeRouter Lite 3 Routers 5

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top