PXE配置安装CentOS 6.5

本文发布时间: 2019-Mar-22
1、安装配置DHCP用于给客户端提供IPyum -y install dhcpcp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf编辑dhcpd.confallow booting; //支持PXE启动allow bootp; // 支持bootpsubnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.10 192.168.1.50;default-lease-time 6000;max-lease-time 72000;next-server 192.168.1.80;filename "/pxelinux.0";}2、安装配置TFTPyum -y install tftp-server //安装tftp-server,需xinetd、tftp和tftp-server,yum会根据依赖关系自动安装更改/etc/xinetd.d/tftpservice tftp{socket_type = dgramprotocol = udpwait = yesuser = rootserver = /usr/sbin/in.tftpdserver_args = -s /tftpboot //tftp服务器的根目录disable = noper_source = 11cps = 100 2flags = IPv4}service xinetd restart //重启服务器生效3、拷贝启动所需的文件并配置yum -y install syslinux /安装syslinux,此服务为pxe提供pxelinux.0文件即boostrap文件cp /usr/share/syslinux/pxelinux.0 /tftpboot/ //pxelinux.0文件不一定就在这个目录下,通过find来查找mkdir /mnt /installmount /dev/cdrom /mnt/installcp /mnt/install/pxeboot/{vmlinuz,initrd.img} /tftpboot/ //vmlinuz内核文件、initrd.img根文件系统创建/tftpboot/pxelinux.cfg/ 目录,该目录用于存放客户端的配置文件cp /Media/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default /这个文件可修改安装界面查看文件是否拷贝齐全(可能多上传了,不过没影响)注:拷贝的文件注意更改root权限,建议直接777,没影响chmod u+w /tftpboot/pxelinux.cfg/default vim /tftpboot/pxelinux.cfg/default default vesamenu.c32#prompt 1timeout 600display boot.msgmenu background splash.jpgmenu title Welcome to ZhongBai 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 linuxmenu label ^Install or upgrade an existing systemmenu defaultkernel vmlinuzappend ks=nfs:192.168.1.80:/mnt/ks.cfg initrd=initrd.img //指定ks文件目录label vesamenu label Install system with ^basic video driverkernel vmlinuzappend initrd=initrd.img xdriver=vesa nomodesetlabel rescuemenu label ^Rescue installed systemkernel vmlinuzappend initrd=initrd.img rescuelabel localmenu label Boot from ^local drivelocalboot 0xfffflabel memtest86menu label ^Memory testkernel memtestappend -4、安装配置NFS服务器yum -y rpcbind install //centos5中,这服务叫portmapyum -y nfs installvi /etc/exports/mnt/ *(ro,sync) //前面代表共享目录,*代表任何人都可以访问(或192.168.1.*),权限/mnt/install *(ro,sync)//sync:文件同时写入硬盘和内存;showmount -e localhost //查看是否发布成功 [root@cedar tftpboot]# showmount -e localhostExport list for localhost:/mnt/install 192.168.1.*/mnt 192.168.1.*5、安装配置kickstart生成ks.cfg文件yum -y install system-config-kickstartsystem-config-kickstart //调出界面制作ks.cfg文件ks配置文件内容如下:[root@cedar tftpboot]# cat /mnt/ks.cfg#platform=x86, AMD64, or Intel EM64T#version=DEVEL# Firewall configurationfirewall --disabled# Install OS instead of upgradeinstall# Use NFS installation medianfs --server=192.168.1.80 --dir=/mnt/install# Root passwordrootpw --iscrypted $1$VFLk79.d$rCSW91yvcDZSkAXgmTYI7.# System authorization informationkey --skipauth --useshadow --passalgo=sha512# Use graphical installgraphicalfirstboot --disable# System keyboardkeyboard us# System languagelang en_US# SELinux configurationselinux --disabled# Installation logging levellogging --level=info# System timezonetimezone --isUtc Asia/Shanghai# Network informationnetwork --bootproto=dhcp --device=eth0 --onboot=on# System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel # Disk partitioning informationpart / --fstype="ext4" --size=10240 //分区part /home --fstype="ext4" --size=2048part swap --fstype="ext4" --size=1024part /boot --fstype="ext4" --size=200part /var --fstype="ext4" --size=1024%packages //安装的一些包@base@core@debugging@basic-desktop@desktop-debugging@desktop-platform@directory-client@fonts@general-desktop@graphical-admin-tools@input-methods@internet-applications@internet-browser@java-platform@legacy-x@network-file-system-client@office-suite@print-client@remote-desktop-clients@server-platform@server-policy@workstation-policy@x11mtoolsoddjobwodimsgpiogenisoimagedevice-mapper-persistent-datapaxabrt-guisamba-winbindcertmongerpam_krb5krb5-workstationlibXmu%end6、关闭防火墙和SElinux避免未知的错误需要关闭防火墙和SElinuxservice iptables restart修改/etc/selinux/configSELINUX=disabled7、测试 新建一个虚拟机,网卡都选host-only的VM2QTFBc01xa2JnMzcwLmpwZw==" src="http:///uploadfile/files/2014/0418/2014041808512422.jpg" title="QQ截图20140417220925.jpg" />一路安装直至完成!!!


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:10pm
栏目列表