标签:ini pre pos rmi active prompt mbr initrd daemon
---恢复内容开始---
查看系统的版本:
[root@oldboyedu ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core) CentOS release 6.9 (Final)
查看系统的内核:
[root@oldboyedu ~]# uname -r
3.10.0-693.el7.x86_64
查看selinux是否关闭:
[root@oldboyedu ~]# getenforce
Permissive
查看防火墙是否关闭:
[root@oldboyedu ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@oldboyedu ~]# yum -y install dhcp
查看是否安装成功:
[root@oldboyedu ~]# rpm -qa |grep dhcp
dhcp-libs-4.2.5-58.el7.centos.x86_64
dhcp-4.2.5-58.el7.centos.x86_64
dhcp-common-4.2.5-58.el7.centos.x86_64
[root@oldboyedu ~]# vim /etc/dhcp/dhcpd.conf
subent 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.100 10.0.0.200;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
next-server 10.0.0.201
filename "/pxelinux.0";
说明:
subent 10.0.0.0 分配的网段
netmask 255.255.255.0 子网掩码
range 10.0.0.100 10.0.0.200; 可分配的地址
option subnet-mask 255.255.255.0; 可分配的子网掩码
default-lease-time 21600; 设置默认的ip租用期限
max-lease-time 43200; 最大的租期期限
next-server 10.0.0.201 TFTP的服务器的ip地址
filename "/pxelinux.0"; 需要从 tftp服务器上下载的文件
[root@oldboyedu ~]# systemctl start dhcpd
[root@oldboyedu ~]# yum -y install tftp-server
查看是否安装成功:
[root@oldboyedu ~]# rpm -qa |grep tftp-server
tftp-server-5.2-13.el7.x86_64
[root@oldboyedu ~]# systemctl start tftp.socket
[root@oldboyedu ~]# yum -y install syslinux
把pxelinux.0启动文件移动到TFTP的根目录下:
[root@oldboyedu ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@oldboyedu ~]# mkdir -p /var/www/html/CentOS7
[root@oldboyedu ~]# mount /dev/cdrom /var/www/html/CentOS7/
[root@oldboyedu ~]# cp -a /var/www/html/CentOS7/isolinux/* /var/lib/tftpboot/
[root@oldboyedu ~]# mkdir -p /var/lib/tftpboot/pxelinux.cfg
[root@oldboyedu ~]# cp /var/www/html/CentOS7/isolinux/isolinux.cfg /var/lib/t
[root@oldboyedu ~]# cp /var/www/html/CentOS7/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
[root@oldboyedu ~]# yum -y install httpd
[root@oldboyedu ~]# systemctl start httpd.service
[root@oldboyedu ~]# vim /var/lib/tftpboot/pxelinux.cfg/default
default ks
prompt 0
label ks
kernel vmlinuz
append initrd=initrd.img ks=http://172.16.1.201/ks_config/CentOS7-ks.cfg net.ifnames=0 biosdevname=0 ksdevice=eth1
[root@oldboyedu ~]# vim /var/www/html/ks_config/CentOS7-ks.cfg
# Kickstart Configurator for CentOS 7 by yao zhang
install
url --url="http://172.16.1.201/CentOS7/"
text
lang en_US.UTF-8
keyboard us
zerombr
network --hostname=Cobbler
#network --bootproto=dhcp --device=eth1 --onboot=yes --noipv6 --hostname=CentOS7
timezone --utc Asia/Shanghai
authconfig --enableshadow --passalgo=sha512
clearpart --all --initlabel
part /boot --fstype xfs --size 1024
part swap --size 1024
part / --fstype xfs --size 1 --grow
firstboot --disable
selinux --disabled
firewall --disabled
logging --level=info
reboot
%packages
@^minimal
@compat-libraries
@debugging
@development
tree
nmap
sysstat
lrzsz
dos2unix
telnet
wget
vim
bash-completion
%end
%post
systemctl disable postfix.service
%end
---恢复内容结束---
标签:ini pre pos rmi active prompt mbr initrd daemon
原文地址:http://www.cnblogs.com/wangmengnan/p/7832869.html