Skip to content

Instantly share code, notes, and snippets.

@pyKun
Last active December 16, 2015 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyKun/5411176 to your computer and use it in GitHub Desktop.
Save pyKun/5411176 to your computer and use it in GitHub Desktop.
two example of dhcp config file for white list (mac addr) in linux
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see 'man 5 dhcpd.conf'
#
ddns-update-style interim;
ignore client-updates;
next-server 192.168.1.160;
filename "/pxelinux.0";
option routers 192.168.1.1;
option domain-name "ustack.com";
option domain-name-servers 114.114.114.114;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.250;
}
host test-hk {
option host-name "testks.celtics";
hardware ethernet 00:0c:29:d9:07:a2;
fixed-address 192.168.1.235;
}
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see 'man 5 dhcpd.conf'
#
ddns-update-style interim;
ignore client-updates;
next-server 192.168.1.160;
filename "/pxelinux.0";
option routers 192.168.1.1;
option domain-name "ustack.com";
option domain-name-servers 114.114.114.114;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
class "clients" {
# mac is 48 bit, or 6 Byte, so that is 6 here.
match if substring (hardware,1,6) = 00:0c:29:d9:07:a2;
}
pool {
range 192.168.1.100 192.168.1.250;
allow members of "clients";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment