# 进入 system-view(所有配置都在 system-view 模式下)
<Huawei> system-view

# 关闭域名解析(避免误等待)
[H] undo dns resolve
# 备用(若上面报错,试):[H] undo ip domain-lookup

# 控制台超时设置为 0 分 0 秒
[H] user-interface console 0
[H-ui-console0] authentication-mode password
[H-ui-console0] set authentication password cipher P@ssw0rd
[H-ui-console0] idle-timeout 0 0
[H-ui-console0] quit

# VTY(远程)只允许通过密码登录(先允许密码,以便我们后续导入公钥)
[H] user-interface vty 0 4
[H-ui-vty0-4] authentication-mode password
[H-ui-vty0-4] set authentication password cipher P@ssw0rd
[H-ui-vty0-4] protocol inbound ssh
[H-ui-vty0-4] idle-timeout 0 0
[H-ui-vty0-4] quit

# 开启 SSH 服务(常见命令)
[H] stelnet server enable
# 备用(若报错):[H] ssh server enable

# 创建本地超级管理员(通用备份账号与密码)
[H] local-user admin privilege level 15
[H] local-user admin password irreversible-cipher P@ssw0rd
[H] local-user admin service-type ssh
# 说明:此账号用于在必要时用密码登录(便于初始导入公钥/故障恢复)
 

# 进入 system-view
[H] public-key local create rsa 2048        # 若你想在设备上创建密钥对(可选)
# 导入外部公钥(把 INSIDEPC 的 id_rsa.pub 内容粘贴进来)
[H] public-key local import rsa <key-name>
# (替代)某些版本:
[H] local-user admin public-key ssh rsa 
#   然后粘贴公钥内容(终端会要求粘贴)
 

[ACSW1] interface GigabitEthernet0/0/1
[ACSW1-GigabitEthernet0/0/1] port link-type access
[ACSW1-GigabitEthernet0/0/1] port default vlan 20
[ACSW1-GigabitEthernet0/0/1] stp edged-port enable
[ACSW1-GigabitEthernet0/0/1] quit
 

[CORESW1] interface Eth-Trunk 1
[CORESW1-Eth-Trunk1] mode lacp
[CORESW1-Eth-Trunk1] port link-type trunk
[CORESW1-Eth-Trunk1] port trunk allow-pass vlan 10 20 99
[CORESW1-Eth-Trunk1] quit

[CORESW1] interface GigabitEthernet0/0/4
[CORESW1-GigabitEthernet0/0/4] eth-trunk 1
[CORESW1-GigabitEthernet0/0/4] undo shutdown
[CORESW1-GigabitEthernet0/0/4] quit

[CORESW1] interface GigabitEthernet0/0/5
[CORESW1-GigabitEthernet0/0/5] eth-trunk 1
[CORESW1-GigabitEthernet0/0/5] undo shutdown
[CORESW1-GigabitEthernet0/0/5] quit
 

[Huawei] stp mode mstp
[Huawei] stp region-configuration
[Huawei-mst-region] region-name WSC2024
[Huawei-mst-region] instance 1 vlan 10 20
[Huawei-mst-region] active region-configuration
 

# VLAN10
[CORESW1] interface Vlanif10
[CORESW1-Vlanif10] vrrp vrid 10 virtual-ip 10.10.10.1
[CORESW1-Vlanif10] vrrp vrid 10 priority 120
[CORESW1-Vlanif10] quit

# VLAN20
[CORESW1] interface Vlanif20
[CORESW1-Vlanif20] vrrp vrid 20 virtual-ip 10.10.20.1
[CORESW1-Vlanif20] vrrp vrid 20 priority 120
[CORESW1-Vlanif20] quit

# VLAN99
[CORESW1] interface Vlanif99
[CORESW1-Vlanif99] vrrp vrid 99 virtual-ip 10.10.99.1
[CORESW1-Vlanif99] vrrp vrid 99 priority 120
[CORESW1-Vlanif99] quit


//优先级越高越优先

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐