CentOS7.9安装配置KickStart

大道之行,天下为公。这篇文章主要讲述CentOS7.9安装配置KickStart相关的知识,希望能为你提供帮助。
关闭防火墙,SeLinux。[root@kickstart ~]# iptables –F;systemctl disable firewalld.service
[root@kickstart ~]# setenforce 0;sed -i \'s/SELINUX=enforcing/SELINUX=disabled/g\' /etc/selinux/config
?
安装DHCP服务

[root@kickstart ~]# yum install dhcpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package dhcpd available.
Error: Nothing to do
[root@kickstart ~]# yum install dhcp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package dhcp.x86_64 12:4.2.5-83.el7.centos.1 will be installed
--> Processing Dependency: dhcp-libs(x86-64) = 12:4.2.5-83.el7.centos.1 for package: 12:dhcp-4.2.5-83.el7.centos.1.x86_64
--> Processing Dependency: dhcp-common = 12:4.2.5-83.el7.centos.1 for package: 12:dhcp-4.2.5-83.el7.centos.1.x86_64
--> Running transaction check
---> Package dhcp-common.x86_64 12:4.2.5-82.el7.centos will be updated
--> Processing Dependency: dhcp-common = 12:4.2.5-82.el7.centos for package: 12:dhclient-4.2.5-82.el7.centos.x86_64
---> Package dhcp-common.x86_64 12:4.2.5-83.el7.centos.1 will be an update
---> Package dhcp-libs.x86_64 12:4.2.5-82.el7.centos will be updated
---> Package dhcp-libs.x86_64 12:4.2.5-83.el7.centos.1 will be an update
--> Running transaction check
---> Package dhclient.x86_64 12:4.2.5-82.el7.centos will be updated
---> Package dhclient.x86_64 12:4.2.5-83.el7.centos.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================
PackageArchVersionRepositorySize
===========================================================================================================================
Installing:
dhcpx86_6412:4.2.5-83.el7.centos.1updates515 k
Updating for dependencies:
dhclientx86_6412:4.2.5-83.el7.centos.1updates286 k
dhcp-commonx86_6412:4.2.5-83.el7.centos.1updates177 k
dhcp-libsx86_6412:4.2.5-83.el7.centos.1updates133 k

Transaction Summary
===========================================================================================================================
Install1 Package
Upgrade( 3 Dependent packages)

Total download size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): dhclient-4.2.5-83.el7.centos.1.x86_64.rpm| 286 kB00:00:00
(2/4): dhcp-common-4.2.5-83.el7.centos.1.x86_64.rpm| 177 kB00:00:00
(3/4): dhcp-4.2.5-83.el7.centos.1.x86_64.rpm| 515 kB00:00:00
(4/4): dhcp-libs-4.2.5-83.el7.centos.1.x86_64.rpm| 133 kB00:00:00
---------------------------------------------------------------------------------------------------------------------------
Total4.4 MB/s | 1.1 MB00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating: 12:dhcp-libs-4.2.5-83.el7.centos.1.x86_641/7
Updating: 12:dhcp-common-4.2.5-83.el7.centos.1.x86_642/7
Installing : 12:dhcp-4.2.5-83.el7.centos.1.x86_643/7
Updating: 12:dhclient-4.2.5-83.el7.centos.1.x86_644/7
Cleanup: 12:dhclient-4.2.5-82.el7.centos.x86_645/7
Cleanup: 12:dhcp-common-4.2.5-82.el7.centos.x86_646/7
Cleanup: 12:dhcp-libs-4.2.5-82.el7.centos.x86_647/7
Verifying: 12:dhcp-common-4.2.5-83.el7.centos.1.x86_641/7
Verifying: 12:dhcp-4.2.5-83.el7.centos.1.x86_642/7
Verifying: 12:dhcp-libs-4.2.5-83.el7.centos.1.x86_643/7
Verifying: 12:dhclient-4.2.5-83.el7.centos.1.x86_644/7
Verifying: 12:dhcp-common-4.2.5-82.el7.centos.x86_645/7
Verifying: 12:dhclient-4.2.5-82.el7.centos.x86_646/7
Verifying: 12:dhcp-libs-4.2.5-82.el7.centos.x86_647/7

Installed:
dhcp.x86_64 12:4.2.5-83.el7.centos.1

Dependency Updated:
dhclient.x86_64 12:4.2.5-83.el7.centos.1dhcp-common.x86_64 12:4.2.5-83.el7.centos.1
dhcp-libs.x86_64 12:4.2.5-83.el7.centos.1

Complete!

配置DHCP服务

[root@kickstart ~]# cd /etc/dhcp/
[root@kickstart dhcp]# ls
dhclient.ddhclient-exit-hooks.ddhcpd6.confdhcpd.confscripts
[root@kickstart dhcp]# cat dhcpd.conf
#
# DHCP Server Configuration file.
#see /usr/share/doc/dhcp*/dhcpd.conf.example
#see dhcpd.conf(5) man page
#
[root@kickstart dhcp]# mv dhcpd.conf dhcpd.conf0622
[root@kickstart dhcp]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example dhcpd.conf
[root@kickstart dhcp]# ll
total 12
drwxr-xr-x. 2 root root6 Jun 10 00:09 dhclient.d
drwxr-xr-x. 2 root root28 Jun 22 10:51 dhclient-exit-hooks.d
-rw-r--r--1 root root120 Jun 10 00:09 dhcpd6.conf
-rw-r--r--1 root root3262 Jun 22 10:59 dhcpd.conf
-rw-r--r--1 root root117 Jun 10 00:09 dhcpd.conf0622
drwxr-x---2 root dhcpd28 Jun 22 10:51 scripts

在dhcpd.conf增加如下配置

subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.101 192.168.20.200;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 192.168.20.254;
option broadcast-address 192.168.20.255;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.20.100;
filename "pxelinux.0";
}

开启服务,并设为开机自动启动;

[root@kickstart ~]# cd /etc/dhcp/
[root@kickstart dhcp]# ls
dhclient.ddhclient-exit-hooks.ddhcpd6.confdhcpd.confscripts
[root@kickstart dhcp]# cat dhcpd.conf
#
# DHCP Server Configuration file.
#see /usr/share/doc/dhcp*/dhcpd.conf.example
#see dhcpd.conf(5) man page
#
[root@kickstart dhcp]# mv dhcpd.conf dhcpd.conf0622
[root@kickstart dhcp]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example dhcpd.conf
[root@kickstart dhcp]# ll
total 12
drwxr-xr-x. 2 root root6 Jun 10 00:09 dhclient.d
drwxr-xr-x. 2 root root28 Jun 22 10:51 dhclient-exit-hooks.d
-rw-r--r--1 root root120 Jun 10 00:09 dhcpd6.conf
-rw-r--r--1 root root3262 Jun 22 10:59 dhcpd.conf
-rw-r--r--1 root root117 Jun 10 00:09 dhcpd.conf0622
drwxr-x---2 root dhcpd28 Jun 22 10:51 scripts

在dhcpd.conf增加如下配置

subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.101 192.168.20.200;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 192.168.20.254;
option broadcast-address 192.168.20.255;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.20.100;
filename "pxelinux.0";
}

DHCP配置完成;安装tftp-server服务;【CentOS7.9安装配置KickStart】

[root@kickstart ~]# yum install tftp-server xinetd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package tftp-server.x86_64 0:5.2-22.el7 will be installed
---> Package xinetd.x86_64 2:2.3.15-14.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================
PackageArchVersionRepositorySize
==============================================

    推荐阅读