开启dhcp服务

在虚拟中操作

1.rht-vmctl reset  desktop  ##在主机中

2.vim /etc/sysconfig/network-scripts/ifcfg-eth0 ##编辑网络配置

开启dhcp服务

3.systemctl restart network    ##重启网络配置

4.yum install dncp.x86_64 -y ##安装dhcp服务组件

开启dhcp服务

5.cd /etc/dhcp/ 

6.ls  ##查看有没有文件

开启dhcp服务

7.vim dhcpd.conf

8.cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf   ##复制示例文档

9. vim dhcpd.conf  ##编辑配置文档

   option domain-name "example.com";

   option domain-name-servers 114.114.114.114;

开启dhcp服务

   # No service will be given on this subnet, but declaring it helps the
    # DHCP server to understand the network topology.
   
   
   
   
    # This is a very basic subnet declaration.
      subnet 172.25.254.0 netmask 255.255.255.0 {
      range 172.25.254.200 172.25.254.210;

      option routers 172.25.254.250;

开启dhcp服务

10.systemctl start dhcpd  ##开启dhcp服务

11.systemctl enable dhcpd ##系统启用

测试:

rht-vmctl  reset  server ##在主机中

rht-vmctl  view  server  ##在主机中

ifconfig

开启dhcp服务