This was a fun project that I took up as a learning experience. After following a few guides I managed to do this and if anyone wants to have it up and running here are the steps. Note, I don't 100% know what I'm doing. This setup just worked for my RT-AC68U router. Overall the cpu and ram seems to handle pihole without trouble. Note having ram swap set up is recommended.
For pihole v5.0 see issue guide
1. Following these guides to get Debian running on the router Stretch, Jessie, or wheezy (anything running wheezy is less likely to work due to compatibility of pi-hole.)
If you get an update error after entering "apt-get update && apt-get upgrade -y" then you need to edit the source.list (This doesn't appear to be a current issue)
2. Getting everything ready for pihole
3. Installing pihole. For setup make sure the eth or vlan you choose isn't taken by using the "ip a" command.
If you get back an error relating to storage space try the following instead.
4. Depending on the router you might have to compile FTL. You will know if this is the case if you are getting a "old kernel" error or issues with FTL that isn't related to port number. Just follow this guide for compiling. If you get an Error 1 after entering "sudo make install" that is to be expected just continue the guide.
If you get a port 53 taken error just run the following command.
Restart pihole-FTL service.
5. Changing port 80 for the website (if needed)
Now you should have pihole running.
creating the following script and adding it to S99debian will allow pihole to start up if the router reboots.
Don't forget to backup Debian.
DNS over TLS and DNSSEC can be enabled if you add stubby or unbound.
Please feel free to add suggestions or possible improvements.
For pihole v5.0 see issue guide
1. Following these guides to get Debian running on the router Stretch, Jessie, or wheezy (anything running wheezy is less likely to work due to compatibility of pi-hole.)
If you get an update error after entering "apt-get update && apt-get upgrade -y" then you need to edit the source.list (This doesn't appear to be a current issue)
Code:
nano /etc/apt/sources.list
2. Getting everything ready for pihole
Code:
apt-get install curl
apt-get install sudo
sudo -s
mount /proc
cat /proc/mounts > /etc/mtab
3. Installing pihole. For setup make sure the eth or vlan you choose isn't taken by using the "ip a" command.
Code:
curl -L https://install.pi-hole.net | bash
Code:
sudo -s
cd /
wget -O basic-install.sh https://install.pi-hole.net
sudo bash basic-install.sh --i_do_not_follow_recommendations
4. Depending on the router you might have to compile FTL. You will know if this is the case if you are getting a "old kernel" error or issues with FTL that isn't related to port number. Just follow this guide for compiling. If you get an Error 1 after entering "sudo make install" that is to be expected just continue the guide.
If you get a port 53 taken error just run the following command.
Code:
netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471 \|:5453 \|:8093'
killall -9 dnsmasq
5. Changing port 80 for the website (if needed)
Code:
nano /etc/lighttpd/lighttpd.conf
change it to what you want
sudo /etc/init.d/lighttpd restart
Now you should have pihole running.
creating the following script and adding it to S99debian will allow pihole to start up if the router reboots.
Code:
chroot /opt/debian /bin/bash <<"EOT"
sudo ip address add (pihole ip) dev (eth or vlan)
sudo /etc/init.d/lighttpd restart
killall -9 dnsmasq
sudo service pihole-FTL restart
EOT
Don't forget to backup Debian.
DNS over TLS and DNSSEC can be enabled if you add stubby or unbound.
Please feel free to add suggestions or possible improvements.
Last edited: