1

I need some suggestion, if possible, about a dhcp server and ip address reservation.

The system is a Ubuntu server 12.04 LTS. The DHCP is ISC DHCPd version 4.1.

This is the /etc/dhcp/dhcpd.conf file:

ddns-update-style interim;
log-facility local7;
subnet 100.1.1.0 netmask 255.255.255.0 {
        option ntp-servers ntp1.inrim.it;
        authoritative;
        option domain-name-servers 100.1.1.120 , 100.1.1.130;
        option domain-name "domain.local";
        option subnet-mask 255.255.255.0;
        option routers 100.1.1.120;
        max-lease-time 7200;
        default-lease-time 600;
        range 100.1.1.150 100.1.1.170;
        # NEXUS_5
        host android-72c7a71611f38b65 {
                hardware ethernet CC:FA:00:E8:7E:37;
                fixed-address 100.1.1.250;
                }
        }

and this is the syslog when my nexus connec to the LAN and get an ip address:

Jun 19 17:50:22 gate dhcpd: Unable to add forward map from android-72c7a71611f38b65.jodovit.local to 100.1.1.162: timed out
Jun 19 17:50:22 gate dhcpd: DHCPREQUEST for 100.1.1.162 from cc:fa:00:e8:7e:37 (android-72c7a71611f38b65) via eth1
Jun 19 17:50:22 gate dhcpd: DHCPACK on 100.1.1.162 to cc:fa:00:e8:7e:37 (android-72c7a71611f38b65) via eth1

As you can see.. My nexus take ip 100.1.1.162 and not 100.1.1.250 as in config file...

Could someone explain me better hoe reservation work??

Thank's and sorry for my english...

Luca

===================================================================================

After @Andrew suggestion, i move the host declaration outside the subnet declaration. Reboot the service and try to connect with my Nexus, but the ip is taken from DHCP pool and not from the reservation ip.

The result of dhcpdump is :

  TIME: 2014-06-20 08:31:40.706
    IP: 0.0.0.0 (cc:fa:0:e8:7e:37) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 09ae4197
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: cc:fa:00:e8:7e:37:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  61 (  7) Client-identifier         01:cc:fa:00:e8:7e:37
OPTION:  50 (  4) Request IP address        100.1.1.162
OPTION:  57 (  2) Maximum DHCP message size 1500
OPTION:  60 ( 12) Vendor class identifier   dhcpcd-5.5.6
OPTION:  12 ( 24) Host name                 android-72c7a71611f38b65
OPTION:  55 ( 10) Parameter Request List      1 (Subnet mask)
                                             33 (Static route)
                                              3 (Routers)
                                              6 (DNS server)
                                             15 (Domainname)
                                             26 (Interface MTU)
                                             28 (Broadcast address)
                                             51 (IP address leasetime)
                                             58 (T1)
                                             59 (T2)

---------------------------------------------------------------------------

  TIME: 2014-06-20 08:31:40.710
    IP: 100.1.1.120 (0:50:56:a5:eb:ed) > 100.1.1.162 (cc:fa:0:e8:7e:37)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 09ae4197
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 100.1.1.162
SIADDR: 100.1.1.120
GIADDR: 0.0.0.0
CHADDR: cc:fa:00:e8:7e:37:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         100.1.1.120
OPTION:  51 (  4) IP address leasetime      600 (10m)
OPTION:   1 (  4) Subnet mask               255.255.255.0
OPTION:   3 (  4) Routers                   100.1.1.120
OPTION:   6 (  8) DNS server                100.1.1.120,100.1.1.130
OPTION:  15 ( 13) Domainname                jodovit.local
OPTION:  58 (  4) T1                        300 (5m)
OPTION:  59 (  4) T2                        525 (8m45s)
---------------------------------------------------------------------------
Giacall99
  • 11
  • 3

1 Answers1

0

I think that this may be a scoping issue. I'd suggest moving the host declaration outside of the subnet declaration.

DHCPd will first look for a host declaration and then determine which subnet the host belongs to based on the assigned fixed IP address.

If you want to trace the DHCP conversation, the dhcpdump package is incredibly useful.

Example:

ddns-update-style interim;
log-facility local7;
subnet 100.1.1.0 netmask 255.255.255.0 {
    option ntp-servers ntp1.inrim.it;
    authoritative;
    [... snip ...]
    range 100.1.1.150 100.1.1.170;
}

host android-72c7a71611f38b65 {
    hardware ethernet CC:FA:00:E8:7E:37;
    fixed-address 100.1.1.250;
}
Andrew
  • 81
  • 3
  • Mhh.. I try to move the host declaration outside the subnet declaration as you suggest... Reboot the service, but nothing change. The dhcpdump result is in the edit of my forst message... – Giacall99 Jun 20 '14 at 06:34