1.DHCP Service Installation and configuration
Required Program: DHCPD
[email protected] dhcp]# Yum install-y dhcpd
To configure the DHCPD configuration file:
[Email protected] dhcp]# vim/etc/dhcp/dhcpd.conf
Add the following content
Subnet 172.16.0.0 netmask 255.255.0.0 {# Note that the IP address here is consistent with the configuration on your network card, otherwise the service cannot start range 172.16.0.2 172.16.0.100; Next-server 172.16.0.1; FileName "pxelinux.0"; Option routers 172.16.0.1; Option Domain-name-servers 8.8.8.8;}
Start the service:
[[Email protected] dhcp]# service DHCPD startstarting dhcpd: [OK]
2. Configuring the TFTP service
Required program Tftp-server for convenience TFTP is also installed on
[[email protected] dhcp]# yum-y install tftp-server tftp
[[email protected] dhcp]# chkconfig tftp on # set TFTP service boot from [[email protected] dhcp]# chkconfig xinetd on # set TFTP required Super daemon boot from boot [[email protected] dhcp]# Service xinetd start # turn on Super daemon [[email protected] dhcp]# SS-UNL | grep "69" # Check if TFTP port 69 is on Unconn 0 0 *:69 *:*
3. Prepare the installation tree
[[email protected] dhcp]# mount/dev/sr0/var/www/html/centos6/-R # Attach CentOS6.5 DVD installation CD to website service [email protected] dhcp]# Service httpd Start # httpd Services starting Httpd:httpd:apr_sockaddr_info_get () failed for gatewayhttpd:could not reliably Determine the server ' s fully qualified domain name, using 127.0.0.1 for servername[OK]
4. Prepare the file under TFTP
[[email protected] pxeboot]# Cd/var/www/html/centos6/isolinux/[[email protected] isolinux]# CP VESAMENU.C32 boot.msg Splash.jpg/var/lib/tftpboot/[[email protected] isolinux]# cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/[[ Email protected] isolinux]# Mkdir/var/lib/tftpboot/pxelinux.cfg[[email protected] isolinux]# CP isolinux.cfg/var/lib/ Tftpboot/pxelinux.cfg/default[[email protected] isolinux]# Cd/var/lib/tftpboot/pxelinux.cfg/[[email protected] pxelinux.cfg]# chmod +w Default
5. Provide kickstart configuration file
# kickstart file automatically generated by anaconda. #version =develinstallurl --url=http://172.16.0.1/centos6/lang en_us. utf-8keyboard usnetwork --onboot yes --device eth0 --bootproto dhcp -- noipv6rootpw --iscrypted $6$lrieom2auzqokjk1$ 16db6y2khugffuqkcj0rmcw8568g304tkoskog7v7vt04mpvg30iemq48ljtx9iawlztvs8wq5x7dr1.bi6gc1# reboot after installationrebootfirewall --service=sshauthconfig --enableshadow --passalgo= Sha512selinux --disabledtimezone asia/seoulbootloader --location=mbr --driveorder=sda --append= "Crashkernel=auto rhgb rhgb quiet quiet" # the following is the partition information you requested# Note that any Partitions you deleted are not expressed# here so unless you clear all partitions first, this is# not guaranteed to workclearpart --all --drives= Sdapart /boot --fstype=ext4 --size=500part pv.008002 --grow --size=1volgroup vg_stu --pesize=4096 pv.008002logvol / --fstype=ext4 --name=lv_root -- vgname=vg_stu --grow --size=1024 --maxsize=51200logvol swap --name=lv_swap -- Vgname=vg_stu --grow --size=2016 --maxsize=2016repo --name= "CentOS" --baseurl= http://172.16.0.1/centos6/ --cost=100% Packages@base@core@base@console-internet@core@debugging@directory-client@java-platform@mysql-client@network-file-system-c Lient@performance@perl-runtime@php@postgresql-client@server-platform@server-policy@turbogears@web-server@web-servlet@work Station-policycertmongerdevice-mapper-persistent-datakrb5-workstationoddjobpam_ Krb5paxperl-cgiperl-dbd-sqlitesamba-winbindsgpio%end
[[email protected] pxelinux.cfg]# cp /root/anaconda-ks.cfg /var/www/html/ks.cfg[[ Email protected] pxelinux.cfg]# chmod +r /var/www/html/ks.cfg[[email protected] pxelinux.cfg]# vim /var/lib/tftpboot/pxelinux.cfg/default default vesamenu.c32# prompt 1timeout 600display boot.msgmenu background splash.jpgmenu title welcome to centos 6.5!menu color border 0 #ffffffff #00000000menu color sel 7 #ffffffff #ff000000menu color title 0 #ffffffff #00000000menu color tabmsg 0 #ffffffff #00000000menu color unsel 0 #ffffffff #00000000menu color hotsel 0 #ff000000 #ffffffffmenu color hotkey 7 #ffffffff #ff000000menu color scrollbar 0 # ffffffff #00000000label linux menu label ^install or upgrade an existing system kernel vmlinuz append ks=http://172.16.0.1/ks.cfg initrd=initrd.img Web path for #在这里添加ks. CFG label vesa menu label install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodesetlabel rescue menu label ^rescue installed system kernel vmlinuz append initrd=initrd.img rescuelabel local menu label boot from ^local drive localboot 0xffff menu defaultlabel Memtest86 menu label ^memory test kernel memtest append -
This article is from the "Imperial Gold Cai Yuan zi" blog, please be sure to keep this source http://diguojin.blog.51cto.com/5034509/1551467
PXE Install Linux network automatically installs CentOS6.5 Linux