3

I have this DHCP conf file:

authoritative;
option domain-name "XXX.XXX.XX";
allow bootp;
ddns-update-style ad-hoc;
class "karpuz-kabugu"
{
    match if (substring (option user-class, 0, 6) = "karpuz");
    log (info, "karpuz-kabugu");
}
        subnet 10.6.1.0 netmask 255.255.255.0  {
                pool {
                        range 10.6.1.10 10.6.1.99;
                        allow members of "karpuz-kabugu";
                }

                pool {
                        range 10.6.1.100 10.6.1.250;
                        allow unknown-clients;
                }

                option broadcast-address 10.6.1.255;
                option routers 10.6.1.1;

}

What I want to do is lease ip addresses according to user-class (option 77). I have set the user class id on my Windows DHCP client using ipconfig /setclassid

I also see karpuz set in DHCP Option 77 using wireshark.

The contents of the dhcp log is as the following:

May 27 17:09:18 2013 dhcpd: karpuz-kabugu
May 27 17:09:18 2013 dhcpd: DHCPDISCOVER from 00:1c:23:b5:da:71 via eth4
May 27 17:09:19 2013 dhcpd: DHCPOFFER on 10.6.1.250 to 00:1c:23:b5:da:71 (DELL1-DESTEK) via eth4
May 27 17:09:19 2013 dhcpd: karpuz-kabugu
May 27 17:09:19 2013 dhcpd: if DELL1-DESTEK.meb.gov.tr IN A rrset doesn\'t exist add DELL1-DESTEK.meb.gov.tr 21600 IN A 10.6.1.250: timed out.
May 27 17:09:19 2013 dhcpd: DHCPREQUEST for 10.6.1.250 (10.6.1.1) from 00:1c:23:b5:da:71 (DELL1-DESTEK) via eth4
May 27 17:09:19 2013 dhcpd: DHCPACK on 10.6.1.250 to 00:1c:23:b5:da:71 (DELL1-DESTEK) via eth4
May 27 17:09:22 2013 dhcpd: karpuz-kabugu
May 27 17:09:22 2013 dhcpd: DHCPINFORM from 10.6.1.250 via eth4
May 27 17:09:22 2013 dhcpd: DHCPACK to 10.6.1.250 (00:1c:23:b5:da:71) via eth4

As you can see, my client is assigned with 10.6.1.250 however I am expecting an IP address between 10.6.1.10 and 10.6.1.99

What am I doing wrong?

Alptugay
  • 211
  • 3
  • 8

1 Answers1

1

Dhcp statement allow unknow-clients, as sated in man pages only allows to get an IP address from clients, who do not have a host declaration in config. And this is by default. So, my guess is to first remove such statement from pool declaration. And, second, try to add deny statemnt to that pool. Your pool config should be like this:

pool {
        range 10.6.1.10 10.6.1.99;
        allow members of "karpuz-kabugu";
      }

pool {
        range 10.6.1.100 10.6.1.250;
        deny members of "karpuz-kabugu";
     }
halt
  • 106
  • 7