Open ameshkov opened 4 years ago
The absolute minimum is:
cat /etc/config/network
config interface 'lan'
option netmask '255.255.255.0'
option ipaddr '192.168.8.1'
cat /etc/config/dhcp
config dhcp 'lan'
option start '100'
option limit '150'
option leasetime '12h'
ignoring anything else.
And DNS server bootstrap address must be read from /etc/resolv.conf:
nameserver ...
nameserver ...
Don't forget about static leases
And dhcp-option. I currently have these in /etc/dnsmasq.conf:
dhcp-option=60,IPTV_RG
dhcp-option=28,192.168.1.255
I need these for my IPTV to function.
Reassigning to v0.103, a lot about our DHCP server should be improved first
OpenWrt updated to 107 release and it is now easier to swap dnsmasq to ptr/rdns only and use AGH as primary dns.
https://openwrt.org/docs/guide-user/services/dns/adguard-home has more info.
I updated instructions to manually install AGH on OpenWrt and detail all the issues and fixes. https://forum.openwrt.org/t/how-to-updated-2021-installing-adguardhome-on-openwrt/113904
At present I wouldn't use AGH DHCP except on simple networks. As was mentioned earlier your DHCP needs work to do more than simple networks. A few people have had issues with multiple IP ranges and VLANS.
The compromise of using OpenWrt for dhcp and AGH for DNS seems to be best fix at present. (edit) - NTP really also requires a DNS exception to avoid issues getting/setting date/time so encrypted DNS can be used. https://openwrt.org/docs/guide-user/services/dns/adguard-home#bypassing_encrypted_dns_for_ntp
Hey @ameshkov,
Could you please clarify how to configure AdGuardHome on openwrt properly in case I use pppoe as a wan connection where upstream DNS servers are dynamically advertised by provider ?
The problem is that they are dynamic and can be changed once you reconnected. Does AdGuardHome respects file /tmp/resolve.conf.auto where providers DNS are configured ?
Thanks
@mercyground I want to give the recommended approach a try, but doesn't it make local devices' hostnames unresolvable, since dnsmasq is still the DHCP server and Adguard home doesn't know about these devices?
Update: Oh my bad, if want use dnsmasq just change dns to port 54 then all will work.
Hi, after move dnsmasq to port 54 and change adguardhome port 53 follow document, client on lan still can connect to internet but openwrt itself can not (can not ping google, can not opkg update) I have fixed it by set dns 8.8.8.8 for pppoe-wan interface (to edit /tmp/resolv.conf), openwrt itself now can connect to internet. But one more issue that OpenVPN server running on openwrt has this config
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DOMAIN lan"
It also stopped client connect to vpn access internet because dns 10.8.0.1 not work now. can fix it by change openvpn dhcp dns to 8.8.8.8, but I want openvpn client use my adguardhome dns as default!
Anyone have guide how to make it work without change dns to 8.8.8.8? Current I forced revert to use dnsmasq at port 53 for keep other things work.
Thank you.
We should provide an easy way to replace dnsmasq on openwrt: https://openwrt.org/docs/guide-user/base-system/dhcp.dnsmasq
So we should provide an option to import the necessary configuration parameters including DHCP settings and DNS settings. Please note, that the DNS server from there will be used as a bootstrap, the real upstream will be configured in AdGuard Home settings exclusively.
Additionally, we should figure out how to keep DHCP integration in place. How does openwrt read the information about dynamic DHCP leases?