How to configure DNS and DHCP with a wireless bridge?

I have strange behavior with my wireless bridges. Mainly it takes a very long time until internet works, but then it is a lot faster.

With my linux box I checked the info of network manager and there I found strange DNS-IPs

To do a short explanation.

There is a wireless range extender DAP-X1860 A1 using OpenWrt 23.05.2. This extender connects to a Netgear Nighthawk X4S R7800 using OpenWrt 18.06.1 and the Netgear connects to a Fritzbox with FritzOS and the Fritzbox connects to the internet. I know the R7800 must be updated, but not now, it will be replaced with a Zyxel Armor Z2 and later the Zyxel with a Asus TUF 6000. So everything step by step.

I want that the Fritzbox is used as DNS-Server and the Fritzbox is used as DHCP-Server. Looks like to work generally, but maybe there is something not or misconfigured.

My configuration with the Extender is:

root@X1860-K1M:/etc/config# cat /etc/config/dhcp 

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option cachesize '1000'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'
	option filter_aaaa '0'
	option filter_a '0'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

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

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

and

root@X1860-K1M:/etc/config# cat /etc/config/network 

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 'fdbb:7293:3d08::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.178.53'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option gateway '192.168.178.1'
	list dns '192.168.178.1'

This is all default, except the 2 last lines with option gateway and list dns and the ip address configured in "option ipaddr"

Now I wonder why my linux box with network manager shows the ip-address 192.168.178.53 as dns-server and not 192.168.178.1.

The DHCP servers in the downstream devices must be set to disabled. All DHCP requests will bridge back to the Fritzbox, which will configure the clients to use it as the gateway.

When the OpenWrt device itself wants to use the Internet (for example setting its clock with NTP) , it needs a gateway and DNS configured. The gateway is the main router (Fritzbox) and the DNS is also usually the main router. These can be configured automatically by making the lan interface proto dhcp instead of proto static. You will need to log into the main router to find out what their DHCP assignments are. They can also be forced to a particular IP by making a DHCP reservation in the main router.

Note that the IP and gateway settings in a downstream AP do not affect the clients using that AP. Cllients are bridged back to the main router at level 2 (traffic controlled by MAC addresses not IP addresses).

1 Like

How can this be done? In /etc/config/dhcp ?

In luci there is "This is the only DHCP server in the local network."

What is the corresponding text line?

What is necessary by editing text to disable dns?

Do I have to add:

list server '192.168.178.1'

in config dnsmasq ?

Sorry I am not sure if I understand what you said, especially while I am confused with the names "master" and "client", so I am talking of the devices.

The DAP-X1860 is wireless connected to the Netgear R7800. The Netgear is connected via Ethernet to the Fritzbox.

Do I understand it correctly, that it depends, what is configured with the R7800?

Note I have 2 lines configured with the DAP-X1860

option gateway '192.168.178.1'
list dns '192.168.178.1'

Querying the R7800:

root@R7800:~# cat /etc/config/dhcp 

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'

config dhcp 'lan'
	option interface 'lan'
	option ignore '1'

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

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

and

root@R7800:~# cat /etc/config/network 

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd06:6e71:b364::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth1.1'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.178.55'
	option gateway '192.168.178.1'
	option dns '192.168.178.1'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'none'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'none'

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 '5 0t'

Please note, there is

option dns '192.168.178.1'

and

list dns '192.168.178.1'

Is this correct?

If you need other config-files please let me know.

The wireless bridge needs to operate in WDS mode.

In the lan section of /etc/config/dhcp, set dhcpv4, dhcpv6, and ra all to disabled. In the GUI this is done in the Network-->edit interface section, DHCP server tab.

It is not necessary to change any global DNS options. Setting a list dns in the lan interface or using proto dhcp on the lan interface will be sufficient. option dns is deprecated, use list dns now as it allows more than one server to be configured with multiple lines.

1 Like

In Is there a “newer” documention for creating a wireless backhaul? - #4 by linuxuser I mentioned already.

Not so easy to understand why "sta" corresponds to "wds" at first sight.

Not sure if you have to do this with all the 3, or if the last line option ignore '1' is enough.

/etc/config/dhcp

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option ignore '1'

Please where? With the webinterface, which file with the editor?

Only 192.168.178.1 should be used as dhcp and dns server.

/etc/config/dhcp:|list server '192.168.178.1'
/etc/config/network:|option gateway '192.168.178.1'
/etc/config/network:|list dns '192.168.178.1'

In <config dhcp 'lan'> there is at the end <option ignore '1'>

Am I done now?

I did this with all my wireless bridges and internet is unusable. Removed this with 1 wireless brdige and I am back to internet. So I think there is something missing. No ping didn't work or it was about 5000ms.