DHCP练习
作者:互联网
标题配置dhcp实现动态分配和手动分分配方式
动态分配
服务器
①在服务器上安装dhcp服务,关闭防火墙和SELinux
[root@server ~]# yum install dhcp-server -y
[root@server ~]# systemctl stop firewalld.service
[root@server ~]# setenforce 0
②修改配置文件
[root@server ~]# vim /etc/dhcp/dhcpd.conf
:r /usr/share/doc/dhcp-server/dhcpd.conf.example
③重启服务
[root@server ~]# systemctl restart dhcpd
客户端
①修改NAT模式
②关闭防火墙和SELinux
[root@client ~]# systemctl stop firewalld.service
[root@client ~]# setenforce 0
③从新获取IP
未更新前
更行后
[root@client ~]# dhclient
dhclient(8724) is already running - exiting.
This version of ISC DHCP is based on the release available
on ftp.isc.org. Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.
Please report issues with this software via:
https://bugzilla.redhat.com/
exiting.
[root@client ~]# kill -9 8724
[root@client ~]# dhclient
手动分配 (在动态分配的基础上)
客户端
修改配置文件,重启
[root@server ~]# systemctl restart dhcpd
服务端
重新获取IP
标签:systemctl,练习,server,client,dhcpd,dhcp,DHCP,root 来源: https://blog.csdn.net/weixin_48325311/article/details/118855848