Sun. Oct 24th, 2021
r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

Recently, I managed to discover a Huawei AX3 Quad-Core Wifi 6 router on sale for simply the equal of $37. I upgraded from utilizing a TP-Link Archer C20 AC750, which was doing okay however I believed it was time to exchange it (amongst different issues, it solely had Fast Ethernet ports!).

One factor I seen with this router, is that similar to many different newer consumer-grade stuff, it’s a little restricted in its configuration. At any price, I managed to discover a option to have it pointing to my Pi-Hole in each IPv4 and IPv6. I’m assuming that you have already got the Pi arrange and operating and in a position to obtain requests, and you simply must have gadgets on your community robotically use it as DNS.

Here is the way it’s accomplished. I’m utilizing the online configuration as a substitute of the Huawei app. I’ve the Global model with Software Version 10.0.5.33 and EMUI Router model 10.0.5.1. In my area, that is recognized as the “Huawei Wifi AX3 Quad-Core”, however I’ve seen it elsewhere as the “AX3 Pro” or below the Honor model as “Honor Router 6”. Model quantity is WS7200. It might also apply to the Dual-Core/Non-Pro model or different Huawei routers of comparable classic.

IPv4

With IPv4, that is easy, though not multi function place essentially like in different routers.

Option 1: Use Static DNS

If you’re utilizing the router DHCP, it at all times advertises itself as the DNS server. Fortunately, you possibly can level it your Pi-Hole as the upstream DNS server and it’s going to completely work simply advantageous.

  1. Go to “Connect to Internet”

  2. Check the “Static DNS” possibility

  3. Enter your Pi-Hole’s IP below “Preferred DNS server”

  4. (Optional) Enter your secondary Pi-Hole IP below “Alternate DNS Server”

r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

Option 2: Turn off DHCP and use the Pi as your DHCP

  1. Go to More Functions -> Network Settings -> LAN

  2. Turn off the DHCP server.

  3. Enable DHCP on the Pi-Hole

r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

IPv6

This is the place it will get actually fascinating/furry/janky!

Under More Functions->Network Settings->IPv6, you might have just a few choices for the way addresses are distributed on the community. However, the DNS configuration is grayed out and set to “Automatic”! Crucially, in case you allow DHCPv6, you can set Primary and Secondary DNS servers, however for no matter motive Windows gadgets respect the setting, however iOS and Android gadgets refuse to make use of it and find yourself utilizing the router as the DNS anyway one way or the other. I feel they’re forcing SLAAC for some motive.

r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

There is, nonetheless, some excellent news. I used to be an internet developer as soon as upon a time, and took the freedom of opening up the Developer Tools in my browser. I discovered that the “DNS Access” possibility is not even a disabled or hidden enter, it is only a static factor! However, I discovered that the router was one way or the other sending a “X_IPv6DNSOverrideAllowed=false” flag once I save the web page, as properly as “X_IPv6DNSServerOne” and “X_IPv6DNSServerTwo” parameters. This received me curious, and as it seems, these flags completely work!

While the UI provides us no choices, we are able to hack our approach by way of there. So, in case you’re one way or the other insistent (as I used to be) in enabling IPv6 on your community, listed here are the steps utilizing Microsoft Edge or Google Chrome (all fashionable browsers can do that. Adapt as acceptable for your browser):

  1. Navigate to the IPv6 settings web page (More Functions->Network Settings->IPv6)

  2. Open Developer Tools (F12 or CTRL+SHIFT+I)

  3. Select the “Sources” tab. You could must click on the More Tools (“+”) icon to open it.

  4. Select the file top->->views->ipv6->ipv6.js

  5. Find the “postdata” perform:

r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

You will see the X_IPv6… choices right here. What you will want to do is to override the next variables:

  • toIpv6WanPostdata.X_IPv6DNSOverrideAllowed: set to true

  • toIpv6WanPostdata.X_IPv6DNSServerOne: set to Pi-Hole IPv6 handle*

  • toIpv6WanPostdata.X_IPv6DNSServerTwo: (non-obligatory)

* Your Pi-Hole machine can have a number of IPv6 addresses, probably. Use the link-local handle, which you’ll be able to inform simply as a result of it at all times begins with the prefix fe80.

You ought to then have one thing like this. Take notice of the quotes across the handle, in case you’re unfamiliar with JavaScript:

toIpv6WanPostdata.X_IPv6DNSOverrideAllowed=true;
toIpv6WanPostdata.X_IPv6PrefixLength=this.addrlength
toIpv6WanPostdata.X_IPv6DNSServerOne="fe80::2eed:74d2:9337:5ca3"  toIpv6WanPostdata.X_IPv6DNSServerTwo=this.slavedns

Save your adjustments with CTRL+S. You ought to see a warning triangle subsequent to the file identify if it is edited:

r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

Note: You must do that every time you log in in case you make any adjustments to the IPv6 settings, as a result of the script will revert again to authentic and the DNS flags will likely be reset. Best to do that change final. On the opposite hand, in case you actually love tinkering with your router, this could get fairly annoying, however in that case you ought to be operating a Mikrotik/Ubiquiti/Pfsense/OpenWRT/and many others. anyway as a substitute of some cheap-ass customer grade router just like the Huawei. 😉

Finally, click on the precise Save button on the IPv6 settings web page.

You can confirm your settings (each for IPv4 and IPv6) by going to More Functions->About Router:

r/pihole - HOWTO: Set your Pi-Hole as DNS on Huawei AX3 Quad-Core/AX3 Pro/Honor Router 6/WS7200 Router (IPv6 and IPv4)

Honestly, I do not know why this perform is disabled within the first place. The router OS clearly helps it, however there isn’t any corresponding option to set it within the UI.

Thanks for studying – get pleasure from!

By admin