Configure PXE Server on Slackware 13.0

PXE server requires DHCPD, TFTPD and PXE boot files.


Suppose all these service on the same server, IP: 192.168.1.100, Gateway: 192.168.1.1, DNS: 192.168.1.1, DHCP range: 192.168.1.129 – 192.168.1.254


1. Enable DHCPD


Create /etc/rc.d/rc.dhcpd script, then chmod a+x /etc/rc.d/rc.dhcpd


#!/bin/sh
#
# /etc/rc.d/rc.dhcpd
# This shell script takes care of starting and stopping
# the ISC DHCPD service
#
# Put the command line options here that you want to pass to dhcpd:
DHCPD_OPTIONS=”-q eth0″
[ -x /usr/sbin/dhcpd ] || exit 0
[ -f /etc/dhcpd.conf ] || exit 0
start() {
# Start daemons.
echo -n “Starting dhcpd: /usr/sbin/dhcpd $DHCPD_OPTIONS ”
/usr/sbin/dhcpd $DHCPD_OPTIONS
echo
}
stop() {
# Stop daemons.
echo -n “Shutting down dhcpd: ”
killall -TERM dhcpd
echo
}
status() {
PIDS=$(pidof dhcpd)
if [ “$PIDS” == “” ]; then
echo “dhcpd is not running!”
else
echo “dhcpd is running at pid(s) ${PIDS}.”
fi
}
restart() {
stop
start
}
# See how we were called.
case “$1” in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo “Usage: $0 {start|stop|status|restart}”
;;
esac
exit 0

Edit /etc/dhcpd.conf for configuration.



# dhcpd.conf
#
# Configuration file for ISC dhcpd (see ‘man dhcpd.conf’)
#
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
ddns-update-style none;
# Allow bootp requests
allow bootp;
# Point to the TFTP server:
next-server 192.168.1.100;
# Default lease time: 1 week (604800 sec.)
default-lease-time 604800;
# Max lease time: 4 weeks (2419200 sec.)
max-lease-time 2419200;
subnet 192.168.1.0 netmask 255.255.255.0 {
#option domain-name “example.com”;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
range dynamic-bootp 192.168.1.129 192.168.1.254;
use-host-decl-names on;
if substring (option vendor-class-identifier, 0, 9) = “PXEClient” {
filename “pxelinux.0”;
}

2. Configure TFTPD Service


Edit /etc/inetd.conf to enable TFTPD service: uncomment “tftp” line.


mkdir /tftpboot/


3. Configure PXE


Refer to “4. TFTPD Configuration for PXE” in my old article “Configure Gateway, DNS, and DHCP (with PXE)“.


Reference:


1. PXE: Installing Slackware over the network


2. Configure Gateway, DNS, and DHCP (with PXE)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s