本文共 1626 字,大约阅读时间需要 5 分钟。
【实验拓扑】
【基本配置】
default-router 155.1.146.4
ip dhcp excluded-address 155.1.146.4 //排除地址
如果是一个核心交换机配置DHCP,存在多个网段怎么办呢? 首选我们会在交换机上配置多个VLAN,然后给VLAN设置地址,把相应接口放入VLAN,然后再针对不同的VLAN设置不同的 pool,例如我们再增加1个Pool default-router 192.168.10.254
ip dhcp excluded-address 192.168.10.1 192.168.10.254 //排除地址
按照上图,如果R1与R6想通过R5自动获得IP地址,需要在R4上进行如下配置
ip add 155.1.146.4 255.255.255.0
ip helper-address 155.1.0.5
如何配置R6获得的IP地址就为155.1.146.6 呢?
host 155.1.146.6 255.255.255.0
client-identifier 0063.6973.636f.2d63.3030.332e.3035.6334.2e30.3030.302d.4661.302f.30
注意:以上的client-id 是路由器的,如何获取R6的client-id呢?首先上R6自动获得IP地址,然后再R5上使用如下命令,其中infinite 代表无限期,Manual代表手工设置了绑定 Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
155.1.146.1 0063.6973.636f.2d63. Mar 02 2002 12:10 AM Automatic
155.1.146.6 0063.6973.636f.2d63. Infinite Manual
CS4507R#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
192.168.8.62 0100.1558.db39 Apr 11 2012 02:58 PM Automatic
192.168.10.33 01c8.bcc8.3c05 Apr 12 2012 02:54 AM Automatic
192.168.10.35 40a6.d992.c97a Infinite
Manual 192.168.10.105 0114.8fc6.dc0e Apr 11 2012 10:26 PM Automatic
本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/993086 转载地址:http://xlkol.baihongyu.com/