3

basically I would like to achieve the followings:

  1. using only one subnet
  2. different types of user sharing this subnets
  3. creating 2 pools accordingly
  4. an user class called "l2vpn_user" if matched by MAC address then will be assign a different bootfile
  5. the rest of user will be directed to load 'default' bootfile

Problem with the dhcpd.conf I used is that all user can get IP address but all fall into pool for unknown-clients.

#some server default values
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;       

#default network declaration
subnet 172.0.7.0 netmask 255.255.255.0
{}

#class declaration
class "l2vpn_user" 
{
  match pick-first-value (option dhcp-client-identifier, hardware);
  option bootfile-name "CH6541E-VLAN181_new1.cfg";
  filename "CH6541E-VLAN181_new1.cfg";
}

#manually assigning 3 subclasses
subclass "l2vpn_user" 1:00:22:68:f2:e0:e2;
subclass "l2vpn_user" 1:00:22:68:f2:e1:c2;
subclass "l2vpn_user" 1:00:22:68:f2:e3:96;

#main subnet declaration
subnet 10.161.255.0 netmask 255.255.255.0
{
    option routers 10.161.255.1;
    next-server 192.168.11.245;
    allow leasequery;
    max-lease-time 300;
    option bootfile-name "160basic_max_snmp.bin";
    filename "160basic_max_snmp.bin";
    option time-servers 172.0.7.52;

#2 pools, l2vpn user for the first pool
    pool {
        range 10.161.255.2 10.161.255.200;
        allow members of "l2vpn_user";
        }

#The rest use this pool     
    pool {
        range 10.161.255.201 10.161.255.254;
        allow unknown-clients;
        }
}
Simon Lin
  • 31
  • 1

1 Answers1

0

Your dhcpd.conf config is valid. I tested it myself on isc-dhcp 4.2.4 and the subclass'd MAC addresses got the l2vpn_user pool addresses.

I'd recommend running dhcpd in the forground with debug logging enabled (-f and -d flags) and doing some sanity checks based on what is logged. Since your config is valid and works in my testing, it is likely there is some external problem causing your issue.

alienth
  • 236
  • 1
  • 7