As a special case, it is possible to include more than one hardware address. eg: --dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.2 This allows an IP address to be associated with multiple hardware addresses, and gives dnsmasq permission to abandon a DHCP lease to one of the hardware addresses when another one asks for a lease. Beware that this is a dangerous thing to do, it will only work reliably if only one of the hardware addresses is active at any time and there is no way for dnsmasq to enforce this. It is, for instance, useful to allocate a stable IP address to a laptop which has both wired and wireless interfaces.
As the documentation suggests, I am trying to setup a laptop that has both a wired and wireless connection to obtain the same IP address whether connected wirelessly or via CAT5e and according to the DNSMasq documentation what I’ve done should work. The ‘address=’ line in the DNSMasq section of the GUI Admin Console, should allow me to refer to the laptop by either it’s netbios name [cnd0450dmy] or by a more friendly alias for the laptop [STMP-Laptop]
Since I am posting this here it obviously is not working for me. My /etc/dnsmasq.conf file ends up looking like this..
It’s inserting the ‘address=’ option which it got from the GUI Console but not the ‘dhcp-host=’ option. So the syntax or formatting must be wrong [user error]…. Or is this really some kind of bug?
DD-WRT has an old version of DNSMasq because they removed a feature DD-WRT needs. The version in DD-WRT doesn't support multiple MAC's sharing a static lease.
Also you're inserting your DNSMasq "dhcp-host" option into the "Additional DHCPd" options for udhcpd which is the alternate DHCP server when you have "Use DNSMasq for DHCP" disabled in basic setup. _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
1 - There are two DHCP Daemons. DNSMasq and 'udhcpd'.
2 - udhcpd is disabled whenever DNSMasq is enabled. <-- This is the configuration I have.
3 - I am entering DNSMasq's options [dhcp-host] into udhcpd fields in the UI.
If these three points are correct then how come the static leases are enforced when I use the UI to enter them in the udhcpd [add/remove] fields provided for them?
In other words, with DNSMasq ENABLED, I can go to the section that you've said is only for the uDHCPd and use the Add-Remove buttons to manually enter the mac address, hostname, ip address, and lease time for each host I want to assign a static address to...AND IT WORKS.
Additionally, if I enter a 'dhcp-host' option with only ONE mac address per IP Address [same as using the Add-Remove buttons] in the field that you have designated is only for uDHCPd, it also works and appears correctly in the /tmp/dnsmasq.conf
I'm probably wrong about that second part but multiple MAC's per static lease (dhcp-host) is definitely not supported with the old version of DNSMasq included in DD-WRT. Multiple MAC's is a newer option and so is the similar option to assign a lease based on hostname. _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Sorry, I know this thread is ancient but this is exactly what I'm trying to figure out how to do!
I have a few devices with both a wireless and wired interface and I would like the hostname to point to the active interface, or the preferred interface if both are active (probably the wired one but who knows).
Does the current version of dd-wrt have the version of dnsmasq that supports this? Or is there another way to do this in dd-wrt? Or do I have to setup another DHCP/DNS server somewhere else?
Thanks _________________ Headed for the second star to the right and straight on 'til morning...
Joined: 08 May 2018 Posts: 15252 Location: Texas, USA
Posted: Fri Sep 06, 2024 3:11 Post subject:
Only way to know is to try the Additional Config box to enter the information. Only one MAC address is supported in the webUI static leases entries AFAIK. _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Joined: 16 Nov 2015 Posts: 6706 Location: UK, London, just across the river..
Posted: Fri Sep 06, 2024 6:38 Post subject:
schultzter wrote:
Sorry, I know this thread is ancient but this is exactly what I'm trying to figure out how to do!
I have a few devices with both a wireless and wired interface and I would like the hostname to point to the active interface, or the preferred interface if both are active (probably the wired one but who knows).
Does the current version of dd-wrt have the version of dnsmasq that supports this? Or is there another way to do this in dd-wrt? Or do I have to setup another DHCP/DNS server somewhere else?
Thanks
You as KP-69 advised, do not use the static DHCP/MAC box's but use/add the line in advanced DNSmasq config box
"As a special case, in DHCPv4, it is possible to include more than one hardware address. eg: --dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.2 This allows an IP address to be associated with multiple hardware addresses, and gives dnsmasq permission to abandon a DHCP lease to one of the hardware addresses when another one asks for a lease. Beware that this is a dangerous thing to do, it will only work reliably if only one of the hardware addresses is active at any time and there is no way for dnsmasq to enforce this. It is, for instance, useful to allocate a stable IP address to a laptop which has both wired and wireless interfaces. " _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 58184 WAP
TP-Link WR1043NDv2 -DD-WRT 58730 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 58785 Gateway/DoT,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 58785 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 58689 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Dynalink DL-WRX36-DDWRT 58785
Broadcom
Netgear R7000 --DD-WRT 58627 Gateway/SmartDNS/DoT,AD-Block,IPsetFirewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913