Problem with DHCP and wireless

Hello,

After reinstalling my OpenWrt, it's behaving strangely. I have dozens of devices connected but I can't see them in the DHCP lease. I can't assign them fixed addresses either. All devices are connected to WiFi and are working.

There's something weird going on.

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 'fd35:8558:464f::/48'

config interface 'wan'
        option device 'VLAN.25'
        option proto 'dhcp'
        option peerdns '0'
        list dns '208.67.222.222'
        list dns '208.67.220.220'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config device
        option name 'wan'

config device
        option type '8021q'
        option ifname 'wan'
        option vid '1'
        option name 'VLAN.1'

config device
        option type '8021q'
        option ifname 'wan'
        option vid '25'
        option name 'VLAN.25'

config device
        option type '8021q'
        option ifname 'wan'
        option vid '66'
        option name 'VLAN.66'

config interface 'HOME'
        option proto 'static'
        option device 'HOME'
        option ipaddr '10.0.1.254'
        option netmask '255.255.255.0'
        option type 'bridge'
        option gateway '10.0.6.254'

config device
        option type 'bridge'
        option name 'HOME'
        list ports 'VLAN.1'

config device
        option type 'bridge'
        option name 'IoT'
        list ports 'VLAN.66'

config interface 'IoT'
        option proto 'static'
        option device 'IoT'
        option ipaddr '10.0.2.254'
        option netmask '255.255.255.0'
        option gateway '10.0.6.254'

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 'home'
        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'
        list address '/ntp.home/10.0.0.254'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'
        option start '100'
        option limit '150'
        option leasetime '12h'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config dhcp 'HOME'
        option interface 'HOME'
        option start '1'
        option limit '253'
        option leasetime '24h'

config dhcp 'IoT'
        option interface 'IoT'
        option start '1'
        option limit '253'
        option leasetime '48h'

config host
        option name 'ONEPLUS95GHZ'
        option mac 'EA:CB:5F:11:12:5B'
        option ip '10.0.1.201'

config domain
        option name 'ONEPLUS95GHZ'
        option ip '10.0.1.201'

config host
        option name 'ONEPLUS9-IOT'
        option mac '12:C7:CF:40:F3:99'
        option ip '10.0.2.18'

config host
        option name 'ONEPLUS9'
        option mac '96:0D:CF:78:B7:2C'
        option ip '10.0.1.101'

config host
        option name 'PRISE-ENCEINTES'
        option mac 'CC:32:E5:E6:78:3C'
        option ip '10.0.2.49'



There are a lot of issues in this configuration.

What is the device and OpenWrt version?

ubus call system board

It's a belkin 3200

root@OPENWRT:~# ubus call system board
{
        "kernel": "5.15.137",
        "hostname": "OPENWRT",
        "system": "ARMv8 Processor rev 4",
        "model": "Linksys E8450 (UBI)",
        "board_name": "linksys,e8450-ubi",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "mediatek/mt7622",
                "description": "OpenWrt 23.05.2 r23630-842932a63d"
        }
}

I have a router with OPNsense and this device as wifi

so this is intended to be a dumb AP? And the pf sense router has all the networks (and dhcp servers) already configured there?

If so, reset this device to defaults.
Then provide the following:

  1. What physical port on the Linksys device is used to uplink to the router?
  2. Is that a direct connection, or is there a switch between the router and the AP? If there is a switch, what is the brand + model?
  3. What VLANs are defined on the router that need to be implemented on the AP?
  4. Are any of the networks untagged on the trunk?
  5. What is the VLAN ID and the desired address of the AP itself (what is it's management network).

Then, post your default /etc/config/network file and we can help from there.

My router is connect on the wan of my openwrt.

It's a direct connexion. I have on the wan port 3 VLAN :

  • 1 for wifi "HOME" with 10.0.1.0 - HOME INTERFACE
  • 25 (to manage openwrt) 10.0.6.3 - WAN INTERFACE
  • and 66 for one other wifi (iot) 10.0.2.0 - IOT INTERFACE

I want manage all with OPNsense but I don't know if its possible (about DHCP for example and static lease).

Thanks for your reply.

Edit : Oh my router give the DHCP! I can see leases on my OPNSENSE!

So, how can I clean my openwrt ?

You should configure your OPNsense box first. It is absolutely possible to do this, but the OPNsense configuration is OT and out of scope for this forum. Once you have that all configured, we can help you get the VLANs working with your OpenWrt device.

All it's ok, I have DHCP on my router and it's work.

I will manage firewall with my router, what I need to do with the openwrt firewall (I can't disable it ) ?

Leave it enabled -- there is no need to disable the firewall. And DHCP should be explicitly disabled via the config file (dnsmasq can then remain enabled).

Please reset your OpenWrt AP to defaults and post the network config... this way we have a fresh slate to work with.

Just in general, avoid upper case, special characters or long names for hostname, interface names or firewall zones.

1 Like

I have another question :

Each interface needs an IP address, which my router provides. Is this address solely for connecting to the OpenWrt interface? I presume it's mandatory?