利用PXE Server大量部署Linux(2)

3.1 架设Installation Server

#cd /var/ftp/pub/iso
#ls rhel-server-5.5-x86_64-dvd.iso <——RHEL 5.5 DVD
#mkdir /var/www/html/rhel-server-5.5-x86_64
#mount –o loop rhel-server-5.5-x86_64-dvd.iso /var/www/html/rhel-server-5.5-x86_64

3.2 架设PXE Server

接着安装syslinux , tftp-server及tftp套件及启用tftp server
# yum -y install syslinux tftp tftp-server
#service xinetd start
#chkconfig tftp on

3.3 收集MAC Address

收集MAC Address,并先规画好对应的IP及hostname,假设每个栏位是用逗号,隔开的且内容如下,并存档为mac。
station1,00:0C:29:3F:DB:79,192.168.0.101
station2,00:0C:29:3F:DB:57,192.168.0.102
station3,00:0C:29:3F:DB:03,192.168.0.103

利用下列指令可以将mac转换为dhcpd.conf的格式:

# cat mac | sed 's/,/\t/g' | while read i j k此时按下Enter换行
> do
> echo "host $i {"
> echo " hardware ethernet $j;"
> echo " fixed-address $k;"
> echo "}"
> done > /etc/dhcpd.mac.lst

利用PXE Server大量部署Linux

3.4 设定dhcpd.conf

利用「rpm -q dhcp」指令先确认是否巳安装DHCP Server,若无请利用「yum -y install dhcp」安装DHCP Server。然后将dhcp 套件所提供的dhcpd.conf的sample档copy为/etc/dhcpd.conf。
#yum –y dhcp
# cp /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcpd.conf
# vi /etc/dhcpd.conf

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygfdp.html