DHCP服务
文章目录
一、DHCP服务是什么
前言介绍:DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)是一个局域网的网络协议,使用UDP协议工作, 主要有两个用途:给内部网络或网络服务供应商自动分配IP地址,给用户或者内部网络管理员作为对所有计算机作中央管理的手段,在RFC 2131中有详细的描述。DHCP有3个端口,其中UDP67和UDP68为正常的DHCP服务端口,分别作为DHCP Server和DHCP Client的服务端口;546号端口用于DHCPv6 Client,而不用于DHCPv4,是为DHCP failover服务,这是需要特别开启的服务,DHCP failover是用来做“双机热备”的。
二、DHCP简介
1.DHCP介绍
DHCP 应用层协议,动态主机配置协议
作用:为网络中的主机自动分配IP信息
DHCP服务端
软件:dhcp
/etc/dhcp/dhcpd.conf # 配置文件路径
三、配置DHCP服务
1.关闭SElinux、防火墙、配置时间同步
时间同步
ntpdate 192.168.0.1
关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# systemctl mask firewalld.service
关闭SElinux安全机制
[root@localhost ~]# vim /etc/sysconfig/selinux
[root@localhost ~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled # 修改disabled
# SELINUXTYPE= can take one of three values:
# targeted