一个网段一个池
核心 VLAN 一多,地址池就要按 VLAN 一一对应,三厂都是每个网段一个池。关键是池与网关接口的对应关系别写错:华为的接口必须显式引用全局池,思科与 H3C 按网段自动匹配,同样要求池的网段与接口网段严格一致。
基本信息
| 适用平台 | 三厂 DHCP 服务器 |
|---|---|
| 对应关系 | 一个 VLAN 对应一个池,池网段与网关一致 |
| 华为命令 | ip pool 名称,接口下 dhcp select global |
| 思科命令 | ip dhcp pool 名称,接口按网段自动匹配 |
| H3C 命令 | dhcp server ip-pool 名称,接口下 dhcp select server |
| 查看命令 | display ip pool / show ip dhcp binding / display dhcp server pool |
典型使用场景
- 办公、无线、服务器多网段共存
- 新开局一次配好所有网段的地址下发
- 扩容或迁移时批量新增地址池
- 排查某个 VLAN 长期拿不到地址
- 核对池网段与网关接口网段是否一一对应
华为 VRP
华为 VRP
ip pool OFFICE
network 192.168.10.0 mask 255.255.255.0
gateway-list 192.168.10.1
ip pool WIFI
network 192.168.20.0 mask 255.255.255.0
gateway-list 192.168.20.1
interface Vlanif10
dhcp select global # 接口显式引用全局池
interface Vlanif20
dhcp select global
display ip pool # 查看各池用量思科 IOS 与 H3C
思科 IOS 与 H3C
ip dhcp pool OFFICE
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
ip dhcp pool WIFI
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
# 接口配好同网段地址即自动匹配对应池
show ip dhcp binding
# H3C Comware
dhcp server ip-pool OFFICE
network 192.168.10.0 mask 255.255.255.0
gateway-list 192.168.10.1
interface Vlan-interface10
dhcp select server
display dhcp server pool三厂写法对照
| 环节 | 华为 VRP | 思科 IOS | H3C Comware |
|---|---|---|---|
| 建池 | ip pool 名称 | ip dhcp pool 名称 | dhcp server ip-pool 名称 |
| 网关 | gateway-list | default-router | gateway-list |
| 接口引用 | dhcp select global | 按接口网段自动匹配 | dhcp select server |
| 查看 | display ip pool | show ip dhcp binding | display dhcp server pool |
华为多池场景下接口必须显式配 dhcp select global。如果误配成接口地址池方式,接口池会优先应答,全局池看起来配置齐全却不下发地址,这是排查时最容易走偏的一类问题。
池的网段与网关接口网段必须一致。掩码写错一位就会把地址下发到别的网段,终端拿到地址却上不了网,现象与链路故障非常接近,先核对池与接口网段是否一一对应。
建池前先确认网关接口已存在并配好地址。接口不存在时服务器没有匹配的接口可以应答,池配置再正确也发不出地址,而设备侧不会主动报告这个缺失。