DHCP not working on WiFi

Today I installed OpenWrt on Linksys MR8300, version
21.02.0-rc3. While DHCP works fine on wired connections, it fails on WiFi. I noticed that in syslog there's this message every time a device asks for an IP:

daemon.warn dnsmasq-dhcp[6593]: DHCP packet received on wlan0 which has no address

This message persists on older versions, even on builds for EA8300. I have checked for similar issues on this forum, but all had some subtle differences, so solutions didn't work for me.

Any ideas? The WiFi is basically unusable as is.

Check out the new stable release when it becomes available.

1 Like

Thanks, will do!

1 Like

This error persists with 21.02.0. My configuration looks like this:

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fdff:ac50:10da::/48'

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

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option device 'eth1'
        option type 'bridge'

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/soc/fe980000.usb/usb1/1-1/1-1:1.0'
        option htmode 'HT20'
        option cell_density '0'
        option channel 'auto'
        option country 'US'

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

I'm using a Raspberry Pi Compute Module 4 in a DFRobot Compute Module 4 IoT Router Carrier Board Mini (try saying that three times fast :slight_smile: ) with a generic Ralink 2800 WiFi dongle plugged into the USB-C host port through an A-to-C adapter. I used the 21.02.0 image builder with these options:

make image PROFILE=rpi-4 PACKAGES="luci kmod-r8169 kmod-usb-dwc2 kmod-rt2800-usb usbutils joe" FILES=files/

kmod-r8169 is for the Realtek NIC on the DFRobot carrier board. kmod-usb-dwc2 and usbutils are to make USB usable. After installation, /boot/config.txt is edited to enable USB (it needs dtoverlay=dwc2,dr_mode=host added). I know the dongle is working to some extent because hitting the "scan" button in LuCI brings up a list of all nearby APs. I can have a phone or a computer try to connect; it'll connect, but fail to get an IP address

Sat Sep 18 20:21:02 2021 daemon.warn dnsmasq-dhcp[1795]: DHCP packet received on wlan0 which has no address

DHCP works fine for wired clients. My longer-term plan is to just add something like a Cisco WAP150 to my network, but I thought I'd try out a USB WiFi dongle in the meantime.

...and I've finally figured it out: eth1 and wlan0 need to be bridged together. This page was the key clue, though the configuration presented there ends up getting rewritten by LuCI to what 21.02.0 expects:

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fdff:ac50:10da::/48'

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

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

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

/etc/config/wireless is unchanged.

I've tested it with both zd1211rw and rt2800usb WiFi dongles, and my phone was able to connect, get an IP address, and get through to the 'net both times.

1 Like

This sounds like a solution for me as well. Will try it out, thanks!