Modify

Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#11928 closed enhancement (fixed)

dhcp: configuring static leases without MAC address

Reported by: 70d7a4f46 <v.ovcacik@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: other Version: Trunk
Keywords: dnsmasq, lease, mac Cc:

Description

Hi, currently we are forced to configure static lease with MAC address:

config 'host'
	option 'name' 'pc'
	option 'mac' '11:22:33:44:55:66'
	option 'ip' '192.168.1.2'

That resolves to

dhcp-host=11:22:33:44:55:66,pc,192.168.1.2

However dnsmasq does not require the MAC address. If it is omitted, IP address is assigned not by MAC address of DHCP client, but by name that the client specified in its DHCP request. Such a config would look like:

config 'host'
	option 'name' 'pc'
	option 'ip' '192.168.1.2'

That resolves to

dhcp-host=pc,192.168.1.2

Attachments (1)

dhcp-host.patch (825 bytes) - added by nlh 4 years ago.
Support for --dhcp-host option w/o MAC Address

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by maniqui@…

I'd like to vote for this enhancement. I was able to do static leases by hostname (instead of MAC address) using dnsmasq on DD-WRT, where I had to explicitly pass the dhcp-host option, as OP mentions.
I think this provides some flexibility on simple SOHO setups where a client could connect to the network, alternating, sometimes via ethernet, sometimes via wireless. Thus, this enhancement will allow the option of providing the same IP address to a client, disregarding if it got connected via ethernet or wireless.

comment:2 Changed 4 years ago by maniqui@…

I'd like to vote for this enhancement. I was able to do static leases by hostname (instead of MAC address) using dnsmasq on DD-WRT, where I had to explicitly pass the dhcp-host option, as OP mentions.
I think this provides some flexibility on simple SOHO setups where a client could connect to the network, alternating, sometimes via ethernet, sometimes via wireless. Thus, this enhancement will allow the option of providing the same IP address to a client, disregarding if it got connected via ethernet or wireless.

Changed 4 years ago by nlh

Support for --dhcp-host option w/o MAC Address

comment:3 Changed 4 years ago by nlh

I had a need for this for a device (cell phone) that used a random MAC address (patch attached). I think the case of a device with two interfaces (wired and wireless) is already handled, you just need to specify both MAC addresses for the host (e.g., option 'mac' 'xx:xx:xx:xx:xx:xx yy:yy:yy:yy:yy:yy').

comment:4 Changed 4 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

comment:5 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.