H3C 的 Vlan-interface
H3C 的 VLAN 网关接口叫 Vlan-interface:名字带连字符,编号就是 VLAN 号,例如 Vlan-interface10 是 VLAN 10 的三层接口。对比一下三厂命名:华为 Vlanif10、H3C Vlan-interface10、思科 Vlan10。H3C 三层交换机默认开启 IP 转发;配置完成后接口状态是 Down 时,先检查该 VLAN 里有没有 Up 的成员端口。
基本信息
| 适用设备 | H3C 三层交换机(对照华为 VRP、思科 IOS) |
|---|---|
| 接口命名 | Vlan-interface10(H3C);Vlanif10(华为);Vlan10(思科) |
| 配置命令 | interface Vlan-interface N + ip address |
| Down 的常见原因 | 该 VLAN 内没有 Up 的成员端口 |
| 默认路由 | ip route-static 0.0.0.0 0 下一跳 |
| 查看 | display ip interface brief、display interface Vlan-interface N |
典型使用场景
- 园区 VLAN 网关部署(三层交换机为核心的典型场景)
- 跨 VLAN 互通:三层交换机做网关实现互访
- 与静态路由或 OSPF 配合发布网段
- 迁移脚本时批量替换接口命名
- 排障:VLAN 内无成员端口导致网关接口 Down
H3C Comware
H3C Comware
[H3C] interface Vlan-interface 10
[H3C-Vlan-interface10] ip address 192.168.10.1 24
[H3C-Vlan-interface10] quit
<H3C> display ip interface brief | include Vlan
<H3C> display interface Vlan-interface 10 # 看状态与是否有成员端口
[H3C] ip route-static 0.0.0.0 0 192.168.1.254 # 默认路由示例华为 VRP(对照)
华为 VRP(对照)
[Huawei] interface Vlanif 10
[Huawei-Vlanif10] ip address 192.168.10.1 24
<Huawei> display ip interface brief | include Vlanif思科 IOS(对照)
思科 IOS(对照)
SW(config)# interface Vlan10
SW(config-if)# ip address 192.168.10.1 255.255.255.0
SW(config)# ip routing # 三层交换机需确认路由功能已开启
SW# show ip interface brief | include Vlan三厂网关接口对照
| 项目 | H3C Comware | 华为 VRP | 思科 IOS |
|---|---|---|---|
| 接口名 | Vlan-interface10 | Vlanif10 | Vlan10 |
| 创建方式 | interface Vlan-interface 10 | interface Vlanif 10 | interface Vlan 10 |
| 配置地址 | ip address 192.168.10.1 24 | ip address 192.168.10.1 24 | ip address 192.168.10.1 255.255.255.0 |
| 状态依赖 | VLAN 内需有 Up 成员端口 | 同左 | 同左 |
| 查看 | display ip interface brief | display ip interface brief | show ip interface brief |
Vlan-interface 编号要与业务 VLAN 严格对应:编号写错会生成一个与业务无关的三层接口,接口长期 Down 却不容易看出原因,配错编号是这类问题的典型来源。
命名差异是脚本迁移最常见的失败点:H3C 的接口名带连字符,从华为模板迁移时批量替换容易漏掉,命令会直接执行失败或配到错误接口上。
跨 VLAN 互通的验证方法:在本机上分别 ping 两个网段的地址,再让两端终端互 ping;同时确认终端配置的网关就是对应 Vlan-interface 的地址,而不是其它设备的地址。