Cisco设备上设置DHCP实例

一、需求

1.同时为多个VLAN的客户机分配地址
2.VLAN内有部分地址采用手工分配的方式
3.为客户指定网关、Winsbetway live器等
4.VLAN 2的地址租用有效期限为1天,其它为3天
5.按MAC地址为特定用户分配指定的IP地址

二、最终配置如下:

ip dhcp excluded-address 10.1.1.1 10.1.1.19 //不用于动态地址分配的地址
ip dhcp excluded-address 10.1.1.240 10.1.1.254
ip dhcp excluded-address 10.1.2.1 10.1.2.19
!
ip dhcp pool global //global是pool name, 由用户指定
network 10.1.0.0 255.255.0.0 //动态分配的地址段
domain-name client.com //为客户机配置域后缀
dns-server 10.1.1.1 10.1.1.2 //为客户机配置dnsbetway live器
netbios-name-server 10.1.1.5 10.1.1.6 //为客户机配置winsbetway live器
netbios-node-type h-node //为客户机配置节点模式(影响名称解释的顺利,如h-node=先通过winsbetway live器解释...)
lease 3 //地址租用期限: 3天
ip dhcp pool vlan1
network 10.1.1.0 255.255.255.0 //本pool是global的子pool, 将从global pool继承domain-name等option
default-router 10.1.1.100 10.1.1.101 //为客户机配置默认网关
!
ip dhcp pool vlan2 //为另一VLAN配置的pool
network 10.1.2.0 255.255.255.0
default-router 10.1.2.100 10.1.2.101
lease 1
!
ip dhcp pool vlan1_john //总是为MAC地址为...的机器分配...地址
host 10.1.1.21 255.255.255.0
client-identifier 010050.bade.6384 //client-identifier=01加上客户机网卡地址
!
ip dhcp pool vlan1_tom
host 10.1.1.50 255.255.255.0
client-identifier 010010.3ab1.eac8

相关的DHCP调试命令:
no service dhcp //停止DHCPbetway live[默认为启用DHCPbetway live]
sh ip dhcp binding //显示地址分配情况
show ip dhcp conflict //显示地址冲突情况
debug ip dhcp server {events | packets | linkage} //观察DHCPbetway live器工作情况

如果DHCP客户机分配不到IP地址,常见的原因有两个。第一种情况是没有把连接客户机的端口设置为Portfast方式。MS客户机开机后检查网卡连接正常,Link是UP的,就开始发送DHCPDISCOVER请求,而此时交换机端口正在经历生成树计算,一般需要30-50秒才能进入转发状态。MS客户机没有收到DHCP SERVER的响应就会给网卡设置一个169.169.X.X的IP地址。解决的方法是把交换机端口设置为Portfast方式:CatOS(4000/5000/6000): set spantree portfast mod_num/port_num enable; IOS(2900/3500): interface ... ; spanning-tree portfast。

另外一种情况是DHCPbetway live器和DHCP工作站不在同一个VLAN,这时候通常通过设置中继ip helper-address来解决:

interface vlan1
ip address 10.1.1.254 255.255.255.0 //假设DHCPbetway live器地址为10.1.1.8
interface Vlan2
ip address 10.1.2.254 255.255.255.0
ip helper-address 10.1.1.8 //假设这是DHCP客户机所在的VLAN
 


TAG:
许可证编号:宁ICP备11000983号-1 Copyright 2010 - 2020 www.sharpinfo.cn, All Rights Reserved
betway必威登录平台锋利信息技术betway live有限公司 版权所有

betway必威登录平台-betway必威体育app-betway live

  • <tr id='b3decb'><strong id='b3decb'></strong><small id='b3decb'></small><button id='b3decb'></button><li id='b3decb'><noscript id='b3decb'><big id='b3decb'></big><dt id='b3decb'></dt></noscript></li></tr><ol id='b3decb'><option id='b3decb'><table id='b3decb'><blockquote id='b3decb'><tbody id='b3decb'></tbody></blockquote></table></option></ol><u id='b3decb'></u><kbd id='b3decb'><kbd id='b3decb'></kbd></kbd>

    <code id='b3decb'><strong id='b3decb'></strong></code>

    <fieldset id='b3decb'></fieldset>
          <span id='b3decb'></span>

              <ins id='b3decb'></ins>
                <acronym id='b3decb'><em id='b3decb'></em><td id='b3decb'><div id='b3decb'></div></td></acronym><address id='b3decb'><big id='b3decb'><big id='b3decb'></big><legend id='b3decb'></legend></big></address>

                <i id='b3decb'><div id='b3decb'><ins id='b3decb'></ins></div></i>
                <i id='b3decb'></i>
              • <dl id='b3decb'></dl>
                1. <blockquote id='b3decb'><q id='b3decb'><noscript id='b3decb'></noscript><dt id='b3decb'></dt></q></blockquote><noframes id='b3decb'><i id='b3decb'></i>