Sunday, 20 February 2011

Configure PXE-boot

Install netboot
[root@dhcp ~]# yum install system-config-netboot -y

Set Auto Start
[root@dhcp ~]# chkconfig tftp on
[root@dhcp ~]# chkconfig xinetd on

Turn on xinetd
[root@dhcp ~]# service xinetd start

Share installation tree
NFS
[root@dhcp ~]# vim /etc/exports
add
/mnt/rhel5-i386 192.168.48.0/24(ro)

[root@dhcp ~]# chkconfig nfs on
[root@dhcp ~]# service nfs start

[root@dhcp ~]# showmount -e
Export list for dhcp:
/mnt/rhel5-i386 192.168.48.0/24

PXE Config
pxeos -a -i "<description>" -p <NFS|HTTP|FTP> -D 0 -s server.example.com \
-L <location> -k <kernel> -K <kickstart> <os-identifer>

 [root@dhcp ~]# pxeos -a -i "RHEL 5 i386" -p NFS -D 0 -s 192.168.48.199 -L /mnt/rhel5-i386 RHEL5-I386

New Folder created
[root@dhcp ~]# ll /tftpboot/linux-install/RHEL5-I386/
-rw-r--r-- 1 root root 7500081 Feb 20 16:23 initrd.img
-rw-r--r-- 1 root root      78 Feb 20 16:23 ks.cfg
-rw-r--r-- 1 root root 1875796 Feb 20 16:23 vmlinuz
Add to /etc/dhcpd.conf
allow booting;
allow bootp;
class "pxeclients" {
        match if substring(option vendor-class-identifier,0, 9) = "PXEClient";
        next-server 192.168.48.199;
        filename "linux-install/pxelinux.0";
}
Check and restart dhcp
[root@dhcp ~]# service dhcpd configtest
[root@dhcp ~]# service dhcpd restart

No comments:

Post a Comment