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.
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 ) 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.
I just came across this thread as am having problems setting up WiFi under OpenWrt.
My situation is that I am trying to access the Internet via WiFi, and am trying to figure out how to assign an IP address to the WiFi intereface via DHCP from my broadband router. I do not have a wired connection to it. In addition I am unable to use the webgui for configuring OpenWrt.
This is the first time I have tried to configure WiFi under OpenWrt and it is proving quite difficult. I have got as far as activating WiFi although I'm still not sure of the required steps, but getting an IP address assigned is proving difficult.