basically I would like to achieve the followings:
- using only one subnet
- different types of user sharing this subnets
- creating 2 pools accordingly
- an user class called "l2vpn_user" if matched by MAC address then will be assign a different bootfile
- 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;
}
}