Network Installation Linux (2) – DHCP Server

Make dhcpd start as default

Since request-installed box need IP address, the dhcpd deamon should be up every time when server is up. If we don’t want to start X, then we can go to /etc/inittab to change id:5:initdefault: to id:3:initdefault:. Then, we can go to /etc/rc3.d to double check. If there is a file named S65dhcpd (which means start deamon when reboot), then we are done. If there is a “K” at the beginning of the “dhcpd” file (For example, K65dhcpd, which means kill deamon when reboot), then we have to change file from “K” to “S”.

Change dhcpd.conf for PXELINUX purpose

After DHCP Pool statement, we need to add some configuration for PXELINUX clients. When they get IP address, they will try to get pxelinux default configuration.

allow booting; allow bootp; class “pxeclients” { match if substring(option vendor-class-identifier, 0, 9) = “PXEClient”; next-server 10.2.0.78; filename “linux-install/pxelinux.0″; }

next-server” is actually TFTP server. I will mention that on next article. The TFTP server root is /tftpboot/, so the pxelinux.0 is stored in /tftpboot/linux-install/pxelinux.0. PXELINUX will take MAC address as substring to match first.

ddns-update-style interim;
ignore client-updates;

allow booting;
allow bootp;
class “pxeclients” {
match if substring(option vendor-class-identifier, 0, 9) = “PXEClient”;
next-server 192.168.50.22;
filename “linux-install/pxelinux.0″;
}

subnet 192.168.50.0 netmask 255.255.255.0 {

# — default gateway
option routers 192.168.50.1;
option subnet-mask 255.255.255.0;

# option nis-domain “lab.com”;
# option domain-name “lab.com”;
option domain-name-servers 172.16.100.100;

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.50.2 192.168.50.254;
default-lease-time 21600;
max-lease-time 43200;

}

Start DHCP service

/etc/init.d/dhcpd start

Discussion Area - Leave a Comment




Spam Protection by WP-SpamFree Plugin