========================================================================================
搭建dhcp服务器步骤
1.准备工作
=====准备lan1网段的隔离环境
=====关闭SELinux和防火墙
=====setenforce 0
=====getenforce
=====vim /etc/sysconfig/selinux
=====systemctl stop firewalld.service
=====systemctl disable firewalld.service
========================================================================================
2.配置本地yum源
=====mkdir /etc/yum.repos.d/default
=====mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/default
=====vim /etc/yum.repos.d/local.repo
=====vim---[local]
=====vim---name=localsrc
=====vim---baseurl=file:///mnt
=====vim---enabled=1
=====vim---gpgcheck=0
=====mount /dev/cdrom /mnt/
=====yum clean all
=====yum makecache
========================================================================================
3.安装dhcp工作软件
=====yum install -y dhcp
========================================================================================
4.修改本地网卡
=====vim /etc/sysconfig/network-scripts/ifcfg-eth0
=====# Generated by dracut initrd
=====vim---NAME=eth0
=====vim---ONBOOT=yes
=====vim---BOOTPROTO=none
=====vim---TYPE=Ethernet
=====vim---IPADDR=192.168.87.101
=====vim---NETMASK=255.255.255.0
=====systemctl restart network
=====systemctl restart NetworkManager
========================================================================================
5.编辑dhcp配置文件
=====vim /etc/dhcp/dhcpd.conf
subnet 192.168.87.0 netmask 255.255.255.0 {
range 192.168.87.10 192.168.87.100;
option routers 192.168.87.254;
option domain-name-servers 114.114.114.114, 8.8.8.8;
}
========================================================================================
6.启动dhcp服务
=====systemctl start dhcpd
=====systemctl enable dhcpd
=====ss -anup | grep :67
========================================================================================