实验环境“rhel5ip192.168.0.106#把防火墙关掉serviceiptablesstopsetenforce0
工具/原料
vsftp+tftp+dhcp+pxe+kickstart
linux红帽系统
方法/步骤
1、#挂载镜像到/mnt下[root@localhost~]#mount/dev/cdrom/mnt[root@localhost~]#vim/etc/yum.repos.d/yum.repo[aaa]name=anbaseurl=file:///mnt/Servergpgcheck=0
2、oot@localhost~]拭貉强跳#vim/etc/dhcpd.confddns-update-styleinterim;ignoreclient-updates稆糨孝汶;subnet192.168.0.0netmask255.255.255.0{optionrouters192.168.0.106;optionsubnet-mask255.255.255.0;next-server192.168.0.106;filename"pxelinux.0";optionnis-domain"domain.org";optiondomain-name"domain.org";optiondomain-name-servers192.168.0.106;optiontime-offset-18000;#EasternStandardTimerangedynamic-bootp192.168.0.128192.168.0.254;default-lease-time21600;max-lease-time43200;}
3、[root@localhost/]#lsbackupdev咯悝滩镞libmiscoptsbinsrvtmpbinetclost+foundmnt惺绅寨瞀procselinuxsysusrboothomemedianetrootsharetftpbootvar如果没有yum-yinstalltftp-server#安装下ftp[root@localhost/]#yum-yinstallvsftpd[root@localhost~]#cd/mnt/images/pxeboot/[root@localhostpxeboot]#lsinitrd.imgREADMETRANS.TBLvmlinuz[root@localhostpxeboot]#cpvmlinuzinitrd.img/tftpboot/[root@localhostsyslinux]#cppxelinux.0/tftpboot/[root@localhostsyslinux]#pwd/usr/lib/syslinux[root@localhosttftpboot]#mkdirpxelinux.cfg[root@localhosttftpboot]#cp/mnt/isolinux/isolinux.cfg/tftpboot/pxelinux.cfg/default[root@localhosttftpboot]#vimpxelinux.cfg/defaultdefaultlinuxprompt1timeout600displayboot.msgF1boot.msgF2options.msgF3general.msgF4param.msgF5rescue.msglabellinuxkernelvmlinuzappendinitrd=initrd.imgks=ftp://192.168.0.106/ks.cfg#添加软件包地址labeltextkernelvmlinuzappendinitrd=initrd.imgtextlabelkskernelvmlinuzappendksinitrd=initrd.imglabellocallocalboot1labelmemtest86kernelmemtestappend-[root@localhost~]#vim/etc/xinetd.d/tftp#default:off#description:Thetftpserverservesfilesusingthetrivialfiletransfer\#protocol.Thetftpprotocolisoftenusedtobootdiskless\#workstations,downloadconfigurationfilestonetwork-awareprinters,\#andtostarttheinstallationprocessforsomeoperatingsystems.servicetftp{socket_type=dgramprotocol=udpwait=yesuser=rootserver=/usr/sbin/in.tftpdserver_args=-s/tftpbootdisable=yes#把yes改成noper_source=11cps=1002flags=IPv4}#servicexinetdrestart[root@localhost~]#servicexinetdrestartStoppingxinetd:[OK]Startingxinetd:[OK][root@localhost~]#root@localhost~]#umount/dev/cdrom/mnt[root@localhost~]#vim/etc/yum.repos.d/yum.repo[base]name=anbaseurl=ftp://192.168.0.106/pubgpgcheck=0~[root@localhost~]#mount/dev/cdrom/var/ftp/pubmount:blockdevice/dev/cdromiswrite-protected,mountingread-onlyyum-yinstallsystem-config-kickstartsystem-config-kickstartcp./ks.cfg/var/ftpservicedhcpdrestartservicexinetdrestartservicevsftprestart