Announcement

Collapse
No announcement yet.

dnsmasq dhcp.leases file

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dnsmasq dhcp.leases file

    for reference.

    # The DHCP server needs somewhere on disk to keep its lease database.
    # This defaults to a sane location, but if you want to change it, use
    # the line below.
    #dhcp-leasefile=/var/lib/misc/dnsmasq.leases

    Here's an live example to
    > illustrate a couple of questions:
    >
    > root at OpenWrt:~# cat /var/dhcp.leases
    > 946689575 00:00:00:00:00:05 192.168.1.155 wdt 01:00:00:00:00:00:05
    > 946689522 00:00:00:00:00:04 192.168.1.237 * 01:00:00:00:00:00:04
    > 946689351 00:0f:b0:3a:b5:0b 192.168.1.208 colinux *
    > 946689493 02:0f:b0:3a:b5:0b 192.168.1.199 * 01:02:0f:b0:3a:b5:0b
    >
    > The second column is obviously the MAC address. What is the last column?
    >
    > What are the asterisks in entries 2 and 4? The first two entries are
    > from the same machine, I simply changed to MAC address from
    > 00:00:00:00:00:04 to 00:00:00:00:00:05 in order to observe the
    > results. I see that the 2nd entry has an asterisk instead of my
    > computer's host name.
    >

    Fields in order.

    1) Time of lease expiry, in epoch time (seconds since 1970). BTW you
    seem to be living in the past: most of us are well past 1000000000
    seconds by now :-) . There are compile time options in dnsmasq which
    convert this field to be remaining lease time (in seconds) or, in the
    most recent releases, total lease renewal time.

    2) MAC address.

    3) IP address.

    4) Computer name, if known. This is always unqualified (no domain part)

    5) Client-ID, if known. The client-ID is used as the computer's
    unique-ID in preference to the MAC address, if it's available. Some DHCP
    clients provide it, and some don't. The ones that do normally derive it
    from the MAC address unless explicity configured, but it could be
    something like a serial number, which would protect a computer from
    losing its identify if the network interface were replaced.

    The order of the lines has no significance, and will change over time.

    The reason that only one of 00:....:04 and 00:...:05 have a name is that
    only one lease can own a name, when 00:...:05 took a lease, claiming to
    be wdt, it stole the name from 00:..:04

    HTH

    Simon.
    If you think I got Grumpy
Working...
X
😀
🥰
🤢
😎
😡
👍
👎