Results 1 to 2 of 2
Hi all,
What I am trying to achieve is to configure debian dhcp server to assign ip addresses based on part of the mac addresses starting with 00:0d:da.
I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-15-2011 #1Just Joined!
- Join Date
- Feb 2011
- Posts
- 2
Configure dhcp to assign ip addresses based on part of the mac address
Hi all,
What I am trying to achieve is to configure debian dhcp server to assign ip addresses based on part of the mac addresses starting with 00:0d:da.
I have the following config:
class "TestSwitch" {
match if substring(option agent.remote-id, 2, 12) = "TestSwitch";
match pick-first-value ( option vendor-class-identifier );
option tftp-server-name "10.60.41.75";
option bootfile-name "10.60.41.75";
}
subnet 10.60.200.0 netmask 255.255.248.0 {
# DHCP Setup for test Residential Ring 2
# --- default gateway
option routers 10.60.207.254;
option subnet-mask 255.255.248.0;
option domain-name-servers 10.57.1.71, 10.57.11.71;
pool {
allow members of "TestSwitch";
range 10.60.200.1 10.60.200.230;
range 10.60.201.1 10.60.201.230;
deny dynamic bootp clients;
}
}
So I was thinking of two solutions. Corret me if I am wrong. I am note sure if the and statement is correct?
The first one is to add a statement under class "TestSwitch":
class "TestSwitch" {
match if ((substring(option agent.remote-id, 2, 12) = "TestSwitch") and (substring (hardware, 1, 3) = 00:0d:da));
subnet 10.60.200.0 netmask 255.255.248.0 {
# DHCP Setup for test Residential Ring 2
# --- default gateway
option routers 10.60.207.254;
option subnet-mask 255.255.248.0;
option domain-name-servers 10.57.1.71, 10.57.11.71;
option domain-name "rg.testmgmt.hef.dk";
pool {
allow members of "TestSwitch";
range 10.60.200.1 10.60.200.230;
range 10.60.201.1 10.60.201.230;
deny dynamic bootp clients;
}
}
The other solution ( I am not sure if I can allow two classes in the allow members ?) is:
class "Test" {
match if substring(hardware, 1, 3) = 00:0d:da;
}
subnet 10.60.200.0 netmask 255.255.248.0 {
# DHCP Setup for test Residential Ring 2
# --- default gateway
option routers 10.60.207.254;
option subnet-mask 255.255.248.0;
option domain-name-servers 10.57.1.71, 10.57.11.71;
option domain-name "rg.testmgmt.hef.dk";
pool {
allow members of "TST1CUPE10";
allow members of "Test";
range 10.60.200.1 10.60.200.230;
range 10.60.201.1 10.60.201.230;
deny dynamic bootp clients;
}
}
- 02-21-2011 #2Just Joined!
- Join Date
- Feb 2011
- Posts
- 2
Any one to help pleae?
Aitaseller


Reply With Quote
