Why would the wireless interface break DHCP?

I have a simple new OpenWRT setup with a main wifi network at a guest wifi network setup through LuCI (following instructions in a YouTube video). It worked great for a few months, then this morning the guest wifi stopped allowing devices to get an IP address and the log shows this:

daemon.warn dnsmasq-dhcp[1]: no address range available for DHCP request via phy0-ap1

The main wifi network still works fine. I tried creating a new Network Interface, but it still had the same issue. It wasn't until I created a new Wireless network that the issue went away. (Specifically it seems the 802.11ac/n wireless network was the issue.) The settings of the old and new Wireless network appear the identical in LuCI.

Is there a logical reason why a Wireless network setup would start causing a DHCP issue?

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Hopefully you did not delete the previous wi-fi setup and we can see what did happen.

The previous Wireless network is still there, it's just disabled. It's "house2".

root@OpenWrt:~# ubus call system board
{
        "kernel": "5.15.134",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "TP-Link Archer A7 v5",
        "board_name": "tplink,archer-a7-v5",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.0",
                "revision": "r23497-6637af95aa",
                "target": "ath79/generic",
                "description": "OpenWrt 23.05.0 r23497-6637af95aa"
        }
}

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'
        option ula_prefix 'fd99:a160:d4f1::/48'

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

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.86.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'eth0.2'
        option macaddr '[redacted]'

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

config interface 'wan6'
        option device 'eth0.2'
        option proto 'dhcpv6'

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 4 5 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 0t'

config interface 'guest'
        option proto 'static'
        list dns '8.8.8.8'
        list dns '1.1.1.1'
        list ipaddr '192.168.3.1'

config interface 'guest2'
        option proto 'static'
        option ipaddr '192.168.3.1'
        list dns '8.8.8.8'
        list dns '1.1.1.1'
        option netmask '255.255.255.0'

config interface 'guest3'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        list dns '1.1.1.1'
        list dns '8.8.8.8'

root@OpenWrt:~# cat /etc/config/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 cell_density '0'
        option country 'US'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'house-priv'
        option encryption 'psk2'
        option key '[redacted].'

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

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'house-priv'
        option encryption 'psk2'
        option key '[redacted]'

config wifi-iface 'wifinet3'
        option device 'radio0'
        option mode 'ap'
        option ssid 'house3'
        option encryption 'psk2'
        option key '[redacted]'
        option network 'guest3'
        option disabled '1'

config wifi-iface 'wifinet4'
        option device 'radio1'
        option mode 'ap'
        option ssid 'house2'
        option encryption 'psk2'
        option key '[redacted]'
        option network 'guest3'
        option hidden '1'

config wifi-iface 'wifinet5'
        option device 'radio1'
        option mode 'ap'
        option ssid 'CenturyLink5'
        option encryption 'psk2'
        option key '[redacted]'
        option network 'guest3'
        option disabled '1'

config wifi-iface 'wifinet6'
        option device 'radio0'
        option mode 'ap'
        option ssid 'house2'
        option encryption 'psk2'
        option key '[redacted]'
        option network 'guest3'
        option disabled '1'

config wifi-iface 'wifinet7'
        option device 'radio0'
        option mode 'ap'
        option ssid 'house'
        option encryption 'psk2'
        option key '[redacted]'
        option network 'guest3'

config wifi-iface 'wifinet8'
        option device 'radio1'
        option mode 'ap'
        option ssid 'house'
        option encryption 'psk2'
        option key '[redacted]'
        option network 'guest3'

root@OpenWrt:~# cat /etc/config/dhcp

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'

config dhcp 'lan'
        option interface 'lan'
        option start '90'
        option limit '160'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        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'

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

config dhcp 'guest2'
        option interface 'guest2'
        option start '100'
        option limit '150'
        option leasetime '12h'

config dhcp 'guest3'
        option interface 'guest3'
        option start '100'
        option limit '150'
        option leasetime '12h'

Your first guest network is lacking a subnet mask. The guest2 network is overlapping with guest -- it must be a different subnet.

Your guest3 network is the only one that is associated with wireless SSIDs. However, you've got more than one SSID associated with the guest3 network, so you must have a bridge defined (which you do not have currently). The requirement to use a bridge will be true for any network that will connect to more than one radio and/or radio+ethernet or multiple ethernet ports.

4 Likes

Thanks for the reply. I think that first part about guest is probably not the original issue. When the issue started, I hadn't yet created guest2 or guest3, and it did have a subnet mask of 255.255.255.0 before I started messing with the settings to try to fix the issue.

But the bridge thing sounds like a possible thing I need to do. But is there a reason why it worked for months and then suddenly stopped working? Possibly a device connected to the other wifi radio for the first time (802ac/n vs 80211b/g/n)?

I setup the guest wifi network following https://www.youtube.com/watch?v=rwW8KUkIoTw. Is there supposed to be a step to setup a bridge? I have no idea how to do that.

It did not have a conflict until then; and then it broke.

Sounds like a conflict.

FIx what you can of what @psherman suggested and then

again and past here.

config device
    option name 'br-guest'
    option type 'bridge'

config interface 'guest'
    option device 'br-guest'
    option proto 'static'
    ... more options

Notice this is exactly like the default configuration with br-lan however no Ethernet ports are (yet) included in br-guest. Whenever a wifi AP is attached with option network guest, it will then be included in br-guest. You can confirm that with the command brctl show which shows the running bridges and their members.

1 Like

If they look in Network/Interfaces in LuCI it will show, with icons, what device is in what interface.

It is easier to visualize when first using OpenWrt.

Well you have to.
The image translators work for the construct program but there's way too much information to decode the matrix.
You get used to it I I don't even see the code; all I see is blonde, brunette redhead.

-Cypher-

1 Like

Even if it wasn't part of the original issue, it does need to be fixed. I'm honestly not sure what size network results if a subnet mask (or CIDR value) is not declared -- it might be a /32, but it also could be larger or just simply will cause an error.

That's possible... it's hard to know the circumstances, but a bridge is required if more than one physical interface is linked to your network interface.

1 Like

Ok, yeah after doing some more experimenting, it's pretty clear that the issue was having more than one wireless interface associated with a network interface without having a bridge. I was able to reproduce the issue any time I had more than one wireless network using the same network interface.

There are tutorials like https://openwrt.org/docs/guide-user/network/wifi/guestwifi/configuration_webinterface that show how to create a guest wifi network, but only on one wireless network. I guess there isn't a LuCI tutorial showing how to have both 802.11bgn and 802.11an on a guest network with a bridge.

Yeah, that guide could use to be updated. I actually don't like that it creates the wifi SSID first -- personally, I prefer to create the bridge, then the network interface, dhcp server, and firewall configs, then add the SSID and associate it with the network.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.