Hi. I have APs configured with subnets and VLANs, with their network interfaces configured as DHCP clients, and with the router configured with static leases. The problem is that the router "Active DHCP Leases" UI seems to show the "wrong" DNS hostname for the AP.
Details:
I have some APs configured with bridge and 802.1q devices, where the interface is configured as a DHCP client, sending along a hostname specific to that interface (a VLAN):
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
option metric '10'
config interface 'lan1'
option device 'br-lan1'
option proto 'dhcp'
option metric '11'
option hostname 'livap11'
config interface 'lan2'
option device 'br-lan2'
option proto 'dhcp'
option metric '12'
option hostname 'livap12'
config interface 'lan3'
option device 'br-lan3'
option proto 'dhcp'
option metric '13'
option hostname 'livap13'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'wan'
config device
option name 'br-lan1'
option type 'bridge'
list ports 'br-lan.3'
config device
option name 'br-lan2'
option type 'bridge'
list ports 'br-lan.4'
list ports 'lan3'
list ports 'lan4'
config device
option name 'br-lan3'
option type 'bridge'
list ports 'br-lan.5'
config device
option name 'br-lan.3'
option type '8021q'
option ifname 'br-lan'
option vid '3'
config device
option name 'br-lan.4'
option type '8021q'
option ifname 'br-lan'
option vid '4'
config device
option name 'br-lan.5'
option type '8021q'
option ifname 'br-lan'
option vid '5'
The router is configured with static leases for the AP's interfaces:
config dhcp 'lan'
option interface 'lan'
option leasetime '1h'
option start '100'
option limit '150'
list dhcp_option 'option:domain-search,mydomain'
list dhcp_option 'option:dns-server,192.168.10.1'
list dhcp_option 'option:ntp-server,0.0.0.0'
config dhcp 'lan1'
option interface 'lan1'
option leasetime '1h'
option start '100'
option limit '150'
list dhcp_option 'option:domain-search,mydomain'
list dhcp_option 'option:dns-server,192.168.10.1'
list dhcp_option 'option:ntp-server,0.0.0.0'
config dhcp 'lan2'
option interface 'lan2'
option leasetime '1h'
option start '100'
option limit '150'
list dhcp_option 'option:domain-search,mydomain'
list dhcp_option 'option:dns-server,192.168.10.1'
list dhcp_option 'option:ntp-server,0.0.0.0'
config dhcp 'lan3'
option interface 'lan3'
option leasetime '1h'
option start '100'
option limit '150'
list dhcp_option 'option:domain-search,mydomain'
list dhcp_option 'option:dns-server,192.168.10.1'
list dhcp_option 'option:ntp-server,0.0.0.0'
config host
option mac 'AA:BB:CC:DD:EE:FF'
option name 'livap'
option dns '1'
option ip '192.168.10.7'
option leasetime '4h'
config host
option mac 'AA:BB:CC:DD:EE:FF'
option name 'livap11'
option dns '1'
option ip '192.168.11.7'
option leasetime '4h'
config host
option mac 'AA:BB:CC:DD:EE:FF'
option name 'livap12'
option dns '1'
option ip '192.168.12.7'
option leasetime '4h'
config host
option mac 'AA:BB:CC:DD:EE:FF'
option name 'livap13'
option dns '1'
option ip '192.168.13.7'
option leasetime '4h'
This seems to be working; I can resolve names and addresses forwards and backwards for the different AP interfaces.
The problem I am trying to solve is that the router's "Active DHCP Leases" page shows the "wrong" hostname (the hostname supplied by the AP on that interface is correct, but the UI is showing the DNS name for a different interface on that AP, presumably getting confused by the same MAC address on all interfaces):
livap11 (livap13.mydomain) 192.168.11.7 AA:BB:CC:DD:EE:FF 3h 6m 15s
I have tried:
- Changing the DHCP configuration to only assign a hostname for the "primary" IP address, and using DHCP domains to assign hostnames for the other IP addresses (hoping to associate the MAC address with only the "primary" IP address and hostname). This did not seem to work; the UI still shows the "wrong" DNS hostname.
- Setting the MAC address of each bridge and VLAN device to a different unique value, and making the appropriate changes at the router. This seems to work, since there is no longer any "collisions" on the MAC address across subnets/VLANs.
Some questions:
- How is the hostname getting displayed in the router "Active DHCP Leases" web UI? Is this provided by the router, or is this a client-side browser thing?
- Is there a better way than changing all the MAC addresses everywhere? I have multiple APs (each with multiple devices and VLANs), so this would be error-prone
I thought maybe I could use the dnsmasq id
feature (instead of MAC address), but there doesn't seem to be a UCI way to configure the dhcp host entry in this way (it seems to only support the mac
address).
Thank you.