# yum install dhcp 1.2 配置dhcp
白山網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)!從網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開(kāi)發(fā)、APP開(kāi)發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)等網(wǎng)站項(xiàng)目制作,到程序開(kāi)發(fā),運(yùn)營(yíng)維護(hù)。創(chuàng)新互聯(lián)于2013年成立到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來(lái)保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)。# vi /etc/dhcp/dhcpd.conf # default-lease-time 600; # max-lease-time 7200; ddns-update-style none; log-facility local7; next-server 192.168.1.1; //指定tftp服務(wù)器ip,該ip地址這里指定本機(jī)地址 filename "pxelinux.0"; //指定引導(dǎo)文件 subnet 192.168.1.0 netmask 255.255.255.0 { range dynamic-bootp 192.168.1.10 192.168.1.100; //設(shè)置dhcp作用域范圍 # option domain-name-servers 8.8.8.8; # option routers 192.168.1.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; default-lease-time 600; max-lease-time 7200; } 2. 安裝配置tftp2.1 安裝tfpt
# yum install tftp-server 2.2 配置tftp
# vim /etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot //設(shè)置tftp的根目錄 disable = no //這里原來(lái)是yes要改成no per_source = 11 cps = 100 2 flags = IPv4 }
cd /var/lib/tftp mkdir pxelinux.cfg 掛載系統(tǒng)關(guān)盤(pán)到/mnt/cdrom目錄下
# mount /dev/cdrom /mnt/cdrom # cp /mnt/cdrom/images/*.img /var/lib/tftpboot # cp /mnt/cdrom/isolinux/boot.msg /var/lib/tftpboot # cp /mnt/cdrom/isolinux/initrd.img /var/lib/tftpboot # cp /mnt/cdrom/isolinux/vesamenu.c32 /var/lib/tftpboot # cp /mnt/cdrom/isolinux/vmlinuz /var/lib/tftpboot # cp /mnt/cdrom/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default # chmod -R 755 /var/lib/tftpboot //讓tftp目錄下的所有文件有執(zhí)行權(quán)限 #chmod 777 /var/lib/tftpboot/pxelinux.cfg/default 獲取pxelinux.0 引導(dǎo)文件
# yum install syslinux # rpm -qa | grep syslinux # rpm -ql syslinux-4.02-7.el6.x86_64 | grep pxelinux.0 //查找 pxelinux.0所在位置 # cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ 3. 配置apache在任意的虛擬主機(jī)或者默認(rèn)主機(jī)中添加一個(gè)虛擬目錄指向關(guān)盤(pán)掛載目錄, 或者大家配置nfs、ftp也可以,這邊還是用HTTP來(lái)做演示
# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf Alias /iso "/mnt/cdrom/"
# service dhcpd start # service xinetd start 4.2 關(guān)閉selinux和iptables
# set enforce0 # service iptables stop 5. 安裝操作系統(tǒng)從網(wǎng)絡(luò)安裝即可,各自服務(wù)器網(wǎng)絡(luò)啟動(dòng)方式不同,這邊不再敖述