[root@kickstart ~]# systemctl stop firewalld
[root@kickstart ~]# systemctl disablefirewalld
[root@kickstart ~]# sed-i '/SELINUX=enforcing/c \SELINUX=disabled' /etc/selinux/config
[root@kickstart ~]# yum install -y iptables-services
[root@kickstart ~]# systemctl daemon-reload
[root@kickstart ~]# systemctl stop iptables.service
[root@kickstart ~]# systemctl disable iptables.service
[root@kickstart ~]# hostnamectl set-hostname kickstart
[root@kickstart ~]# echo "TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens32"
UUID="$(nmcli conn | awk '/ens32/{print $3}')"
DEVICE="ens32"
ONBOOT="yes"
IPADDR="192.168.0.10"
PREFIX="24"
GATEWAY="192.168.0.2"
DNS1="114.114.114.114"
DNS2="8.8.8.8"
IPV6_PRIVACY="no"" > /etc/sysconfig/network-scripts/ifcfg-ens32
[root@kickstart ~]# systemctl restart network #重启网卡生效
echo "192.168.010 kickstart" >> /etc/hosts
[root@kickstart ~]# mkdir /mnt/cdrom
[root@kickstart ~]# echo "/dev/sr0 /mnt/cdrom iso9660 defaults 0 0" >> /etc/fstab
[root@kickstart ~]# mount -a
[root@kickstart ~]# mv -f $repo/* /opt/
[root@kickstart ~]# echo "[centos7]
name=centos_7.9
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0" > /etc/yum.repos.d/local.repo
[root@kickstart ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@kickstart ~]# yum install -y lrzsz net-tools gcc gcc-c++ iostat vim tree wget nmap lsof htop iftop iotop sysstatpsmisc curl lynx gzip bzip2 ntp xinetd
[root@kickstart ~]# ntpdatentp1.aliyun.com
[root@kickstart ~]# sed -i '$aset nu' /etc/virc
[root@kickstart ~]# sed -i '$aset nu' /etc/vimrc
[root@kickstart ~]# yum install -y dhcp
[root@kickstart ~]# cp /etc/dhcp/dhcpd.conf /opt/ #先做一份备份
[root@kickstart ~]# vim /etc/dhcp/dhcpd.conf
[root@kickstart ~]# systemctl start dhcpd #启动dhcp服务
[root@kickstart ~]# systemctl enable dhcpd #设置dhcp服务开机自启
[root@kickstart ~]# systemctl status dhcpd #查看dhcp服务状态
[root@kickstart ~]# netstat -antup | grep dhcpd #查看dhcp服务端口号
[root@kickstart~]# ps -elf | grep dhcpd #查看dhcp服务进程
[root@kickstart ~]# systemctl start dhcpd #启动dhcp服务
[root@kickstart ~]# systemctl enable dhcpd #设置dhcp服务开机自启
[root@kickstart ~]# systemctl status dhcpd #查看dhcp服务状态
[root@kickstart ~]# netstat -antup | grep dhcpd #查看dhcp服务端口号
[root@kickstart ~]# ps -elf | grep dhcpd #查看dhcp服务进程
[root@kickstart ~]# yum install -y tftp-server xinetd lsof
[root@kickstart ~]# cp /etc/xinetd.d/tftp /opt/ #做一份备份
[root@kickstart ~]# vim /etc/xinetd.d/tftp
[root@kickstart ~]# systemctl start xinetd #启动xinetd
[root@kickstart ~]# lsof -i:69 #查看udp69号端口
[root@kickstart ~]# netstat -antup | grep 69 #查看udp69进程
[root@kickstart ~]# yum install -y system-config-kickstart syslinux
[root@kickstart ~]# mkdir /var/lib/tftpboot/pxelinux.cfg
[root@kickstart ~]# cp /usr/share/syslinux/pxelinux.0/var/lib/tftpboot
[root@kickstart ~]# ls /mnt/cdrom/images/pxeboot/
[root@kickstart ~]# cp /mnt/cdrom/images/pxeboot/*/var/lib/tftpboot/
[root@kickstart ~]# cp /mnt/cdrom/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default
[root@kickstart ~]# vim /var/lib/tftpboot/pxelinux.cfg/default
[root@kickstart ~]# default linux
[root@kickstart ~]# yum install -y vsftpd
[root@kickstart ~]# systemctl start vsftpd #启动vsftpd服务
[root@kickstart ~]# systemctl enable vsftpd #设置vsftpd服务开机自启
[root@kickstart ~]# systemctl status vsftpd #查看vsftpd服务状态
[root@kickstart ~]# netstat -antup | grep vsftpd #查看vsftpd服务端口号
[root@kickstart~]# ps - ef | grep vsftpd #查看vsftpd服务进程
[root@kickstart ~]# echo "/dev/sr0 /var/ftp/pub iso9660 defaults 0 0" >>/etc/fstab
[root@kickstart ~]# mount -a #添加挂载
[root@kickstart ~]# lsblk #查看挂载情况
[root@kickstart ~]# ls /var/ftp/pub/ #查看该路径下文件
修改本地仓库名称为development,否则kickstart无法找到软件包
[root@kickstart ~]# vim /etc/yum.repos.d/local.repo
[root@kickstart ~]# yum clean all
[root@kickstart ~]# yum makecache
[root@kickstart ~]# yuminstall -y xorg-x11-xauth #安装完毕后xhell重新连接服务器
[root@kickstart ~]#yum groupinstall -y "fonts" #安装语言包,防止出现乱码
[root@kickstart~]# system-config-kickstart
[root@kickstart ~]# ls/var/ftp/