DHCP配置三层交换机(全局地址池&接口地址池)

DHCP配置三层交换机(全局地址池&接口地址池),第1张


一、配置环境描述

1、基于全局地址池的DHCP动态获取地址配置

[SW]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[SW]ip pool pool2          //配置地址池
Info:It's successful to create an IP address pool.
[SW-ip-pool-pool2]network 192.168.10.0 mask 24   //宣告网段
[SW-ip-pool-pool2]gateway-list 192.168.10.254    //宣告网关
[SW-ip-pool-pool2]dns-list 8.8.8.8               //宣告dns
[SW-ip-pool-pool2]lease day 10                   //宣告租期
[SW-ip-pool-pool2]q
[SW]int vlanif10
[SW-Vlanif10]dhcp select global                 //宣告DHCP选择全局
[SW-Vlanif10]q

[SW]dis ip ?
  as-path-filter       Specify regular expression access list number
  community-filter     Add a community-filter entry
  extcommunity-filter  Match BGP/VPN extended community filter
  ha                   Display information of socket HA
  host                 Host table(s)
  interface            Show information of interfaces
  ip-prefix            Specify an address prefix-list
  ipv6-prefix          Specify an IPv6 address prefix-list
  policy-based-route   Display policy based routing information
  pool                 Show IP local pool information
  prefix-limit         Prefix limit
  rd-filter            Route-distinguisher filter
  routing-table        Routing table
  socket               Display information of created sockets
  source               Source 
  statistics           Display statistics information of datagram
  vpn-instance         VPN instance information

[SW]dis ip pool 
  -----------------------------------------------------------------------
  Pool-name      : pool2
  Pool-No        : 0
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.10.254  
  Mask           : 255.255.255.0
  VPN instance   : --


  IP address Statistic
    Total       :253   
    Used        :1          Idle        :100   
    Expired     :0          Conflict    :0          Disable   :152   
[SW]
[SW]
[SW]
[SW]
[SW]
[SW]
[SW]
[SW]ip pool pool2
[SW-ip-pool-pool2]excluded-ip-address 192.168.10.11 192.168.10.99
[SW-ip-pool-pool2]q

[SW-ip-pool-pool2]dis ip pool 
  -----------------------------------------------------------------------
  Pool-name      : pool2
  Pool-No        : 0
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.10.254  
  Mask           : 255.255.255.0
  VPN instance   : --


  IP address Statistic
    Total       :253   
    Used        :1          Idle        :10    
    Expired     :0          Conflict    :0          Disable   :242   

配置实验结果: 

 2、基于接口地址池的DHCP动态获取地址配置

[SW]dhcp enable
[SW]int g0/0/2
[SW]int vlanif 20
[SW-Vlanif20]dhcp select interface     //宣告接口地址池配置
[SW-Vlanif20]dhcp server dns-list 6.6.6.6     //宣告dns
[SW-Vlanif20]dhcp server excluded-ip-address 192.168.20.101 192.168.20.253
Error:Some of addresses not be excluded are not idle,or not in the pool.   //无视此条报错,结果证明配置成功。


[SW-Vlanif20]dis ip pool ----------------------------------------------------------------------- Pool-name : pool2 Pool-No : 0 Position : Local Status : Unlocked Gateway-0 : 192.168.10.254 Mask : 255.255.255.0 VPN instance : -- ----------------------------------------------------------------------- Pool-name : vlanif20 Pool-No : 1 Position : Interface Status : Unlocked Gateway-0 : 192.168.20.254 Mask : 255.255.255.0 VPN instance : -- IP address Statistic Total :506 Used :2 Idle :109 Expired :0 Conflict :1 Disable :394 [SW-Vlanif20]dhcp server lease day 9 [SW-Vlanif20]q [SW]inter [SW]interface Vlanif20 [SW-Vlanif20]dhcp server excluded-ip-address 192.168.20.11 192.168.20.20 Error:Some of addresses not be excluded are not idle,or not in the pool. [SW]display ip pool interface vlanif20 Pool-name : vlanif20 Pool-No : 1 Lease : 9 Days 0 Hours 0 Minutes Domain-name : - DNS-server0 : 6.6.6.6 NBNS-server0 : - Netbios-type : - Position : Interface Status : Unlocked Gateway-0 : 192.168.20.254 Mask : 255.255.255.0 VPN instance : -- ----------------------------------------------------------------------------- Start End Total Used Idle(Expired) Conflict Disable ----------------------------------------------------------------------------- 192.168.20.1 192.168.20.254 253 1 20(0) 0 232 -----------------------------------------------------------------------------

实验结果:

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/589785.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-13
下一篇 2022-04-13

发表评论

登录后才能评论

评论列表(0条)

保存