No DHCP and DNS in dumb AP mode

Hi, I'm using X86 as main router and Xiaomi Mi router for Dump AP but wireless does not get dhcp ip address from main router.

Dumb AP config edit below

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 'xxx:yyyy:zzzz:aaaa'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config interface 'guest'
	option proto 'static'
	option device 'eth0.10'
	option type 'bridge'
	option ipaddr '192.168.10.2'
	option netmask '255.255.255.0'
	option gateway '192.168.10.1'

config interface 'dmz'
	option proto 'static'
	option device 'eth0.20'
	option ipaddr '192.168.20.2'
	option netmask '255.255.255.0'
	option type 'bridge'

config interface 'iot'
	option proto 'static'
	option device 'eth0.30'
	option ipaddr '192.168.30.2'
	option netmask '255.255.255.0'
	option type 'bridge'

config switch_vlan
	option device 'switch0'
	option vlan '10'
	option ports '6t 0t'

config switch_vlan
	option device 'switch0'
	option vlan '20'
	option ports '6t 4 2 0t'

config switch_vlan
	option device 'switch0'
	option ports '6t 0t'
	option vlan '30'

config device
	option name 'eth0.10'
	option type '8021q'
	option ifname 'eth0'
	option vid '10'
	option ipv6 '0'
	option acceptlocal '1'

config device
	option name 'eth0.20'
	option type '8021q'
	option ifname 'eth0'
	option vid '20'
	option ipv6 '0'
	option acceptlocal '1'

config device
	option name 'eth0.30'
	option type '8021q'
	option ifname 'eth0'
	option vid '30'
	option ipv6 '0'
	option acceptlocal '1'

config device
	option name 'phy0-ap0'

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/10300000.wmac'
	option channel '1'
	option band '2g'
	option htmode 'HT20'
	option cell_density '0'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
	option channel '36'
	option band '5g'
	option htmode 'VHT80'
	option disabled '1'

config wifi-iface 'wifinet0'
	option device 'radio0'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'psk2'
	option key 'xxxxxxx'
	option network 'iot'

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 odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config dhcp 'guest'
	option interface 'guest'
	option start '210'
	option limit '20'
	option leasetime '12h'
	option ignore '1'

i think you need a 'list dns ipaddr' setting in your interface sttings. typically this would point to the gateway. it's on the 2nd page (advanced settings) of the luci page for the interface .

How is the main router configured?

Thank you for your quick feedback. Here are, main router config :


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 'xxxxxxx'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth1'
	option igmp_snooping '1'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'eth0:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '20'
	list ports 'eth0:t'
	list ports 'eth1'

config bridge-vlan
	option device 'br-lan'
	option vlan '30'
	list ports 'eth0:t'

config interface 'guest'
	option proto 'static'
	option device 'br-lan.10'
	option ipaddr '192.168.10.1'
	option netmask '255.255.255.0'

config interface 'dmz'
	option proto 'static'
	option device 'br-lan.20'
	option ipaddr '192.168.20.1'
	option netmask '255.255.255.0'

config interface 'iot'
	option proto 'static'
	option device 'br-lan.30'
	option ipaddr '192.168.30.1'
	option netmask '255.255.255.0'

config interface 'wan'
	option proto 'static'
	option device 'eth2'
	option ipaddr '192.168.0.7'
	option netmask '255.255.255.0'
	option gateway '192.168.0.254'
	list dns '192.168.0.254'

config device
	option name 'br-lan.10'
	option type '8021q'
	option ifname 'br-lan'
	option vid '10'
	option ipv6 '0'

config device
	option name 'br-lan.20'
	option type '8021q'
	option ifname 'br-lan'
	option vid '20'
	option ipv6 '0'

config device
	option name 'br-lan.30'
	option type '8021q'
	option ifname 'br-lan'
	option vid '30'
	option ipv6 '0'



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 cachesize '1000'
	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 port '53'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'
	option start '100'
	option limit '150'
	option leasetime '12h'

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

config dhcp 'guest'
	option interface 'guest'
	option start '100'
	option limit '50'
	option leasetime '12h'

config dhcp 'dmz'
	option interface 'dmz'
	option start '100'
	option limit '50'
	option leasetime '12h'

config dhcp 'iot'
	option interface 'iot'
	option start '100'
	option limit '50'
	option leasetime '12h'



config defaults
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option synflood_protect '1'

config zone
	option name 'dmz'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'dmz'

config zone
	option name 'wan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option mtu_fix '1'
	list network 'wan'
	list network 'wan6'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-Ping'
	option src 'wan'
	option proto 'icmp'
	option icmp_type 'echo-request'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-IGMP'
	option src 'wan'
	option proto 'igmp'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-MLD'
	option src 'wan'
	option proto 'icmp'
	option src_ip 'fe80::/10'
	list icmp_type '130/0'
	list icmp_type '131/0'
	list icmp_type '132/0'
	list icmp_type '143/0'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Input'
	option src 'wan'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	list icmp_type 'router-solicitation'
	list icmp_type 'neighbour-solicitation'
	list icmp_type 'router-advertisement'
	list icmp_type 'neighbour-advertisement'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Forward'
	option src 'wan'
	option dest '*'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config zone
	option name 'guest'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'guest'

config zone
	option name 'iot'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'iot'

config forwarding
	option src 'dmz'
	option dest 'iot'

config forwarding
	option src 'dmz'
	option dest 'wan'

config forwarding
	option src 'iot'
	option dest 'wan'

config rule
	option name 'Allow-Guest DNS DHCP'
	option src 'guest'
	option dest_port '53 67 68'
	option target 'ACCEPT'

config rule
	option name 'Allow-IOT DNS DHCP'
	option src 'iot'
	option dest_port '53 67 68'
	option target 'ACCEPT'

config rule
	option name 'Allow-DMZ DNS DHCP'
	option src 'dmz'
	option dest_port '53 67 68'
	option target 'ACCEPT'

config rule
	option name 'Disable Internet for IOT'
	option src 'iot'
	option dest 'wan'
	option target 'REJECT'
	list proto 'all'
	option enabled '0'

config rule
	option name 'Disable Internet for Guest'
	option src 'guest'
	option dest 'wan'
	option target 'REJECT'
	option start_time '23:00:00'
	option stop_time '05:00:00'
	list proto 'all'
	option enabled '0'

Set DNS in ' 'list dns ipaddr' change nothing. No address deliver on wifi card.
Return ip 169.254.*

The usual setup is that you make a bridge first e.g.:

config device
	option name 'br-guest'
	option type 'bridge'
	list ports 'eth0.10'

config interface 'guest'
	option proto 'static'
	option device 'br-guest'
	option ipaddr '192.168.10.2'
	option netmask '255.255.255.0'
	option gateway '192.168.10.1'

Your setup might work though, so not sure if this is the real problem

Furthermore I would delete:

config device
	option name 'phy0-ap0'

Reboot afterwards

1 Like

+1 to what @egc said. And to be clear, you have this problem on all of your networks on the dumb AP.

The other thing is that typically the dumb AP will only have an address on the network that is used to manage. The rest should be unmanaged. So if the guest network is not used to manage the device, it would actually look like this:

config interface 'guest'
	option proto 'none'
	option device 'br-guest'

Finally, you can delete these, as they are unnecessary:

If these things don't fix your issues, post the latest config and we'll take another look.

Thanks for all but nothing change after deleting "config devices"
Now, new network AP Dumb config is

type or paste code here
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 'xxxxxxxxxxxx'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config interface 'guest'
	option proto 'static'
	option device 'eth0.10'
	option type 'bridge'
	option ipaddr '192.168.10.2'
	option netmask '255.255.255.0'
	option gateway '192.168.10.1'
	list dns '192.168.10.1'

config interface 'dmz'
	option proto 'static'
	option device 'eth0.20'
	option ipaddr '192.168.20.2'
	option netmask '255.255.255.0'
	option type 'bridge'
	list dns '192.168.20.2'

config interface 'iot'
	option proto 'static'
	option device 'eth0.30'
	option ipaddr '192.168.30.2'
	option netmask '255.255.255.0'
	option type 'bridge'
	list dns '192.168.30.2'

config switch_vlan
	option device 'switch0'
	option vlan '10'
	option ports '6t 0t'

config switch_vlan
	option device 'switch0'
	option vlan '20'
	option ports '6t 4 2 0t'

config switch_vlan
	option device 'switch0'
	option ports '6t 0t'
	option vlan '30'

You did not implement the advice from @egc about creating the bridges outside the network interface and using those as the device.

I didn't understand what order was crucial.
OK, I will do it.

It's not really an order of operations, rather multiple things that should be fixed at the same time.

1 Like

Should i redo the config step by step in Luci interface or changing order in network config is it enough ?

You can make the changes directly in the text file.

Ok but I no longer have "bridge device" in my network config file ?