Unbound in OpenWRT

  • Thread starter Thread starter panks21
  • Start date Start date
  • Replies Replies 21
  • Views Views 10,860
There is an option I think, you can assign them by editing the bridge LAN interface of OpenWrt. It's under Advanced Settings of the bridge LAN interface.
 
It is added via dhcp_option which I did inder bridge-LAN > DHCP Server > Advanced Settings which resulted into following config file change, however, the clients still receives the OpenWRT IP only as DNS server

Code:
config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '120'
        option leasetime '1h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        list dhcp_option '6,192.168.50.251,192.168.50.1'
 
Reviving this thread -- I did a clean install for openwrt today again
The setup has now two WAN connections
Installed mwan3 and configured it. Things work as expected

Post that installed Unbound and tried to configure DoT which also happened properly and I am able to resolve names locally on openwrt, however the dhcp clients of openwrt are getting a weird DNS server address from the DHCP server.
Any idea how to fix this

LAN config

Code:
config dhcp 'lan'
        option interface 'lan'
        option leasetime '12h'
        option dhcpv4 'server'
        option start '130'
        option limit '230'
        option dns_service '0'
        option ra 'server'
        list dhcp_option '6,192.168.50.251,192.168.50.129'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option leasefile '/tmp/hosts/odhcpd'
        option loglevel '4'
        option maindhcp '1'
        option leasetrigger '/usr/lib/unbound/odhcpd.sh'

Unbound Config

Code:
unbound.ub_main=unbound
unbound.ub_main.add_extra_dns='0'
unbound.ub_main.dns64='0'
unbound.ub_main.dns64_prefix='64:ff9b::/96'
unbound.ub_main.domain='lan'
unbound.ub_main.domain_type='static'
unbound.ub_main.edns_size='1232'
unbound.ub_main.extended_stats='0'
unbound.ub_main.hide_binddata='1'
unbound.ub_main.interface_auto='1'
unbound.ub_main.listen_port='53'
unbound.ub_main.localservice='1'
unbound.ub_main.manual_conf='0'
unbound.ub_main.num_threads='1'
unbound.ub_main.protocol='default'
unbound.ub_main.query_minimize='0'
unbound.ub_main.query_min_strict='0'
unbound.ub_main.rate_limit='0'
unbound.ub_main.rebind_localhost='0'
unbound.ub_main.rebind_protection='1'
unbound.ub_main.recursion='default'
unbound.ub_main.resource='default'
unbound.ub_main.root_age='9'
unbound.ub_main.ttl_min='120'
unbound.ub_main.ttl_neg_max='1000'
unbound.ub_main.validator='0'
unbound.ub_main.validator_ntp='1'
unbound.ub_main.verbosity='1'
unbound.ub_main.iface_trig='lan' 'wan'
unbound.ub_main.iface_wan='wan'
unbound.ub_main.add_local_fqdn='3'
unbound.ub_main.add_wan_fqdn='1'
unbound.ub_main.dhcp_link='odhcpd'
unbound.ub_main.dhcp4_slaac6='1'
unbound.ub_main.unbound_control='1'
unbound.auth_icann=zone
unbound.auth_icann.enabled='0'
unbound.auth_icann.fallback='1'
unbound.auth_icann.url_dir='https://www.internic.net/domain/'
unbound.auth_icann.zone_type='auth_zone'
unbound.auth_icann.server='lax.xfr.dns.icann.org' 'iad.xfr.dns.icann.org'
unbound.auth_icann.zone_name='.' 'arpa.' 'in-addr.arpa.' 'ip6.arpa.'
unbound.fwd_isp=zone
unbound.fwd_isp.enabled='0'
unbound.fwd_isp.fallback='1'
unbound.fwd_isp.resolv_conf='1'
unbound.fwd_isp.zone_type='forward_zone'
unbound.fwd_isp.zone_name='isp-bill.example.com.' 'isp-mail.example.net.'
unbound.fwd_google=zone
unbound.fwd_google.enabled='0'
unbound.fwd_google.fallback='1'
unbound.fwd_google.tls_index='dns.google'
unbound.fwd_google.tls_upstream='1'
unbound.fwd_google.zone_type='forward_zone'
unbound.fwd_google.server='8.8.4.4' '8.8.8.8' '2001:4860:4860::8844' '2001:4860:4860::8888'
unbound.fwd_google.zone_name='.'
unbound.fwd_cloudflare=zone
unbound.fwd_cloudflare.enabled='0'
unbound.fwd_cloudflare.fallback='1'
unbound.fwd_cloudflare.tls_index='cloudflare-dns.com'
unbound.fwd_cloudflare.tls_upstream='1'
unbound.fwd_cloudflare.zone_type='forward_zone'
unbound.fwd_cloudflare.server='1.1.1.1' '1.0.0.1' '2606:4700:4700::1111' '2606:4700:4700::1001'
unbound.fwd_cloudflare.zone_name='.'
unbound.@zone[4]=zone
unbound.@zone[4].enabled='1'
unbound.@zone[4].fallback='0'
unbound.@zone[4].zone_type='forward_zone'
unbound.@zone[4].zone_name='.'
unbound.@zone[4].tls_upstream='1'
unbound.@zone[4].tls_index='xxxxxxx.dns.controld.com'
unbound.@zone[4].server='76.76.10.22' '76.76.2.22' '2606:1a40:x:xx:xxxx:xxxx:xxxx:0' '2606:1a40:x:xx:xxxx:xxxx:xxxx:0'

ipconfig on laptop received wierd DNS servers from DHCP

Code:
Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Lenovo USB Ethernet
   Physical Address. . . . . . . . . : 48-2A-E3-64-B0-A3
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2406:b400:60:xxxx:xxxx:xxxx:xxxx:xxxx(Preferred)
   Temporary IPv6 Address. . . . . . : 2406:b400:60:xxxx:xxxx:xxxx:xxxx:xxxx(Preferred)
   Link-local IPv6 Address . . . . . : fe80::645f:e89f:81b8:2d60%15(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.50.242(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.128
   Lease Obtained. . . . . . . . . . : Saturday, May 20, 2023 21:16:22
   Lease Expires . . . . . . . . . . : Sunday, May 21, 2023 09:18:32
   Default Gateway . . . . . . . . . : fe80::b6fb:e4ff:fe1d:ca56%15
                                       192.168.50.129
   DHCP Server . . . . . . . . . . . : 192.168.50.129
   DHCPv6 IAID . . . . . . . . . . . : 256387811
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2B-84-B2-61-70-1A-B8-59-98-7C
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled
 
done that but in vain. I am still getting following DNS servers from the openwrt which are unusable

Code:
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                    fec0:0:0:ffff::2%1
                                    fec0:0:0:ffff::3%1
 
I guess post unbound config, the dhcp is handled by odhcp.
Is there anything we need to do there??
 
odhcpd is just a daemon. It gets the config info from dhcp file. Have you tried flushing and renewing after adding the missing lines?
 
yes. flushed dns.. restarted laptop..
BTW what service I should resart post making the changes.. I restarted odhcp only..

Code:
root@alpha:~# /etc/init.d/
boot              done              gpio_switch       mwan3             rpcd              sysfixtime        ucitrack          unbound           wpad
bootcount         dropbear          led               network           set-irq-affinity  sysntpd           uhttpd            urandom_seed
cron              firewall          log               odhcpd            sysctl            system            umount            urngd
root@alpha:~# /etc/init.d/
 
Back