Huawei VRP vs H3C Comware: CLI Command Comparison - 夜莺博客

Huawei VRP vs H3C Comware: CLI Command Comparison

Huawei VRP and H3C Comware are two of the most widely deployed switch operating systems in the world, and they look almost identical at first glance because both were influenced by the same command-line heritage. The prompts, the system-view model and the general display philosophy match closely - but the details differ enough to break a config that you copy blindly from one vendor to the other. This article maps the most common day-to-day commands between Huawei VRP and H3C Comware so engineers who support both brands can switch context without friction.

Because most networks also contain Cisco hardware somewhere, the mapping below includes a third column. That turns the article into something more useful than a two-sided cheat sheet: for any single task you can see what all three platforms call it, which is exactly what you need when you are translating a design document written for one vendor into a deployment built with another.

Entering Configuration Mode

Both platforms use a user view and a system view, and both create the same style of prompts:

<Quidway>system-view     ! Huawei: enter system view
[Quidway] sysname SW1    ! set hostname (same on H3C)

<H3C>system-view         ! H3C: enter system view
[H3C] sysname SW1

One small difference: older H3C Comware versions use super password for privilege-level authentication while Huawei VRP uses super password plus AAA-based local-user models - the user management hierarchy is where the two CLIs start to diverge.

Cisco begins differently: enable moves you from user EXEC to privileged EXEC, and configure terminal opens the global configuration context. Huawei and H3C collapse those two steps into the user-view to system-view transition, so a translated runbook often has one fewer line on the Chinese platforms than on the Cisco original.

The Master Command Mapping Table

Read the table by row, not by column. Each row is one task; the cells are how three platforms describe the same intent.

Task Huawei VRP H3C Comware Cisco IOS
Enter configuration context system-view system-view configure terminal
Set hostname sysname SW1 sysname SW1 hostname SW1
Create a VLAN vlan 10 vlan 10 vlan 10
Access-port mode port link-type access port link-type access switchport mode access
Put a port in a VLAN port default vlan 10 port access vlan 10 switchport access vlan 10
Trunk-port mode port link-type trunk port link-type trunk switchport mode trunk
Allowed VLAN list port trunk allow-pass vlan 10 20 port trunk permit vlan 10 20 switchport trunk allowed vlan 10,20
Native VLAN / PVID port trunk pvid vlan 10 port trunk pvid vlan 10 switchport trunk native vlan 10
Layer 3 VLAN interface interface Vlanif10 interface Vlan-interface10 interface Vlan10
Static default route ip route-static 0.0.0.0 0 192.168.100.254 ip route-static 0.0.0.0 0 192.168.100.254 ip route 0.0.0.0 0.0.0.0 192.168.100.254
Create an aggregation interface Eth-Trunk 1 interface Bridge-Aggregation 1 interface Port-channel1
Make the bundle LACP mode lacp-static link-aggregation mode dynamic channel-group 1 mode active
Add a member port eth-trunk 1 port link-aggregation group 1 channel-group 1 mode active
Interface description description Uplink-To-Core description Uplink-To-Core description Uplink-To-Core
Enable a shutdown port undo shutdown undo shutdown no shutdown
Negate a command undo <command> undo <command> no <command>
Show running config display current-configuration display current-configuration show running-config
Show startup config display startup display startup show startup-config
Save the configuration save (prompts) save force write memory
Reset saved config reset saved-configuration reset saved-configuration erase startup-config
Reboot the device reboot reboot reload
Version and device status display version display version show version
Interface summary display interface brief display interface brief show ip interface brief
MAC address table display mac-address display mac-address show mac address-table
Ping / trace ping / tracert ping / tracert ping / traceroute
STP mode stp mode rstp stp mode rstp spanning-tree mode rapid-pvst
STP bridge priority stp priority 4096 stp priority 4096 spanning-tree vlan 10 priority 4096
STP port cost stp cost 20000 stp cost 20000 spanning-tree vlan 10 cost 4

Two patterns jump out of that table. First, Huawei and H3C agree on far more rows than they disagree on - the family resemblance is real. Second, where they disagree, the disagreement is almost always about a verb rather than a structure: allow-pass against permit, default vlan against access vlan, save against save force. Cisco, by contrast, disagrees structurally as well: it needs switchport prefixes, uses no instead of undo, and separates the STP instance from the port command.

VLAN Creation and Port Assignment

VLAN creation is essentially identical; interface assignment differs in wording:

! Huawei VRP
[Quidway] vlan 10
[Quidway-vlan10] quit
[Quidway] interface GigabitEthernet0/0/1
[Quidway-GigabitEthernet0/0/1] port link-type access
[Quidway-GigabitEthernet0/0/1] port default vlan 10

! H3C Comware
[H3C] vlan 10
[H3C-vlan10] port GigabitEthernet1/0/1 to GigabitEthernet1/0/24
[H3C] interface GigabitEthernet1/0/1
[H3C-GigabitEthernet1/0/1] port link-type access
[H3C-GigabitEthernet1/0/1] port access vlan 10

Note the two naming conventions: Huawei calls the L3 VLAN interface Vlanif10, H3C calls it Vlan-interface10. Bulk port assignment inside a Huawei VLAN view uses port GigabitEthernet x to y, while H3C historically does this from the VLAN view as well but with its own interface slot numbering (1/0/N on H3C fixed switches vs 0/0/N on many Huawei models).

The interface numbering difference breaks more migration scripts than any verb change. A generated configuration that refers to GigabitEthernet0/0/1 will be rejected on H3C, and the error will point at a port that does not exist rather than at the naming scheme. Check the slot layout on the target platform before pasting anything.

Trunk Port Configuration

Both use port link-type trunk, but the allowed-VLAN verbs differ:

! Huawei VRP
port link-type trunk
port trunk pvid vlan 10
port trunk allow-pass vlan 10 20 30

! H3C Comware
port link-type trunk
port trunk pvid vlan 10
port trunk permit vlan 10 20 30

Huawei uses allow-pass, H3C uses permit; everything else in the trunk statement is nearly identical, including the PVID concept.

One operational warning that applies to both: the allowed-VLAN list is absolute, not additive. If you add VLAN 40 by typing the full list again you are fine, but if you type only vlan 40 you have just removed 10, 20 and 30 from the trunk. Cisco engineers run into exactly the same trap with switchport trunk allowed vlan against add.

Link Aggregation and Spanning Tree

! Huawei VRP - static LACP bundle
interface Eth-Trunk 1
 mode lacp-static
interface GigabitEthernet0/0/23
 eth-trunk 1

! H3C Comware - dynamic LACP bundle
interface Bridge-Aggregation 1
 link-aggregation mode dynamic
interface GigabitEthernet1/0/23
 port link-aggregation group 1

Three different nouns, one concept. Huawei calls the bundle an Eth-Trunk, H3C calls it a Bridge-Aggregation, and Cisco calls it a Port-channel. On all three platforms the member port is configured with a single command that points at the bundle, and the bundle itself takes the LACP mode. The naming carries over to the IPv4/IPv6 and STP views, which is where scripts most often fail: a regex that rewrites Eth-Trunk to Bridge-Aggregation also has to handle Eth-Trunk1.100 style sub-interface names.

Layer 3 and Default Route

! Huawei VRP
[Quidway] interface Vlanif100
[Quidway-Vlanif100] ip address 192.168.100.1 24
[Quidway] ip route-static 0.0.0.0 0 192.168.100.254

! H3C Comware
[H3C] interface Vlan-interface100
[H3C-Vlan-interface100] ip address 192.168.100.1 24
[H3C] ip route-static 0.0.0.0 0 192.168.100.254

Both accept the shorter prefix-length notation (24) on modern releases, and static routing syntax is the same.

Reading the Output

Configuration syntax is only half the job - the other half is knowing what the show output is telling you, and this is where the platforms feel genuinely different.

  • Huawei display interface GigabitEthernet0/0/1 reports the port's working mode, negotiated speed and duplex, the link-type, the PVID, and separate input/output rate and error counters. The link-type and PVID lines are the fastest way to confirm an access or trunk decision actually took effect.
  • H3C display interface GigabitEthernet1/0/1 uses the same Current state and Line protocol state concept but prints a "Link: ADM - administratively down" banner at the top when the port is shut, which is the first thing to look for after a change.
  • Huawei and H3C display interface brief list physical and protocol state, utilisation in and out, and error counters in one compact table. A port that is UP physically but DOWN at the protocol level is a VLAN or STP problem, not a cabling problem.
  • Cisco show ip interface brief gives Status and Protocol columns with the same logic; the naming differs but the diagnostic pattern - physical up, protocol down - transfers directly.
  • display current-configuration interface GigabitEthernet0/0/1 (Huawei/H3C) prints only that interface's effective configuration, which is a much faster way to confirm a change than scrolling the whole running configuration.

The useful habit across all three platforms is to look for the pair of states rather than one. A port that is down in both states is a physical or administrative issue; up physically but down at the protocol level points to VLAN, STP or aggregation membership. That single decision tree works identically on VRP, Comware and IOS.

Saving, Resetting and Viewing

  • Save: Huawei save (prompts to confirm); H3C save force (skips the prompt).
  • View running config: both use display current-configuration.
  • Version/device status: display version, display device, display interface are identical on both.
  • Clear startup config: Huawei reset saved-configuration; H3C reset saved-configuration (same command, then reboot without saving).
  • Undo everything: both use the undo keyword to negate a command.

The save step is where a translated runbook fails most quietly. Huawei and H3C keep the running configuration separate from the startup file exactly as Cisco does, so a completed configuration that is never saved disappears at the next reboot. On Huawei the interactive confirmation is easy to mis-type over a scripted session; on H3C the force keyword exists precisely so automation can skip the prompt.

Migration Checklist

When you are moving configurations between the two brands, translate the port VLAN verbs (default vlan vs access vlan), the VLAN interface naming (Vlanif vs Vlan-interface), the trunk verb (allow-pass vs permit), and the interface numbering convention first - those four differences cover the vast majority of migration mistakes.

Add two more checks if Cisco is in the mix: the undo versus no keyword, and the fact that Cisco requires switchport prefixes on access and trunk commands that Huawei and H3C issue bare. With those six rules you can translate the bulk of an access-layer configuration by hand in a few minutes, then let the platform reject whatever is left.

Related reading: 华为交换机 VLAN Access/Trunk/Hybrid 配置(中文), H3C Comware vs Huawei VRP command mapping, H3C vs Huawei command comparison and Huawei H3C Cisco command equivalents.

Original article: Master the basic command configurations of Huawei, H3C, Ruijie and Cisco switches