温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

dhcp服务

发布时间:2020-07-14 10:10:29 来源:网络 阅读:193 作者:wx5d9d7eacf29a1 栏目:系统运维

1.服务端
(1) 配置服务器为ip静态
1.通过图形修改 :nm-connection-editor

     2.配置Yum源
     cd /etc/yum.repos.d   
     ls   
     vim  rhel_dvd.repo   配置yum源
     yum inatll dhcp        安装dhcp
     yum clean all           清空yum缓存
     3.vim /etc/dhcp/dhcpd.conf              查看配置文件

cp /usr/share/doc/dhcp/dhcpd.conf.example(配置文件模板)  复制配置文件模板到/etc/dhcp/dhcpd.conf
             5.vim /etc/dhcp/dhcpd.conf          修改配置文件

**编辑内容**
             6 # option definitions common to all supported networks...

  7 option domain-name "westos.com";                         域名

  8 option domain-name-servers 172.25.254.250;           dns地址

 9

10 default-lease-time 600;                                默认租约期限

11 max-lease-time 7200;                                  最长租约期限

12 

13 # Use this to enble / disable dynamic dns updates globally.

14 #ddns-update-style none;

15 

16 # If this DHCP server is the official DHCP server for the local

17 # network, the authoritative directive should be uncommented.

18 #authoritative;

19 

20 # Use this to send dhcp log messages to a different log file (you also

21 # have to hack syslog.conf to complete the redirection).

22 log-facility local7;                                       日志级别

23 

24 # No service will be given on this subnet, but declaring it helps the

25 # DHCP server to understand the network topology.

26 

27 

28 

29 # This is a very basic subnet declaration.

30 

31 subnet 172.25.254.0 netmask 255.255.255.0 {             设定分配ip的网络位

32   range 172.25.254.200 172.25.254.220;                   ip地址池

33   option routers 172.25.254.250;                         客户主机获得的网关

dhcp服务dhcp服务dhcp服务
客户端
1.编辑配置文件修改dhcp:vim /etc/sysconfig/network-scripts/ifcfg-eth0
将BOOTPROTO=dhcp
2.systemctl restart network 重启服务获得ip
3.3.ifconfig **查看ip

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI