H3C vs Huawei CLI Command Comparison: A Practical Mapping Table - 夜莺博客

H3C vs Huawei CLI Command Comparison: A Practical Mapping Table

H3C Comware and Huawei VRP share a common ancestor in the Chinese networking industry, so their CLIs look almost identical - but the differences are exactly where engineers get burned: interface naming conventions, VLAN port commands, save options and view structures. If you maintain both brands (very common in Chinese enterprise networks), this command mapping table will save you from typing the wrong command on the wrong device. Every command below is real VRP and Comware syntax, verified on Huawei S5700/CE switches and H3C S5130/S5560 switches.

Why the Two CLIs Look Identical

The resemblance is not a coincidence. H3C was spun out of Huawei's enterprise networking business in a joint venture with 3Com, and both product lines descend from the same internal codebase that became Comware on one side and VRP (Versatile Routing Platform) on the other. Two decades of independent development later, the syntax still overlaps by roughly eighty percent. The remaining twenty percent is what this article is about.

Practically, that means an engineer fluent in one platform can operate the other at maybe seventy percent efficiency on day one, and will make the same four mistakes every time:

  • Typing port default vlan on an H3C switch (correct on Huawei, rejected on Comware - Comware wants port access vlan).
  • Typing port trunk permit vlan on a Huawei switch (correct on H3C, rejected on VRP - VRP wants allow-pass).
  • Referring to GigabitEthernet0/0/1 on an H3C switch, where the first slot number is always 1.
  • Assuming save behaves the same way. It does not: Comware prompts for confirmation differently and offers save force for scripted use.

Knowing these four by heart removes most of the pain. The rest of the article is the detailed mapping.

Reading the Prompt: View Hierarchy Compared

Both CLIs use a hierarchical view model, and both show the current view in the prompt between square brackets. The naming differs slightly, which matters when you read documentation or write expect scripts.

View Huawei VRP prompt H3C Comware prompt
User view <Huawei> <H3C>
System view [Huawei] [H3C]
Interface view [Huawei-GigabitEthernet0/0/1] [H3C-GigabitEthernet1/0/1]
VLAN view [Huawei-vlan10] [H3C-vlan10]
Protocol view (OSPF) [Huawei-ospf-1] [H3C-ospf-1]

The mechanics of moving between views are identical on both platforms: system-view enters the top configuration view, quit steps back one level, and return or Ctrl+Z jumps straight back to user view. The one habit worth breaking is filling the screen with quit commands - return is faster and works from any depth.

System Views and Basic Navigation

Function Huawei VRP H3C Comware
Enter system view system-view system-view
Exit one level quit quit
Return to user view return return
Set hostname sysname SW-A sysname SW-A
Display version display version display version
Display current config display current-configuration display current-configuration
Save configuration save save force
Delete saved config reset saved-configuration reset saved-configuration
Undo a command undo <cmd> undo <cmd>

A word on save. On Huawei VRP, typing save asks whether to save to the current file and requires a Y confirmation; in a script you feed it with a pipe or use the fully specified form save configuration.cfg. On H3C Comware, save prompts to confirm the filename and the overwrite, while save force writes startup.cfg without asking - which is exactly what you want in an automation script. Mixing these up in a scripted provisioning flow is a classic cause of a device that boots with an empty configuration.

Interface Naming Differences (Watch Out!)

The biggest trap: the two vendors number interfaces differently.

  • Huawei: interface GigabitEthernet0/0/1 (slot/port, subcard 0)
  • H3C: interface GigabitEthernet1/0/1 (frame/slot/port - first frame number is 1)
  • Huawei S5700 10G: interface XGigabitEthernet0/0/1
  • H3C 10G: interface Ten-GigabitEthernet1/0/1

For 40G ports: Huawei uses 40GE0/0/1, H3C uses FortyGigE1/0/1. Both vendors support the short form GE0/0/1 / GE1/0/1.

The naming scheme encodes the chassis layout. Huawei reads it as slot/subcard/port, where a fixed 1U access switch reports every port as slot 0. H3C reads it as frame/slot/port, and the frame number starts at 1 even on a standalone box. On a stacked or chassis system the numbers start to vary, so the reliable rule is to run display interface brief and copy the exact names rather than guessing.

VLAN Configuration Mapping

Function Huawei VRP H3C Comware
Create VLAN vlan 10 vlan 10
Create VLAN range vlan batch 10 to 20 vlan batch 10 to 20
Name VLAN name Sales name Sales
Set access port port link-type access port link-type access
Assign access VLAN port default vlan 10 port access vlan 10
Set trunk port port link-type trunk port link-type trunk
Allow VLANs on trunk port trunk allow-pass vlan 10 20 port trunk permit vlan 10 20
Native VLAN on trunk port trunk pvid vlan 1 port trunk pvid vlan 1
Show VLANs display vlan display vlan

Note the two classic differences: Huawei uses port default vlan, H3C uses port access vlan for the access VLAN, and Huawei uses allow-pass, H3C uses permit on trunks.

Both platforms also support a third port type - hybrid - which is far more common in Chinese enterprise deployments than in Cisco environments:

Function Huawei VRP H3C Comware
Set hybrid port port link-type hybrid port link-type hybrid
Tagged VLAN on hybrid port hybrid tagged vlan 10 port hybrid vlan 10 tagged
Untagged VLAN on hybrid port hybrid untagged vlan 10 port hybrid vlan 10 untagged
PVID on hybrid port hybrid pvid vlan 10 port hybrid pvid vlan 10

Look closely at the hybrid syntax: Huawei puts the keyword before the VLAN list (tagged vlan 10), H3C puts it after (vlan 10 tagged). This reversal catches out even experienced engineers, and it is the single most useful thing to memorise from this table.

A Complete Access and Trunk Example on Both Platforms

Here is the same small design configured on each vendor: VLAN 10 and 20 created, port 1 as an access port in VLAN 10, port 2 as an access port in VLAN 20, and port 24 as a trunk carrying both.

# Huawei VRP
system-view
sysname SW-A
vlan batch 10 20
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 20
interface GigabitEthernet0/0/24
 port link-type trunk
 port trunk allow-pass vlan 10 20
quit
save
# H3C Comware
system-view
sysname SW-A
vlan batch 10 20
interface GigabitEthernet1/0/1
 port link-type access
 port access vlan 10
interface GigabitEthernet1/0/2
 port link-type access
 port access vlan 20
interface GigabitEthernet1/0/24
 port link-type trunk
 port trunk permit vlan 10 20
quit
save force

Diff the two blocks and the changes are exactly the three documented differences: interface numbers, the access VLAN keyword, the trunk permit keyword, and the save variant. Everything else is byte-identical. That is the whole story of migrating between these two CLIs.

For a deeper treatment of the port types themselves, see 华为交换机 VLAN 配置详解:Access、Trunk 与 Hybrid 端口.

Routing and Link Aggregation

Function Huawei VRP H3C Comware
Static route ip route-static 10.1.0.0 24 192.168.1.1 ip route-static 10.1.0.0 24 192.168.1.1
Default route ip route-static 0.0.0.0 0 192.168.1.1 ip route-static 0.0.0.0 0 192.168.1.1
Create Eth-Trunk interface Eth-Trunk1 interface Bridge-Aggregation1
Add member (LACP) eth-trunk 1 (in interface) link-aggregation group 1 mode dynamic
Show routes display ip routing-table display ip routing-table
Show trunk display eth-trunk 1 display link-aggregation verbose

Huawei aggregates with Eth-Trunk, H3C with Bridge-Aggregation - a very common source of confusion in multi-vendor networks.

The difference runs deeper than the name. Huawei offers two aggregation modes: manual (static, no protocol) and LACP. H3C uses the terms static and dynamic, and the configurable knobs live in different places. A Huawei LACP member is configured from inside the physical interface with eth-trunk 1, while the H3C equivalent is entered from the physical interface with link-aggregation group 1 mode dynamic or from the aggregation interface itself. Both platforms default to a load-balancing algorithm based on source and destination MAC by default and offer a src-dst-ip style option you should set explicitly for routed traffic.

Layer 3 aggregation also differs in naming. Huawei uses Eth-Trunk with a sub-interface or direct IP; H3C uses Route-Aggregation for Layer 3 and Bridge-Aggregation for Layer 2 - a distinction Huawei does not make. Detailed configuration for both is covered in 华为交换机 Eth-Trunk 链路聚合配置:手工模式与 LACP 模式.

Dynamic Routing: OSPF Side by Side

OSPF configuration is unusually portable between the two platforms. The process identifier and router-id are set at the same level, and network statements take the same wildcard-less format.

# Huawei VRP
ospf 1 router-id 10.0.0.1
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255

# H3C Comware
ospf 1 router-id 10.0.0.1
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255

The differences appear in the verification and in the interface-level parameters. Huawei shows neighbours with display ospf peer and interfaces with display ospf interface; H3C uses display ospf peer and display ospf interface as well, but the output column layout differs. Where it really diverges is VRRP, where Huawei's virtual IP assignment is vrrp vrid 1 virtual-ip 10.1.1.1 and H3C's is vrrp vrid 1 virtual-ip 10.1.1.1 - identical in this case, but Huawei adds vrrp vrid 1 priority 120 versus H3C's vrrp vrid 1 priority 120 with a different default preemption behaviour.

User Management, AAA and SSH

Function Huawei VRP H3C Comware
Create local user local-user admin password irreversible-cipher ... local-user admin password simple ...
Set user privilege local-user admin privilege level 15 local-user admin authorization-attribute user-role network-admin
Enable SSH stelnet server enable ssh server enable
Generate RSA key rsa local-key-pair create public-key local create rsa
VTY lines user-interface vty 0 4 line vty 0 4

This is one of the least similar areas of the two platforms. Huawei's privilege model is numeric (0-15, Cisco-like), while H3C moved to named user roles (network-admin, network-operator) on newer Comware 7 releases. If you are writing a provisioning template that covers both, treat user management as vendor-specific code rather than trying to template around it.

File Systems and Configuration Management

Both platforms place files in a flat flash directory and use dir to list them, but the startup file handling differs:

# Huawei
display startup
startup saved-configuration flash:/vrpcfg.zip
display saved-configuration

# H3C
display startup
startup saved-configuration flash:/startup.cfg
display saved-configuration

Huawei's default saved configuration is a compressed vrpcfg.zip; H3C's is a plain-text startup.cfg. Backup scripts written for one vendor need only the filename changed, but note that H3C's plain-text file can be read and diffed directly, while Huawei's zip requires extraction. Both support tftp and ftp client commands for pushing backups to a server; both support copy and delete with the same syntax.

Stacking and Virtualization: iStack/CSS vs IRF

Huawei's stacking technology is called iStack for box switches and CSS for chassis; H3C's is IRF (Intelligent Resilient Framework). All three provide the same outcome - multiple physical devices managed as one logical device - but the configuration keywords are entirely different, and unlike the VLAN commands there is no useful pattern to carry over. Membership, priority, stack port and MAD (Multi-Active Detection) commands must be looked up per platform. Plan for that if a design document specifies stacking on both vendors' hardware.

Troubleshooting Workflow: Same Reflexes, Different Commands

Function Huawei VRP H3C Comware
Ping ping 10.0.0.1 ping 10.0.0.1
Traceroute tracert 10.0.0.1 tracert 10.0.0.1
Interface status display interface brief display interface brief
MAC table display mac-address display mac-address
Log buffer display logbuffer display logbuffer
Clear interface counters reset counters interface reset counters interface

The troubleshooting methodology transfers one-to-one; only the command names change. A useful exercise is to keep a one-page laminated card with the ten commands you actually type during an outage. For a fuller drill-down on the Huawei side, see Huawei VRP common configuration and troubleshooting commands.

Migration Checklist: Porting a Config Between the Two

  1. Extract the running config: display current-configuration on both.
  2. Rewrite all interface references to the target numbering scheme (0/0/x to 1/0/x).
  3. Replace port default vlan with port access vlan, or the reverse.
  4. Replace allow-pass with permit, or the reverse.
  5. Fix hybrid keyword order: tagged vlan X versus vlan X tagged.
  6. Rewrite aggregation: Eth-Trunk to Bridge-Aggregation or Route-Aggregation.
  7. Rewrite user management and privilege levels from scratch.
  8. Change the save command to the target platform's form.
  9. Load on a lab unit of the target model and diff display current-configuration against intent.
  10. Only then touch production, with a rollback file ready.

Steps 3, 4 and 5 are mechanical and can be scripted with a handful of regular expressions. Step 7 cannot, which is why every migration checklist should end with a manual review rather than a blind find-and-replace.

The Four Mistakes to Never Make Again

  • Typing an interface name from the other vendor. GE0/0/1 exists on Huawei, GE1/0/1 exists on H3C, and neither will error if it happens to match an unrelated port - you will simply configure the wrong interface.
  • Using save in a scripted flow on H3C and hanging on the confirmation prompt.
  • Assuming hybrid VLAN keyword order is the same. It is not, and the error message is not always helpful.
  • Copying a trunk command and losing VLAN traffic silently because a permit was written as allow-pass and rejected at a moment you did not notice.

Translation Cheat Sheet

  • Huawei port default vlan ↔ H3C port access vlan
  • Huawei allow-pass ↔ H3C permit
  • Huawei Eth-Trunk ↔ H3C Bridge-Aggregation
  • Huawei GE0/0/1 ↔ H3C GE1/0/1 (frame numbering)
  • Huawei save ↔ H3C save force
  • Huawei stelnet server enable ↔ H3C ssh server enable
  • Huawei user-interface vty ↔ H3C line vty
  • Huawei tagged vlan X ↔ H3C vlan X tagged

Related Reading

More CLI fundamentals: H3C Comware CLI basics and Huawei VRP common commands. Two other articles extend this mapping exercise: H3C Comware vs Huawei VRP command mapping and Huawei, H3C and Cisco command equivalents, the latter being useful when a design document mixes all three vendors.

原文链接:https://www.h3c.com/cn/Support/Resource_Center/