Centos7下DHCP搭建

准备两台虚拟机 一台为客服机 一台为服务机
更改配置

Centos7下DHCP搭建
点击编辑更改 网络编辑
Centos7下DHCP搭建
服务端
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
[[email protected] ~]# systemctl restart network
[[email protected] ~]# ifconfig

Centos7下DHCP搭建
重启网卡
[[email protected] ~]#systemctl restart network
[[email protected] ~]#ifconfig ens33
Centos7下DHCP搭建
安装dhcp 修改配置文件
[[email protected] ~]# yum -y install dhcp
[[email protected] ~]# cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf
[[email protected] ~]# vim /etc/dhcp/dhcpd.conf
Centos7下DHCP搭建
开启服务关闭防火墙和沙盒
[[email protected] ~]# systemctl restart dhcpd
[[email protected] ~]# setenforce 0
[[email protected] ~]# systemctl stop firewalld
服务器验证
[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[[email protected] ~]# systemctl restart network
Centos7下DHCP搭建
重配IP
[[email protected] ~]# dhclient -r ens33
[[email protected] ~]# dhclient
[[email protected] ~]# ifconfig ens33
Centos7下DHCP搭建
成功