找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3051|回复: 0

华为交换机启用DHCP功能的配置实例

[复制链接]

19

主题

3

回帖

67

积分

注册会员

积分
67
发表于 2024-1-7 17:05:02 | 显示全部楼层 |阅读模式
华为交换机启用DHCP功能的配置实例:

预期效果描述:
  VLAN100中的PC终端DHCP获得IP为192.168.100.X
操作如下:
1、[HuaWei]dhcp enable    ##开启dhcp功能
2、[HuaWei]ip pool VLAN100_DHCP    ##创建一个名字为VLAN100_DHCP的地址池
[HuaWei-ip pool VLAN100_DHCP]
3、进入新创建的VLAN100_DHCP地址池,配置地址池的网段192.168.100.0,网关192.168.100.254,dns114.114.114.114,如下:
[HuaWei-ip pool VLAN100_DHCP]network 192.168.100.0 mask 255.255.255.0
[HuaWei-ip pool VLAN100_DHCP]gateway-list 192.168.100.254
[HuaWei-ip pool VLAN100_DHCP]dns-list 114.114.114.114
4、自定义DHCP的IP租期为0天1小时
[HuaWei-ip pool VLAN100_DHCP]lease day 0 hour 1 minute 0
5、在vlanif接口下,设置dhcp获取方式为global
[HuaWei-ip pool VLAN100_DHCP]dhcp select global
6、备注:自定义某此IP地址不对外分配,方法如下
[HuaWei-ip pool VLAN100_DHCP]excluded-ip-address 192.168.100.126 192.168.100.127




查看DHCP分配情况:

<Huawei>dis ip pool name vlan100_dhcp ?  
  X.X.X.X   Start IP address to be display
  all       Detail information
  conflict  Information of conflict IP address
  expired   Information of expired IP address
  used      Information of used IP address
  |         Matching output
  <cr>      
<Huawei>dis ip pool name vlan100_dhcp used
  Pool-name      : vlan10_dhcp
  Pool-No        : 0
  Lease          : 0 Days 1 Hours 0 Minutes
  Domain-name    : -
  DNS-server0    : 114.114.114.114
  NBNS-server0   : -               
  Netbios-type   : -               
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.100.254  
  Mask           : 255.255.255.0
  VPN instance   : --
-----------------------------------------------------------------------------
         Start           End     Total  Used  Idle(Expired)  Conflict  Disable
-----------------------------------------------------------------------------
    192.168.100.1  192.168.100.254   253     3        247(0)         0        3
-----------------------------------------------------------------------------

  Network section :
  --------------------------------------------------------------------------
  Index              IP               MAC      Lease   Status  
  --------------------------------------------------------------------------
    250  192.168.100.251    5489-984b-0c9d        998   Used      
    251  192.168.100.252    5489-9842-62ae        998   Used      
    252  192.168.100.253    5489-9896-5ca9        998   Used      
  --------------------------------------------------------------------------

<Huawei>


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|333cm ( 京ICP备16037542号 )

GMT+8, 2025-7-1 20:26 , Processed in 0.085056 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表