linux之虚拟机安装完成后,DHCP的安装及其配置
linux-dash
 A beautiful web dashboard for Linux
 项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
  免费下载资源
免费下载资源
       ·  
 一.DHCP服务的安装
1.给虚拟机desktop添加光驱
注:添加光驱之前必须将虚拟机关闭
   
2.此时可以在的desktop虚拟机桌面查看光驱文件
   
3.在光驱里查看是否有DHCP文件
   
4.设置开启DHCP服务
--df                        ##查看光盘挂载设备
   
--mkdir rhel7.2             ##创建rhel7.2目录)
--mount /dev/sr0 /rhel7.2   ##挂载光驱至rhel7.2目录
   
--cd /etc/yum.repos.d/      ##进入此目录
--vim yum.repo              ##告诉系统DHCP服务包在哪里,本地yum源配置
   
[rhel7.2]                    ##yum源的名称,可以随便命名
name=rhel7.2                 ##yum源的描述,可以随意命名
baseurl=file:///rhel7.2     ##资源路径
gpgcheck=0                   ##不进行校验
--yum clean all              ##清除yum缓存

   
--yum repolist               ##显示软件仓库列表
   
--yum list dhcp              ##显示可以安装的DHCP服务包虚拟机
--yum install dhcp -y      ##安装dhcp服务
二,配置DHCP服务
1.编辑dhcp服务配置文件
--cd /etc/dhcp
--vim dhcpd.conf
   
配置文件让看/usr/share/doc/dhcp*/dhcpd.conf.example
--cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf  ##将这个文件复制到dhcp.conf,覆盖此文件

  --第7行 ption domain-name "example.com"
  --第8行 option domain-name-servers 172.25.254.78;

--删除26.27行
--删除34行至最后
   
更改 30subnet 172.25.254.0 netmask 255.255.255.0 {
     31 range 172.25.254.100 172.25.254.200;#设置自动给ip的范围
     32 option routers 172.25.254.78}
   
2.查看dhcp服务状态,让dhcp处于开启状态
--systemctl status dhcpd
   
--systemctl start dhcpd
--systemctl enable dhcpd
--systemctl status dhcpd
注:出现Job for dhcpd.service failed because the control process exited with error code. See "systemctl status dhcpd.service" and "journalctl -xe" for details.报错,说明dhcpd服务的配置文件有问题,仔细查看是否出现书写错误。
 GitHub 加速计划 / li / linux-dash
 GitHub 加速计划 / li / linux-dash 10
10
             2
2
             下载
下载
            
          A beautiful web dashboard for Linux
        
 
          最近提交(Master分支:1 个月前 )
 186a802e 
added ecosystem file for PM2 5 年前 
5def40a3 
Add host customization support for the NodeJS version 5 年前 
 
 新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐



所有评论(0)