Setting up a guest VLAN, DHCP/DNS for both guest and primary?

I'm fairly new to OpenWRT and self administered networking. I've installed OpenWRT on a Netgear R6220, which is a combination router and wireless AP. The R6220 has two radios, a 2.4 GHz and a 5 GHz, and each radio can broadcast two SSID. It is currently set to have the IP address of 192.168.1.1. I have a computer running Pi hole at 192.168.1.2 which serves as both my DNS and DHCP. Right now, I only have one SSID being broadcast from each radio for my primary network, and this is working well. I want to add a guest/IoT wifi that isolates each device (say under the 192.168.2.0/24 subnet), but I still want the Pi hole to be the DNS and DHCP server for this network. I can't quite figure this out. I'm fairly certain that I need to setup a VLAN and assign each SSID to primary or guest, but I'm not sure how to implement this in OpenWRT and how to get the DNS/DHCP to work for the guest network. Any tips or resources that I should look at?

Simplest solution is probably to use the default config in the router, then add a guest network (as documented on the wiki), but keep the router as the DNS server/cache for both networks. Finally, configure the router to use the PiHole as an upstream DNS.

3 Likes

http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

3 Likes

While you may have reasons to run pihole, but did you consider to use luci-app-adblock instead?

The feature set isn't identical, but may be close enough - with a lot less fuzzing around (although eduperez' suggestion is correct and should work).

3 Likes

Thanks, this seems to have worked for the most part. I did have iptable rules forcing all DNS traffic through the PiHole, but having them in place prevents the guest network from having any traffic. I'll have to figure this out.

Hmm...I didn't know about luci-app-adblock. I'll have to look into it if I can't get my iptables to work how I want them.