RHEL7+DHCP+TFTP+PXE部署多个版本操作系统
一、dhcpd服务配置
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf vim /etc/dhcp/dhcpd.conf #dhcp根据实际环境配置 subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.100 192.168.1.200; option domain-name-servers server.example.com; option domain-name "8.8.8.8"; option routers 192.168.1.254; option broadcast-address 192.168.1.255; next-server 192.168.1.89; filename "pxelinux.0"; default-lease-time 60000; max-lease-time 720000; }
配置开机自启动
systemctl restart dhcpd.service #启动dhcp服务 systemctl enable dhcpd.service #随下次开机自动启动该服务
二、安装配置tftp-server syslinux
tftp服务配置
yum -y install syslinux tftp-server vim /etc/xinetd.d/tftp disable=no#将yes修改no systemctl restart xinetd.service systemctl enable xinetd.service
rhel7引导文件配置
cd /var/lib/tftpboot mkdir rhel6 rhel7 #因为是多系统引导安装所以创建两个不同版本的文件夹,存放不同的引导文件 cd rhel7 #rhel7文件夹里面存放rhel7的引导文件,需要手动挂载rhel7系统光盘拷贝引导文件 cp /mnt/rhel7iso/init.img . #复制到当前 cp /mnt/rhel7iso/vmlinuz . cd .. #放回上一级目录
rhel6引导文件配置
cd rhel6 #rhel6文件夹里面存放rhel6的引导文件,需要手动挂载rhel6系统光盘拷贝拷贝文件 cp /mnt/rhel6iso/init.img . cp /mnt/rhel6iso/vmlinuz . cd .. #放回上一级目录
pxe引导及菜单文件配置
cp -rp /usr/share/syslinux/* /var/lib/tftpboot/ mkdir pxelinux.cfg cd pxelinux.cfg cp /mnt/rhel6iso/isolinux.cfg ./default #随便使用哪个系统版本的引导菜单都可以使用,复制过来修改名称为default做相应修改即可 vim default #编辑default文件 #以下开始部分可以根据自已需要编辑 menu clear menu background splash.png menu title pxe system install menu vshift 8 menu rows 18 default menu.c32 display boot.msg prompt 0 timeout 50 ONTIMEOUT local label rhel7 pxe install kernel rhel7/vmlinuz #刚才创建了对应系统版本文件夹,所有vmlinuz前面加上rhel7 append initrd=rhel7/initrd.img inst.ks=http://192.168.1.89/rhel7/ks.cfg #initrd.img前面同样加上rhel7 label rhel6 pxe install kernel rhel6/vmlinuz append initrd=rhel6/initrd.img ks=http://192.168.1.89/rhel6/ks.cfg #rhel6的ks命令不一样,前面没有inst
三、httpd yum源配置
yum -y install httpd cd /var/www/html mkdir {rhel7,rhel6} 分别将挂载的两个OS ISO镜像里的文件copy到这两个目录 systemctl restart httpd.service systemctl enable httpd.service
ks文件生成:
yum -y install system-config-kickstgart system-config-kickstart 图形化生成配置文件
将生成的ks文件copy到刚刚yum源对应的目录里。
四、selinux和防火墙配置
#修改SELinux状态 vim /etc/sysconfig/selinux SELINUX=permissive #默认的enforcing修改为permissive setenforce 0 #或者重启系统 #防火墙开放服务和端口号 firewall-cmd --permanent --add-port=111/tcp firewall-cmd --permanent --add-port=111/udp firewall-cmd --permanent --add-port=20048/tcp firewall-cmd --permanent --add-port=20048/udp firewall-cmd --permanent --add-port=69/udp firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=dhcp firewall-cmd --reload
本站的发展离不开您的资助,金额随意,欢迎来赏!
You can donate through PayPal.My paypal id: itybku@139.comPaypal page: https://www.paypal.me/361way
You can donate through PayPal.My paypal id: itybku@139.comPaypal page: https://www.paypal.me/361way
近期评论