《DHCP命令合集全套.docx》由会员分享,可在线阅读,更多相关《DHCP命令合集全套.docx(7页珍藏版)》请在课桌文档上搜索。
1、DHCP命令合集DHCP全局地址池system-viewSysnamedhcpenable使能DHCP服务Sysnamedhcpserverip-pool0创建标识为0的DHCP普通模式地址池Sysname-dhcp-pool-Onetwork192.168.8.0mask255.255.255.0配置DHCP地址池0动态分配的地址范围为192.168.8.0/24Sysname-dhcp-pool-Ogateway-list10.110.1.99配置DHCP地址池0为DHCP客户端分配的网关地址为10.110.1.99Sysname-dhcp-pool-Odns-list10.1.1.254
2、配置DHCP地址池0为DHCP客户端分配的DNS服务器地址为10.LL254Sysname-dhcp-pool-Oexpiredday1hour2minute3配置地址池。的IP地址租用有效期为1天2小时3分。Sysname-dhcp-pool-Odomain-酉己置DHCP地址池0为DHCP客户端分配的域名后缀为Sysname-dhcp-pool-Onetbios-typeb-node酉己置DHCP地址池0为DHCP客户端分配的NetBIOS节点类型为b-nodeSysname-dhcp-pool-Onbns-list10.12.1.99配置DHCP地址池0为DHCP客户端分配WINS服务器
3、地址为10.12.L99Sysnamedhcpserverforbidden-ip10.110.1.110.110.1.63将10.110.1.1到10.110.1.63之间的IP地址保留,不参与地址自动分配Sysname-dhcp-pool-Ostatic-bindip-address10.1.1.1mask255.255.255.0Sysname-dhcp-pool-Ostatic-bindmac-address0000-e03f-0305将MAC地址为OooO-eO3f-O3O5的PC机与IP地址10.1.1.1绑定,掩码为255.255.255.0Sysname-Vlan-interf
4、aceldhcpselectserverglobal-pool配置VLAN接口1工作在DHCP服务器模式Sysnamedhcpserverdetect使能伪DHCP服务器检测功能DHCP全局地址池查看命令displaydhcpserverconflict显示DHCP的地址冲突统计信息displaydhcpserverexpired显示所有DHCP地址池中的租约超期信息displaydhcpserverfree-ip显示DHCP地址池的可用地址信息displaydhcpserverforbidden-ip显示DHCP地址池中不参与自动分配的IP地址displaydhcpserverip-in-u
5、se显示所有DHCP地址池的地址绑定信息displaydhcpserverstatistics显示DHCP服务器的统计信息displaydhcpservertree显示所有DHCP地址池的信息DHCP扩展地址池system-viewSysnamedhcpserverip-pool0extended配置扩展模式地址池0Sysname-dhcp-pool-Onetworkiprange192.168.8.1192.168.8.150动态分配的地址范围为192.168.8.1至IJ192.168.8.150Sysname-dhcp-pool-Onetworkmask255.255.255.0配置扩展
6、模式地址池0动态分配的IP地址掩码为255.255.255.0Sysname-dhcp-pool-Oforbidden-ip192.168.1.3192.168.1.10配置DHCP扩展模式地址池O中不参与分配的IP地址为192.168.1.3和192.168.1.10其他比如网关比如DNS同上Sysname-Vlan-interfaceldhcpserverapplyip-pool0配置VLAN接口1引用DHCP扩展模式地址池0必须要输入,否则在扩展DHCP模式下客户端获取不到IP!DHCP中继模式# 配置DHCP服务器组1的服务器IP地址为l.l.l.losystem-viewSysnam
7、edhcprelayserver-group1ip1.1.1.1# 配置VLAN接口1与DHCP服务器组1的归属关系。system-viewSysnameinterfacevlan-interface1Sysname-Vlan-interfaceldhcprelayserver-select1# 配置VLAN接口1工作在DHCP中继模式。system-viewSysnameinterfacevlan-interface1Sysname-Vlan-interfaceldhcpselectrelay# 使能伪DHCP服务器检测功能。system-viewSysnamedhcprelayserver
8、-detectDHCP中继模式查看命令displaydhcprelay显示所有接口对应的DHCP服务器组的信息displaydhcprelayinformation显示DHCP中继上Option82的配置信息displaydhcprelaysecurity显示DHCP中继的用户地址表项信息displaydhcprelaysecuritystatistics显示DHCP中继用户地址表项的统计信息displaydhcprelaysecuritytracker显示DHCP中继动态用户地址表项的定时刷新周期displaydhcprelayserver-group显示DHCP服务器组中服务器的IP地址d
9、isplaydhcprelaystatistics显示所有DHCP服务器组的相关报文统计信息之和resetdhcprelaystatistics清除所有DHCP服务器组的DHCP中继的统计信息DHCP客服端# 指定VLAN接口1使用DHCP方式获取IP地址。system-viewSysnameinterfacevlan-interface1Sysname-Vlan-interfacelipaddressdhcp-allocdisplaydhcpClient显示所有接口的DHCP客户端相关信息DHCPSnoopingSysnamedhcp-snooping使能DHCPSnooping功能syst
10、em-viewSysnameinterfaceGigabitEthernet1/0/1Sysname-GigabitEthernetl/0/1dhcp-snoopingtrust配置以太网端口GigabitEthernet1/0/1为信任端口,并记录客户端IP地址和MAC地址的绑定关系DHCPSnooping查看命令displaydhcp-snooping显示DHCPSnooping表项信息displaydhcp-snoopinginformation显示所有接口对应的C)Ption82配置信息displaydhcp-snoopingpacketStatiStiCS显示DHCPSnoe)Ping设备上的DHCP报文统计信息displaydhcp-snoopingtrust显示信任端口信息resetdhcp-snooping清除所有的DHCPSnooping表项resetdhcp-snoopingpacketstatistics清除DHCPSnooping设备上的DHCP报文统计信息