1.找到服务器的安装包,并进行安装
[root@localhost Desktop]# ls /mnt
dhcp-4.2.5-27.el7.x86_64.rpm ##安装包文件
[root@localhost Desktop]# cd /mnt
[root@localhost mnt]# rpm -ivh dhcp-4.2.5-27.el7.x86_64.rpm ##安装文件
warning: dhcp-4.2.5-27.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:dhcp-12:4.2.5-27.el7 ################################# [100%] ##安装成功
[root@localhost mnt]# rpm -q dhcp ##检测是否安装成功
dhcp-4.2.5-27.el7.x86_64 ##显示安装成功
2.修改dhcp配置文件
[root@localhost mnt]# ls /etc/dhcp/
dhclient.d dhcpd6.conf dhcpd.conf
[root@localhost mnt]# cd /etc/dhcp/
[root@localhost dhcp]# cat vim dhcpd.conf
cat: vim: No such file or directory
#
# DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.example ##配置文件的模板文件
# see dhcpd.conf(5) man page
#
[root@localhost dhcp]# cp /usr/share/doc/dhcp*/dhcpd.conf.example dhcpd.conf ##将模板复制成配置文件并覆盖源文件
cp: overwrite ‘dhcpd.conf’? y
3.使用另外一台虚拟机创建动态网络,检验是否分配动态网络
注意:另外一台虚拟机检验时必须保证其不存在ip地址