Menu Close

Allow Guest WiFi to use Pi-hole on Asuswrt-Merlin

I enabled the Guest WiFi on my Asuswrt-Merlin router, so that some of my IoT devices could be separated from my network. What I soon discovered was that I could not get an internet connection on the Guest WiFi because the DNS server on my LAN is an internal address pointing to my Pi-hole, and the Guest WiFi was preventing access to my LAN.

After some research I found a project on GitHub called YazFi which would allow the Guest Wifi to communicate with the router to allow (among other things) access to my internal DNS server.

Getting up and running with YazFi is very, very straight forward. The setup instructions are on https://github.com/jackyaz/YazFi but I’ll provide a quick summary below.

 

You will need a router running Asuswrt-Merlin firmware and SSH access to the router. For more information on Asuswrt-Merlin, see https://www.asuswrt-merlin.net/
 
  1. Log into the router’s GUI and create a new Guest WiFi network, with an SSID and a passphrase.
  2. Open an SSH session to your router, then copy/paste the following command and press Enter:

  1. This will install YazFi. Once it it’s installed, press Enter.
  2. In the console, type in YazFi to launch the application.
  3. In the menu, type in 3. Edit YazFi config then press Enter. You will be asked to select an editor – for simplicity use nano.
  4. In the editor, edit the options for each Guest WiFi you have setup. In my case, I only have one so I will be modifying the wl01 section. Below is what my config file looks. Note that you will need to reference the Explanation of YazFi settings section to modify this for your network, but the important part here was that I change the DNS, both DNS1 and DNS2 to point to my internal Pi-hole which is on 10.1.1.2:

  1. Once you have made your changes, hit CTRL + X. You will be asked to save your script.
  2. Back at the main menu type 1 then press Enter to apply the YazFi configuration.

The application will now launch and apply your settings. Once it’s ready, you should now be able to connect your Guest Wifi to the internet and have it pass through your Pi-hole so that it can also block ads.

And yes, YazFi will automatically launch on a router reboot.

Posted in ASUS, Asuswrt-Merlin, Pi-hole

1 Comment

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.