I am trying to use a dedicated OpenWrt device as a standalone DHCP server as my ISP's router has limited functionalities.
I have set it up as described here.
Everything seems to work pretty good except that wireless devices only receive an IPv6 address, while wired devices can receive both IPv4 and IPv6 addresses.
BusyBox v1.36.1 (2024-09-23 12:34:46 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 23.05.5, r24106-10cc5fcd00
-----------------------------------------------------
root@EX7300v2-OpenWrt:~# uci export network
package 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 'fd3c:6ced:effd::/48'
config interface 'lan1'
option proto 'static'
option device 'eth0'
option ipaddr '192.168.2.2'
option netmask '255.255.255.0'
option gateway '192.168.2.1'
list dns '192.168.2.1'
option broadcast '192.168.2.255'
option delegate '0'
option ip6assign '60'
config device
option name 'eth0'
option ipv6 '1'
root@EX7300v2-OpenWrt:~# uci export wireless
package wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0'
option channel '36'
option band '5g'
option htmode 'VHT80'
option disabled '1'
root@EX7300v2-OpenWrt:~# uci export dhcp
package 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 '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'
config dhcp 'lan1'
option interface 'lan1'
option start '100'
option limit '150'
option leasetime '12h'
list dhcp_option '3,192.168.2.1'
list dhcp_option '6,192.168.2.1'
option ra 'hybrid'
option dhcpv6 'hybrid'
root@EX7300v2-OpenWrt:~# brctl show
Additional info:
The openwrt DHCP device is a Netgear EX7300v2. I disabled the wireless radio and replaced the eth0/radio0 bridge with a simple interface "lan1" over eth0 device (the device has only 1 ethernet port). Even before removing the bridge, I had the same issue with DHCP.
The upstream ISP router is a Nokia 5G gateway at 192.168.2.1, with both DHCP v4 and v6 disabled. The EX7300v2 has a wired connection to one of the Nokia's LAN ports.
All looks good on OpenWrt side, so I am suspecting some security function on the Nokia router to block rogue DHCP servers. Why it happens to wireless clients only you may ask. Well because the ethernet clients communicate with OpenWrt via the built in switch where there is no control, however the ethernet to wifi packets go through the cpu of the router.
Well, it appears that the wireless clients are connected to the ISP router.
I don't know anything about the Nokia device, but my first guess would be that the DHCP Discover (broadcast) messages are not being forwarded from the wireless to the wired interface. You could check this using tcpdump.
As for IPv6, wireless clients probably use an autoconfiguration technique (if ICMPv6 traffic is forwarded to the wired port or Nokia itself sends RA messages).
A poor workaround I see is to set a small (non-overlapping) range for wireless clients on the Nokia gateway. However, there is no guarantee that IP addresses will not be assigned by the Nokia to wired clients as well (unless you set static leases).
Many thanks to you both for looking into it and providing feedback. I was also suspecting that the ISP gateway Wifi==>LAN could cause some problems.
I can also try using another cascading device behind the ISP router (and only use the ISP one as a modem), hoping that it will handle this scenario better. Unfortunately, the only other device I have handy are a set of Netgear Orbi RBR50 & 2 RBS50 but they are v2 and not v1 and apparently they are not supported by OpenWrt so I'll have little control over how they behave.