Huawei:VRP: Difference between revisions

From Cheatsheet
Jump to navigationJump to search
No edit summary
Line 138: Line 138:
==== VLANs ====
==== VLANs ====
<syntaxhighlight >
<syntaxhighlight >
# Display all VLANs and the interfaces they're used on
display vlan
# Show all defined VLANs
display vlan summary
</syntaxhighlight>
[[Category:Cheatsheet]]
'''Versatile Routing Platform''' for Huawei network devices.
* https://random-it-blog.de/huawei/huawei-cloudengine-s5735-base-configuration/
== Basics ==
=== Connecting via Console [Windows] ===
# Plug a '''Console cable''' into the Cisco switch and connect the cable to your laptop/whatever. Best type of cable to use is USB to Console;
# Check Windows "Device Manager" - "Ports (COM & LPT)" to view what COM port is in use;
# Use a Serial client (such as '''Putty''') to connect to the switch by filling in the correct COM port;
# In the opened CLI, you may have to press Enter to see the first CLI output.
You may have to modify the Serial interface settings in your Serial client depending on the switch you're connecting with.
<pre>
https://support.huawei.com/enterprise/en/doc/EDOC1100137934/f86aae6a/logging-in-through-a-console-port
Cloud Engine switches/routers need:
- 9600 baud
- 8 data bits
- 1 stop bit
- no parity
- no flow control
</pre>
=== Commandline ===
==== Basics ====
* https://support.huawei.com/enterprise/en/doc/EDOC1000178166/c1bb51ce/entering-command-views
<syntaxhighlight>
# Quit the current view or quit the session if in User view
quit
# Enter System view from User view mode to perform switch configuration
system-view
# Enter Interface view for interface 10GE1/0/40
interface 10GE1/0/40
# Enter user view mode from any other mode
return
# Shutdown a port
shutdown
# Bring up a shutdown interface
undo shutdown
# Use the "run" command to execute a User view command within System view mode
run display version
# Display the configuration of the current view (can be used in any view, including Interface view)
display this
# Enter diagnose view from system-view [DANGER]
diagnose
# Use "?" to list all available commands in any EXEC mode
?
# Also use the "?" key to show available parameters to any command
display current-configuration ?
</syntaxhighlight>
<pre>
Use the TAB key for command auto-completion when you have typed in sufficient keys.
Use the UP and DOWN keys to 'scroll' through any previous commands you've executed.
Ctrl + W = Delete word on the left
Alt  + D = Delete word on the right
Ctrl + U = Delete the entire line you've typed
</pre>
== Checks ==
=== Common ===
<syntaxhighlight>
# Show basic system information (User view)
display version
# Show the time
display clock
# Display latest 10 commands entered during current session
display history-command
# Display security risks and recommended actions
display security risk
</syntaxhighlight>
=== Hardware ===
<syntaxhighlight>
# Display hardware modules and current status
display health
</syntaxhighlight>
=== Configuration ===
<syntaxhighlight>
# Show the switches' current configuration
display current-configuration
# Show the configuration that will be used for the next reboot
display saved-configuration
# Compare the saved configuration to the current configuration (User view)
compare configuration
# Show the current configuration for interface 10GE1/0/1
display current-configuration interface 10GE1/0/1
# Display all interface configurations
display current-configuration interface
</syntaxhighlight>
=== Logs ===
<syntaxhighlight>
# Display logs
display logbuffer
# Display logs starting from a specific date
display logbuffer starttime 2023/10/02,10:27:00
# Display logs for a specific log severity level
display logbuffer level 4
# Display 10 logs
display logbuffer size 10
# Combine parameters to filter for logs
display logbuffer level 4 size 10
</syntaxhighlight>
=== Network ===
==== Common ====
<syntaxhighlight>
# Ping IP 8.8.8.8
ping 8.8.8.8
</syntaxhighlight>
==== VLANs ====
<syntaxhighlight>
# Display all VLANs and the interfaces they're used on
# Display all VLANs and the interfaces they're used on
display vlan
display vlan
Line 146: Line 292:


==== Interfaces ====
==== Interfaces ====
<syntaxhighlight >
<syntaxhighlight>
# Show shorthand summary of switchport-state, down/up status, utilization and errors
# Show shorthand summary of switchport-state, down/up status, utilization and errors
display interface brief
display interface brief
Line 170: Line 316:
# Show an interfaces' configuration, but also include default configurations (INTERFACE VIEW)
# Show an interfaces' configuration, but also include default configurations (INTERFACE VIEW)
display this include-default
display this include-default
</syntaxhighlight>
== Configuration ==
=== Common ===
<syntaxhighlight>
# Save the switches' configuration (user view)
save
# Change the system name to sw02
sysname sw02
# Configure the switches' domain
dns domain brammerloo.nl
# Configure Dutch time ;)
clock timezone CEST add 01:00:00
clock daylight-saving-time METDST repeating 02:00 last Sun Mar 02:00 last Sun Oct 03:00
# Disable logs, traps and debugs from being output directly to your terminal
undo terminal monitor
</syntaxhighlight>
==== Banner ====
<syntaxhighlight>
header login information %
*************************************************************\
*========================= COMPANY  =========================*\
*                                                            *\
*                UNAUTHORISED ACCESS PROHIBITED !            *\
*                                                            *\
*                                                            *\
**************************************************************%
</syntaxhighlight>
=== Network ===
==== Interfaces ====
<syntaxhighlight>
# Clear the configuration for interface 10GE1/0/48
clear configuration interface 10GE1/0/48
# Select interface range 10GE1/0/33 to 10GE1/0/48
interface range 10GE1/0/33 to 10GE1/0/48
#
</syntaxhighlight>
===== LACP / eth-trunk =====
<syntaxhighlight>
interface Eth-Trunk97
</syntaxhighlight>
===== Switch-stack / VPC =====
====== sw1 ======
Create virtual stack-ports
<syntaxhighlight>
interface stack-port 1/2
interface stack-port 2/2
</syntaxhighlight>
Associate physical interfaces with the stack
<syntaxhighlight>
interface 10GE1/0/47
port mode stack
stack-port 1/1
description Core: sw2 10GE1/0/47 [10Gbps]
port crc-statistics trigger error-down
</syntaxhighlight>
<syntaxhighlight>
interface 10GE1/0/48
port mode stack
stack-port 1/2
description Core: sw2 10GE1/0/48 [10Gbps]
port crc-statistics trigger error-down
</syntaxhighlight>
</syntaxhighlight>



Revision as of 13:27, 3 October 2023

Versatile Routing Platform for Huawei network devices.

Basics

Connecting via Console [Windows]

  1. Plug a Console cable into the Cisco switch and connect the cable to your laptop/whatever. Best type of cable to use is USB to Console;
  2. Check Windows "Device Manager" - "Ports (COM & LPT)" to view what COM port is in use;
  3. Use a Serial client (such as Putty) to connect to the switch by filling in the correct COM port;
  4. In the opened CLI, you may have to press Enter to see the first CLI output.

You may have to modify the Serial interface settings in your Serial client depending on the switch you're connecting with.

https://support.huawei.com/enterprise/en/doc/EDOC1100137934/f86aae6a/logging-in-through-a-console-port
Cloud Engine switches/routers need:
- 9600 baud
- 8 data bits
- 1 stop bit
- no parity
- no flow control

Commandline

Basics

# Quit the current view or quit the session if in User view
quit

# Enter System view from User view mode to perform switch configuration
system-view

# Enter Interface view for interface 10GE1/0/40
interface 10GE1/0/40

# Enter user view mode from any other mode
return

# Shutdown a port
shutdown

# Bring up a shutdown interface
undo shutdown

# Use the "run" command to execute a User view command within System view mode
run display version

# Display the configuration of the current view (can be used in any view, including Interface view)
display this

# Enter diagnose view from system-view [DANGER]
diagnose

# Use "?" to list all available commands in any EXEC mode
?

# Also use the "?" key to show available parameters to any command
display current-configuration ?
Use the TAB key for command auto-completion when you have typed in sufficient keys.

Use the UP and DOWN keys to 'scroll' through any previous commands you've executed.

Ctrl + W = Delete word on the left
Alt  + D = Delete word on the right
Ctrl + U = Delete the entire line you've typed

Checks

Common

# Show basic system information (User view)
display version

# Show the time
display clock

# Display latest 10 commands entered during current session
display history-command

# Display security risks and recommended actions
display security risk

Hardware

# Display hardware modules and current status
display health

Configuration

# Show the switches' current configuration
display current-configuration

# Show the configuration that will be used for the next reboot
display saved-configuration

# Compare the saved configuration to the current configuration (User view)
compare configuration

# Show the current configuration for interface 10GE1/0/1
display current-configuration interface 10GE1/0/1

# Display all interface configurations
display current-configuration interface

Logs

# Display logs
display logbuffer

# Display logs starting from a specific date
display logbuffer starttime 2023/10/02,10:27:00

# Display logs for a specific log severity level
display logbuffer level 4

# Display 10 logs
display logbuffer size 10

# Combine parameters to filter for logs
display logbuffer level 4 size 10

Network

Common

# Ping IP 8.8.8.8
ping 8.8.8.8

VLANs

# Display all VLANs and the interfaces they're used on
display vlan

# Show all defined VLANs
display vlan summary

Versatile Routing Platform for Huawei network devices.

Basics

Connecting via Console [Windows]

  1. Plug a Console cable into the Cisco switch and connect the cable to your laptop/whatever. Best type of cable to use is USB to Console;
  2. Check Windows "Device Manager" - "Ports (COM & LPT)" to view what COM port is in use;
  3. Use a Serial client (such as Putty) to connect to the switch by filling in the correct COM port;
  4. In the opened CLI, you may have to press Enter to see the first CLI output.

You may have to modify the Serial interface settings in your Serial client depending on the switch you're connecting with.

https://support.huawei.com/enterprise/en/doc/EDOC1100137934/f86aae6a/logging-in-through-a-console-port
Cloud Engine switches/routers need:
- 9600 baud
- 8 data bits
- 1 stop bit
- no parity
- no flow control

Commandline

Basics

# Quit the current view or quit the session if in User view
quit

# Enter System view from User view mode to perform switch configuration
system-view

# Enter Interface view for interface 10GE1/0/40
interface 10GE1/0/40

# Enter user view mode from any other mode
return

# Shutdown a port
shutdown

# Bring up a shutdown interface
undo shutdown

# Use the "run" command to execute a User view command within System view mode
run display version

# Display the configuration of the current view (can be used in any view, including Interface view)
display this

# Enter diagnose view from system-view [DANGER]
diagnose

# Use "?" to list all available commands in any EXEC mode
?

# Also use the "?" key to show available parameters to any command
display current-configuration ?
Use the TAB key for command auto-completion when you have typed in sufficient keys.

Use the UP and DOWN keys to 'scroll' through any previous commands you've executed.

Ctrl + W = Delete word on the left
Alt  + D = Delete word on the right
Ctrl + U = Delete the entire line you've typed

Checks

Common

# Show basic system information (User view)
display version

# Show the time
display clock

# Display latest 10 commands entered during current session
display history-command

# Display security risks and recommended actions
display security risk

Hardware

# Display hardware modules and current status
display health

Configuration

# Show the switches' current configuration
display current-configuration

# Show the configuration that will be used for the next reboot
display saved-configuration

# Compare the saved configuration to the current configuration (User view)
compare configuration

# Show the current configuration for interface 10GE1/0/1
display current-configuration interface 10GE1/0/1

# Display all interface configurations
display current-configuration interface

Logs

# Display logs
display logbuffer

# Display logs starting from a specific date
display logbuffer starttime 2023/10/02,10:27:00

# Display logs for a specific log severity level
display logbuffer level 4

# Display 10 logs
display logbuffer size 10

# Combine parameters to filter for logs
display logbuffer level 4 size 10

Network

Common

# Ping IP 8.8.8.8
ping 8.8.8.8

VLANs

# Display all VLANs and the interfaces they're used on
display vlan

# Show all defined VLANs
display vlan summary

Interfaces

# Show shorthand summary of switchport-state, down/up status, utilization and errors
display interface brief

# Show detailed interface information such as input/output packets, CRC errors, discards and more
display interface

# Display detailed information for interface 10GE1/0/48 such as input output, CRC errors, discards and more
display interface 10GE1/0/48

# Show brief interface information and status for all Ethernet interface
display interface Ethernet brief

# Show the recovery status of an interface in an error/down state
display error-down recovery

# Show counter information for all interfaces
display counters

# Show counters for a specific interface
display counters interface 10GE1/0/20

# Show an interfaces' configuration, but also include default configurations (INTERFACE VIEW)
display this include-default

Configuration

Common

# Save the switches' configuration (user view)
save

# Change the system name to sw02
sysname sw02

# Configure the switches' domain
dns domain brammerloo.nl

# Configure Dutch time ;)
clock timezone CEST add 01:00:00
clock daylight-saving-time METDST repeating 02:00 last Sun Mar 02:00 last Sun Oct 03:00

# Disable logs, traps and debugs from being output directly to your terminal
undo terminal monitor

header login information %
*************************************************************\
*========================= COMPANY  =========================*\
*                                                            *\
*                UNAUTHORISED ACCESS PROHIBITED !            *\
*                                                            *\
*                                                            *\
**************************************************************%

Network

Interfaces

# Clear the configuration for interface 10GE1/0/48
clear configuration interface 10GE1/0/48

# Select interface range 10GE1/0/33 to 10GE1/0/48
interface range 10GE1/0/33 to 10GE1/0/48

#
LACP / eth-trunk
interface Eth-Trunk97


Switch-stack / VPC
sw1

Create virtual stack-ports

interface stack-port 1/2
interface stack-port 2/2


Associate physical interfaces with the stack

interface 10GE1/0/47
 port mode stack
 stack-port 1/1
 description Core: sw2 10GE1/0/47 [10Gbps]
 port crc-statistics trigger error-down
interface 10GE1/0/48
 port mode stack
 stack-port 1/2
 description Core: sw2 10GE1/0/48 [10Gbps]
 port crc-statistics trigger error-down

Configuration

Common

# Save the switches' configuration (user view)
save

# Change the system name to sw02
sysname sw02

# Configure the switches' domain
dns domain brammerloo.nl

# Configure Dutch time ;)
clock timezone CEST add 01:00:00
clock daylight-saving-time METDST repeating 02:00 last Sun Mar 02:00 last Sun Oct 03:00

# Disable logs, traps and debugs from being output directly to your terminal
undo terminal monitor

header login information %
*************************************************************\
*========================= COMPANY  =========================*\
*                                                            *\
*                UNAUTHORISED ACCESS PROHIBITED !            *\
*                                                            *\
*                                                            *\
**************************************************************%

Network

Interfaces

# Clear the configuration for interface 10GE1/0/48
clear configuration interface 10GE1/0/48

# Select interface range 10GE1/0/33 to 10GE1/0/48
interface range 10GE1/0/33 to 10GE1/0/48

#
LACP / eth-trunk
interface Eth-Trunk97


Switch-stack / VPC
sw1

Create virtual stack-ports

interface stack-port 1/2
interface stack-port 2/2


Associate physical interfaces with the stack

interface 10GE1/0/47
 port mode stack
 stack-port 1/1
 description Core: sw2 10GE1/0/47 [10Gbps]
 port crc-statistics trigger error-down
interface 10GE1/0/48
 port mode stack
 stack-port 1/2
 description Core: sw2 10GE1/0/48 [10Gbps]
 port crc-statistics trigger error-down