Recently I installed OpenWrt on my Archer C50 v4 using tftp. The installation was relatively smooth and the router is working.
Before switching to OpenWrt, my Pi was resolving queries without any issues and everything worked as intended. I have configured the router to use Pi-hole by setting Network > Interfaces > LAN > DHCP Server > Advanced Settings > DHCP-Options
to 6,10.0.0.35
(10.0.0.35
being my Pi's internal IP).
The router is located at 10.0.0.1
, my subnet is 255.0.0.0
, DHCP starts handing out IP addresses at 10.0.2.0
and stops somewhere at 10.0.255.0
or 10.0.255.255
.
I have also enabled the Log queries
option in order to debug.
/etc/config/dhcp on router
config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
option logqueries '1'
config dhcp 'lan'
option interface 'lan'
option start '512'
option limit '64768'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
list dhcp_option '6,10.0.0.35'
option dns_service '0'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
list ra_flags 'none'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
/etc/config/network on router
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdd9:0047:1730::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ip6assign '60'
option ipaddr '10.0.0.1'
option netmask '255.0.0.0'
config device
option name 'eth0.2'
option macaddr '1c:3b:f3:f1:3f:3a'
config interface 'wan'
option device 'eth0.2'
option proto 'dhcp'
option peerdns '0'
list dns '1.1.1.1'
config interface 'wan6'
option device 'eth0.2'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 6t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0 6t'
output of dig eff.org @127.0.0.1 -p 5335
on pi (unbound runs on port 5335)
; <<>> DiG 9.16.22-Raspbian <<>> eff.org @127.0.0.1 -p 5335
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1827
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;eff.org. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.1#5335(127.0.0.1)
;; WHEN: Wed Dec 29 13:21:39 GMT 2021
;; MSG SIZE rcvd: 36
/var/log/unbound/unbound.log on pi
(password is openwrt)
I have tried fiddling with the settings getting it to work, I found this (https://www.reddit.com/r/pihole/comments/mu7eyy/attempting_to_connect_pihole_recursive_dns_on/) but it wasn't particularly helpful.
I reset the router and wiped the pi in desperation and nothing worked.
If any other config files or logs are required, please ask
Also please confirm if I am doing things correctly or everything about my setup is inherently wrong
All help is appreciated,
Thanks in advance