WiFi clients are not being assigned DHCP address

This cm4 raspberry pi is used in a lab environment for testing using a fresh install of openwrt 21.02.3 with factory settings except for disabling Masquerading and accepting all all traffic WAN>>LAN.

Wireless clients connect to the Pi but are not assigned a DHCP address.

Here is the current config:

root@OpenWrt:~# 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'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option device 'eth1'

config interface 'wan'
        option proto 'dhcp'
        option device 'eth0'

root@OpenWrt:/# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option band '5g'
        option channel 'auto'
        option country 'US'
        option cell_density '0'
        option htmode 'VHT80'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

root@OpenWrt:/# 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.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        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'

root@OpenWrt:/# cat /etc/config/firewall

config defaults
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

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

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

config forwarding
        option src 'lan'
        option dest 'wan'

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 rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config rule
        option name 'Support-UDP-Traceroute'
        option src 'wan'
        option dest_port '33434:33689'
        option proto 'udp'
        option family 'ipv4'
        option target 'REJECT'
        option enabled 'false'

config include
        option path '/etc/firewall.user'

root@OpenWrt:/#

Your problem is that you need to make the lan a bridge in order to enable both ethernet and wifi.

config device 'br-lan'
        option type 'bridge'
        option device 'eth1'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option device 'br-lan'
1 Like

I tried using 'option device 'eth1'' in the network 'br-lan' definition however it did not work:

config device 'br-lan'
        option type 'bridge'
        option device 'eth1'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option device 'br-lan'

And the GUI threw a RPCError:

I changed the definition to 'list ports 'eth1'' and that resolved the RPCError in the GUI.

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

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option device 'br-lan'

And the LAN interface shows to be using 'br-lan'. However it still fails to serve up IP's to wireless clients.

Glad you were able to resolve the RPCError. Sorry for leading you in the slightly wrong direction on that.

Try restarting the device and then test again.

No worries. I rebooted and still it is not serving IP's to wireless clients, it does however serve IP's to clients connected to the LAN.

I'm not seeing any other issues in your config.

Have you tried multiple wifi client devices?

Yes, I tried a Win11 client and Android 12 phone.
image

let's take a look at the latest config files (wireless and network)

root@OpenWrt:~# 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'

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

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option device 'br-lan'

config interface 'wan'
        option proto 'dhcp'
        option device 'eth0'
root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option band '5g'
        option channel 'auto'
        option country 'US'
        option cell_density '0'
        option htmode 'VHT80'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

root@OpenWrt:~#

I'm not seeing any reason that it wouldn't work...

What happens if you set your computer or phone with a static IP (say 192.168.1.5 - assuming this isn't already in use), subnet 255.255.255.0, DNS 192.168.1.1, router/gateway 192.168.1.1)

Let me try...

Did not work:

I have no idea what is happening...

what is the output of:

ubus call system board
root@OpenWrt:~# ubus call system board
{
        "kernel": "5.4.188",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 3",
        "model": "Raspberry Pi Compute Module 4 Rev 1.0",
        "board_name": "raspberrypi,4-compute-module",
        "release": {
                "distribution": "OpenWrt",
                "version": "21.02.3",
                "revision": "r16554-1d4dea6d4f",
                "target": "bcm27xx/bcm2711",
                "description": "OpenWrt 21.02.3 r16554-1d4dea6d4f"
        }
}
root@OpenWrt:~#

With the static IP assigned wireless client failing to ping through to the LAN IP of the Pi, the problem appears to be with the bridging not forwarding packets properly as the wireless client shows to be connected:

Any ideas for testing/reconfiguring the bridging?

What happens if you remove br-lan from the lan network config. Doing that will disable Ethernet (but should mean that WiFi would be the only thing connected to lan, reducing the chance that a bridge issue is causing the problem).

Before you do this, make sure you have a backup connection option (such as the direct terminal, serial, or just pull the card and edit the config file using your computer)

Thanks for helping out @psherman

I removed the option device 'br-lan' from the 'lan' definition and rebooted with the same results, WiFi clients still fail to get IP's assigned.

To confirm the clients are sending DHCP Discovers I did a tcpdump on the wlan0 interface filtering for DHCP and it captured DHCP Discovers but no DHCP Offers from the DHCP server suggesting the bridge is not forwarding traffic.

root@OpenWrt:~# tcpdump -i wlan0 port 67 or port 68 -e -n -vv
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
11:07:01.367703 50:eb:71:1b:29:fc > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 128, id 12620, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 50:eb:71:1b:29:fc, length 300, xid 0x5b575078, Flags [none] (0x0000)
          Client-Ethernet-Address 50:eb:71:1b:29:fc
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            Client-ID Option 61, length 7: ether 50:eb:71:1b:29:fc
            Hostname Option 12, length 14: "wbrumbalow-LPC"
            Vendor-Class Option 60, length 8: "MSFT 5.0"
            Parameter-Request Option 55, length 14:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
              Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
              Netbios-Node, Netbios-Scope, Option 119, Classless-Static-Route
              Classless-Static-Route-Microsoft, Option 252
11:07:04.987372 50:eb:71:1b:29:fc > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 128, id 12621, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 50:eb:71:1b:29:fc, length 300, xid 0x5b575078, Flags [none] (0x0000)
          Client-Ethernet-Address 50:eb:71:1b:29:fc
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            Client-ID Option 61, length 7: ether 50:eb:71:1b:29:fc
            Hostname Option 12, length 14: "wbrumbalow-LPC"
            Vendor-Class Option 60, length 8: "MSFT 5.0"
            Parameter-Request Option 55, length 14:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
              Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
              Netbios-Node, Netbios-Scope, Option 119, Classless-Static-Route
              Classless-Static-Route-Microsoft, Option 252
11:07:09.301034 50:eb:71:1b:29:fc > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 128, id 12622, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 50:eb:71:1b:29:fc, length 300, xid 0x5b575078, secs 1024, Flags [none] (0x0000)
          Client-Ethernet-Address 50:eb:71:1b:29:fc
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            Client-ID Option 61, length 7: ether 50:eb:71:1b:29:fc
            Hostname Option 12, length 14: "wbrumbalow-LPC"
            Vendor-Class Option 60, length 8: "MSFT 5.0"
            Parameter-Request Option 55, length 14:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
              Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
              Netbios-Node, Netbios-Scope, Option 119, Classless-Static-Route
              Classless-Static-Route-Microsoft, Option 252
^C
3 packets captured
3 packets received by filter
0 packets dropped by kernel
root@OpenWrt:~#

To confirm if traffic was hitting 'br-lan', I attempt a tcpdump on the 'br-lan' interface but it fails with a 'No such device exists' error:

root@OpenWrt:~# tcpdump -i br-lan port 67 or port 68 -e -n -vv
tcpdump: br-lan: No such device exists
(SIOCGIFHWADDR: No such device)
root@OpenWrt:~#

Do you know how I confirm the 'br-lan' bridge exists?

Well, we removed the br-lan from the equation by taking it out of the lan network definition. In any normal situation, if you just have a single wifi radio to which you want to attach a network, you do not need a bridge.

What is really odd here is that the wifi network isn't properly attaching to the lan network that is defined, and thus not able to get a DHCP offer. I honestly don't know why this is happening.

Just to confirm -- you are running an official version of OpenWrt 22.03.2, correct?

Yes, I am using the Compute Module 4 "version": "21.02.3", from openwrt.org.