Huawei CLI Cheatsheet

Huawei CLI Cheatsheet

General Commands

CommandDescription
system-view
Enter configuration mode
display current-configuration
View current configuration
display saved-configuration
View saved configuration
save
Save configuration
display version
System version info
undo XXX
Cancel configuration
display interface
View interfaces

VLAN & Switching

CommandDescription
vlan batch 10 20 30
Create multiple VLANs
interface Vlanif 10
Configure VLAN interface
port link-type access
Set port as access
port default vlan 10
Assign VLAN to port
display vlan
View VLANs
stp enable
Enable STP on switch

Routing

CommandDescription
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
Add static route
ospf 1
Enable OSPF process 1
area 0
Set OSPF area
network 192.168.0.0 0.0.0.255
Add network to OSPF
display ip routing-table
View routing table

BGP

CommandDescription
bgp 65001
Enable BGP with ASN 65001
peer 192.168.1.2 as-number 65002
Add BGP neighbor
network 10.0.0.0 255.0.0.0
Advertise network in BGP

IP Services / Security

CommandDescription
ipsec proposal huawei-prop
Create IPsec proposal
ipsec policy huawei-policy 10 isakmp
Create IPsec policy
display ipsec sa
View IPsec SA
display acl all
View all ACLs
save
Save configuration after setup