https://blog.csdn.net/sxy2475/article/details/78015262
#!/bin/bash
systemctl disable firewalld.service
systemctl stop firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
nmcli connection show
nmcli connection modify "ens3" ipv4.addresses 192.168.27.132/24 ipv4.gateway 192.168.27.1
yum install -y dhcp tftp-server httpd syslinux
systemctl enable httpd.service
systemctl start httpd.service
mkdir -pv /var/www/html/centos/7
mount /dev/sr0 /var/www/html/centos/7/
mkdir /var/www/html/ksdir/
cp -p /root/anaconda-ks.cfg /var/www/html/ksdir/ks7-1.cfg
chmod +r /var/www/html/ksdir/*.cfg
systemctl enable tftp.socket
systemctl start tftp.socket
cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf
systemctl enable dhcpd
systemctl start dhcpd
mkdir /var/lib/tftpboot/pxelinux.cfg/
mkdir /var/lib/tftpboot/centos7
cp /usr/share/syslinux/{pxelinux.0,menu.c32} /var/lib/tftpboot/
cp /var/www/html/centos/7/isolinux/{initrd.img,vmlinuz} /var/lib/tftpboot/centos7
cp /var/www/html/centos/7/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
label centos7 #自动安装centos7 menu label Auto Install CentOS Linux ^7
kernel centos7/vmlinuz
append initrd=centos7/initrd.img ks=
----------
阅读(1218) | 评论(0) | 转发(0) |