How to kickstart from both directly and non-directly connected network

Jephe Wu -

Objective: kickstart CentOS 6 installation from both direct and non-direct connected network
Environment: CentOS 6, LAN
keywords: dhcp, dhcrelay, kickstart.

Network diagram:

------PC0(DHCP and to be tickstarted)------[eth1:]DHCP Server[eth0:]----PC1(non-DHCP network, no need kickstart)---[eth0:] Linux DHCP Relay agent server [eth1:] ----PC2(need DHCP and to be kickstarted)


1. configure DHCP server as follows:

# this global config is mainly for dhcp network pcs
option time-offset    -18000; # Eastern Standard Time
option domain-name    "jephe";
option routers;
option subnet-mask;
option domain-name-servers;
default-lease-time    21600;
max-lease-time      43200;
allow booting;
allow bootp;

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

subnet netmask {
range dynamic-bootp;
filename "linux/pxelinux.0";

#if need to make dhcp server to listen on eth0 also even if pc1 is no need dhcp, it's for serving dhcp relay network 192.168.2.x# if listening on eth1 only(set it in /etc/default/dhcp3 for ubuntu)

subnet netmask {

subnet netmask {
 option domain-name-servers;
 option routers;   dhcrelay ip
 next-server; dhcp/tftp server
 filename "linux/pxelinux.0";

2. dhcrelay server configuration

[root]# vi /etc/sysconfig/dhcrelay 
# Command line options here
# DHCPv4 only
INTERFACES="eth0 eth1"  #must listen on both interfaces, otherwise, dhcp relay package is not able to forward back to client in non-directly connected network 192.168.2.X
# DHCPv4 only
3. start up services and monitoring
chkconfig dhcrelay on
service dhcrelay start

tcpdump -n port 67 or port 68  # on dhcp server
dhcrelay -d -i eth0 eth1 # to monitoring dhcrelay packages