Skip to content

Instantly share code, notes, and snippets.

@auriza
Created April 12, 2020 02:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save auriza/d63c6b01b3035bd5a1009d8fab0e2120 to your computer and use it in GitHub Desktop.
Save auriza/d63c6b01b3035bd5a1009d8fab0e2120 to your computer and use it in GitHub Desktop.
Huawei router and switch configuration notes.

Huawei Routing & Switching

VRP OS

Set IP address

?
system-view
  sysname R1
  int g0/0/0
    ip addr 10.1.1.254 24
    disp this
^Z
disp ip int brief
ping 10.1.1.1
save

Set password

system
  user-int con 0
    set auth pass [simple|cipher] [PASSWORD]
    auth pass
    disp this
  header login info "Welcome to Huawei router."
  header shell info "Password correct."

Telnet login

system
  user-int vty 0 4
    set auth pass cipher [PASSWORD]
    auth pass
    user priv level 15
    disp this

Switch

disp mac-addr
system
  stp mode stp
  stp priority [0,4096,8192,..]
  stp root primary                     -> pri: 0
  stp root secondary                   -> pri: 4096
  disp stp
  disp stp brief

Router

Static Routing

disp ip routing-table
disp ip int brief

ip route-static [DEST] [MASK] [NEXTHOP] [preference [N]]
    # default preference -> direct:0, ospf:10, static:60, rip:100
  • Load balancing: same dest, equal cost
  • Floating (backup) route: same dest, diff cost (preference)
  • Default route: dest 0.0.0.0/0

OSPF

ospf 1 [router-id X.X.X.X]
  area 0
    network [NETID] [WILDCARD]
    network [NETID] [WILDCARD]
  silent-int e0/0/0
  disp this

disp ospf peer [brief]
disp ospf lsdb
disp ospf 1 int g0/0/0

disp ip routing [proto ospf]
disp ip int brief

int g0/0/0
  ospf cost [N]                     N = 10^8 / bandwidth
  ospf auth md5 1 [PASSWORD]
reset ospf process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment