DHCP not working

Hi everyone.

I have a BT-HH5a as my main gateway on my home network.
I have 3 VLANs setup (IOT, GUEST and LAN):
LAN is VLAN ID 1 (192.168.1.0/24)
GUEST is VLAN ID 10 (192.168.10.0/24)
IOT is VLAN ID 20 (192.168.20.0/24)

When I plug into the HH5a on the LAN ports, I am unable to obtain an IP address through DHCP, I have configured DHCP on all three VLANs. When I set a static IP, I am able to access it normally.

I do not know why DHCP is no longer working. Even if I disable all VLANs and remove all VLAN related configuration, DHCP still is unable to serve IPs. I tried rebooting the router but the same thing occurs.

Config files below:

/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 'fdd2:8a73:3ee9::/48'

config atm-bridge 'atm'
	option encaps 'llc'
	option payload 'bridged'
	option nameprefix 'dsl'
	option vci '38'
	option vpi '0'

config dsl 'dsl'
	option tone 'av'
	option ds_snr_offset '0'
	option annex 'b'
	option xfer_mode 'ptm'
	option line_mode 'vdsl'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	option vlan_filtering '1'

config device
	option name 'lan1'
	option macaddr '40:f2:01:3e:a5:14'

config device
	option name 'lan2'
	option macaddr '40:f2:01:3e:a5:14'

config device
	option name 'lan3'
	option macaddr '40:f2:01:3e:a5:14'

config device
	option name 'lan4'
	option macaddr '40:f2:01:3e:a5:14'

config bridge-vlan
	option device 'br-lan'
	option vlan '1'
	list ports 'lan1:u*'
	list ports 'lan2:u*'
	list ports 'lan3:u*'
	list ports 'lan4:u*'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '20'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '30'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.1.254'
	option ip6assign '60'
	list dns '192.168.1.245'
	option device 'br-lan.1'

config interface 'guest'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.10.254'
	list dns '1.1.1.1'
	list dns '1.0.0.1'
	option device 'br-lan.10'

config interface 'iot'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.20.254'
	list dns '1.1.1.1'
	list dns '1.0.0.1'
	option device 'br-lan.20'

config interface 'vpn'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.30.254'
	list dns '1.1.1.1'
	list dns '1.0.0.1'
	option device 'br-lan.30'

config device
	option name 'dsl0'
	option macaddr '40:f2:01:3e:a5:15'

config interface 'wan'
	option proto 'pppoe'
	option username 'REDACTED'
	option password 'REDACTED'
	option ipv6 'auto'
	option device 'dsl0.101'

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

config device
	option type '8021q'
	option ifname 'dsl0'
	option vid '101'
	option name 'dsl0.101'

/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 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'
	option enable_tftp '1'
	option tftp_root '/tftp'

config boot 'netboot'
	option filename 'netboot.xyz.efi'
	option serveraddress '192.168.1.254'
	option servername 'OpenWrt-HH5A'
	list dhcp_option '209,netboot.xyz.efi'
	option force '1'

config dhcp 'lan'
	option interface 'lan'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option start '64'
	option limit '253'
	list dhcp_option '66,0.0.0.0'
	list dhcp_option '6,192.168.1.245'

config dhcp 'iot'
	option interface 'iot'
	option leasetime '12h'
	option dhcpv4 'server'
	option start '100'
	option limit '253'
	list dhcp_option '6,1.1.1.1'

config dhcp 'vpn'
	option interface 'vpn'
	option leasetime '12h'
	option dhcpv4 'server'
	option start '100'
	option limit '253'
	list dhcp_option '6,1.1.1.1'

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 host
	option name 'Canon-TS3350'
	option mac 'REDACTED'
	option ip '192.168.1.186'
	option dns '1'

config host
	option name 'Tower'
	option dns '1'
	option mac 'REDACTED'
	option ip '192.168.1.220'

config host
	option name 'TL-SG105E'
	option ip '192.168.1.199'
	option mac 'REDACTED'

config host
	option name 'raspberrypi'
	option ip '192.168.1.252'
	option mac 'REDACTED'

config host
	option ip '192.168.1.232'
	option mac 'REDACTED'

config host
	option name 'hue bridge'
	option ip '192.168.20.145'
	option mac 'REDACTED'

Help would be appreciated, thanks!

Ports that connect to ordinary non-vlan aware Ethernet devices need to be untagged and only in one VLAN. This is called an access port.

Also your new lan-like networks need to be placed in a firewall zone. You can start testing by putting them into the lan zone, but eventually you will want to create more restricive zones for guests and IoTs.

1 Like

The issue was with names like "hue bridge" in the static address settings of /etc/config/dhcp causing dnsmasq to not start.

Sat Feb  8 12:15:26 2025 daemon.crit dnsmasq[1]: bad DHCP host name at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Sat Feb  8 12:15:26 2025 daemon.crit dnsmasq[1]: FAILED to start up
Sat Feb  8 12:15:31 2025 daemon.crit dnsmasq[1]: bad DHCP host name at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Sat Feb  8 12:15:31 2025 daemon.crit dnsmasq[1]: FAILED to start up
Sat Feb  8 12:15:36 2025 daemon.crit dnsmasq[1]: bad DHCP host name at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Sat Feb  8 12:15:36 2025 daemon.crit dnsmasq[1]: FAILED to start up
Sat Feb  8 12:15:41 2025 daemon.crit dnsmasq[1]: bad DHCP host name at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Sat Feb  8 12:15:41 2025 daemon.crit dnsmasq[1]: FAILED to start up
Sat Feb  8 12:15:46 2025 daemon.crit dnsmasq[1]: bad DHCP host name at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Sat Feb  8 12:15:46 2025 daemon.crit dnsmasq[1]: FAILED to start up
Sat Feb  8 12:15:51 2025 daemon.crit dnsmasq[1]: bad DHCP host name at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Sat Feb  8 12:15:51 2025 daemon.crit dnsmasq[1]: FAILED to start up
1 Like

On multiple interfaces the option start and option limit are also wrong.
The total of the the two must not exceed 254

2 Likes

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