Opened 7 years ago

Closed 7 years ago

Last modified 2 years ago

#6426 closed defect (fixed)

dhcp: configuring static leases

Reported by: tscharlii@… Owned by:
Priority: normal Milestone: Barrier Breaker 14.07
Component: documentation Version: Kamikaze 8.09
Keywords: Cc:


The documentation at explains static leases with the following example:


config host mypc
        option ip       ''
        option mac      '00:11:22:33:44:55'

This didn't work for me. After having a look at /etc/init.d/dnsmasq and changing it to

config host
        option name     mypc
        option ip       ''
        option mac      '00:11:22:33:44:55'

dnsmasq is executed with the appropriate --dhcp-host options.
I'm running kamikaze 8.09.2-RC2

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by MichaelPloujnikov <ploujj@…>

I fixed this by making this hacky change thanks to cshore:

$ svn diff package/dnsmasq/files/dnsmasq.init
Index: package/dnsmasq/files/dnsmasq.init
--- package/dnsmasq/files/dnsmasq.init	(revision 19014)
+++ package/dnsmasq/files/dnsmasq.init	(working copy)
@@ -173,6 +173,9 @@
 	config_get name "$cfg" name
 	[ -n "$name" ] && dhcp_option_add "$cfg" "$name"
+	config_get hostname "$cfg" hostname
+	[ -n "$hostname" ] || return 0
 	config_get mac "$cfg" mac
 	[ -n "$mac" ] || return 0
@@ -180,7 +183,7 @@
 	config_get ip "$cfg" ip
 	[ -n "$ip" ] || return 0
-	append args "--dhcp-host=$mac,${name:+net:$name,}$ip"
+	append args "--dhcp-host=$mac,$hostname,${name:+net:$name,}$ip"
 dhcp_mac_add() {

Apparently, this is the more appropriate way: #5017.

comment:2 Changed 7 years ago by MichaelPloujnikov <ploujj@…>

For completeness, I'll mention that I had to change all host entries in /etc/config/dhcp to use "option hostname":

config host
    option hostname <name>
    option ip <ip>
    option mac <mac>

comment:3 Changed 7 years ago by jow

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

documented behaviour restored in r19069

comment:4 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

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

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

Note: See TracTickets for help on using tickets.