華為交換機初始化配置


華為交換機初始化配置

華為交換機清除配置:
<HUAWEI>reset saved-configuration
用戶視圖下執行清除配置
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y
配置將被刪除以重新配置,選擇Y

<HUAWEI>reboot
Info: The system is now comparing the configuration, please wait.
Warning: The configuration has been modified, and it will be saved to the next startup saved-configuration file . Continue? [Y/N]:n
不保存到下一個啟動配置文件中,選擇N

Info: If want to reboot with saving diagnostic information, input 'N' and then execute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y
系統將重新啟動,選擇Y

華為交換機初始配置:
<HUAWEI>system-view
進入全局配置視圖

[HUAWEI]sysname HW-Switch-1
配置交換機名字

[HW-Switch-1]header login information "welcome Huawei"
配置當接入到交換機時顯示的信息

[HW-Switch-1]header shell information "welcome to you"
配置當用戶登錄到交換機時所顯示的信息

華為交換機AAA配置:

創建AAA模版及域:
[HW-Switch-1]aaa
登錄至AAA認證管理視圖

[HW-Switch-1-aaa]authentication-scheme HW-Authentication
創建名稱為 HW-Authentication 的認證模版

[HW-Switch-1-aaa-authen-HW-Authentication]authentication-mode local
設置認證模式為 本地身份認證

[HW-Switch-1-aaa]authorization-scheme HW-Authorization
創建名稱為 HW-Authorization 的授權模版

[HW-Switch-1-aaa-author-HW-Authorization]authorization-mode local
設置授權模式為 本地身份授權

[HW-Switch-1-aaa]domain Huawei
設置域名為 Huawei 的域

[HW-Switch-1-aaa-domain-huawei]authentication-scheme HW-Authentication
設置此域的認證方式調用 HW-Authentication 模版

[HW-Switch-1-aaa-domain-huawei]authorization-scheme HW-Authorization
設置此域的授權方式調用 HW-Authorization 模版

查看AAA配置信息:

[HW-Switch-1-aaa]display this
#
aaa
 authentication-scheme default
 authentication-scheme radius
  authentication-mode radius
 authentication-scheme HW-Authentication
 authorization-scheme default
 authorization-scheme HW-Authorization
 accounting-scheme default
 local-aaa-user password policy administrator
  password expire 0
 domain default
  authentication-scheme radius
  radius-server default
 domain default_admin
  authentication-scheme default
 domain huawei
  authentication-scheme HW-Authentication
  authorization-scheme HW-Authorization
  radius-server default
 local-user admin password irreversible-cipher $1a$![TmGV%wiT$*l:/"l,Z~.xEU/(XiofIsR:zE8[&lQXUH380DDoT$
 local-user admin privilege level 15
 local-user admin service-type terminal http

查看Domain域配置信息:

[HW-Switch-1-aaa]display domain name huawei

  Domain-name                     : huawei
  Domain-index                    : 2
  Domain-state                    : Active
  Authentication-scheme-name      : HW-Authentication
  Accounting-scheme-name          : default
  Authorization-scheme-name       : HW-Authorization
  Service-scheme-name             : -
  RADIUS-server-template          : default
  Accounting-copy-RADIUS-template : -
  HWTACACS-server-template        : -

華為交換機本地用戶配置:

1、創建用戶:
[HW-Switch-1-aaa]local-user admin-root@huawei password cipher SQjd@123.com
在AAA視圖下創建用戶名為  admin-root@huawei  密碼為 SQjd@123.com
此用戶將作為超級管理員賬戶

[HW-Switch-1-aaa]local-user admin-user@huawei password cipher SQjd@123.com
在AAA視圖下創建用戶名為  admin-user@huawei  密碼為 SQjd@123.com
此用戶將作為普通管理員賬戶

[HW-Switch-1-aaa]local-user admin-guest@huawei password cipher SQjd@123.com
在AAA視圖下創建用戶名為  admin-guest@huawei  密碼為 SQjd@123.com
此用戶將作為來賓賬戶

2、配置用戶授權級別:
[HW-Switch-1-aaa]local-user admin-root@huawei privilege level 15
配置用戶 admin-root@huawei 的授權級別為15級

[HW-Switch-1-aaa]local-user admin-user@huawei privilege level 2
配置用戶 admin-user@huawei 的授權級別為2級

[HW-Switch-1-aaa]local-user admin-guest@huawei privilege level 1
配置用戶 admin-guest@huawei 的授權級別為1級

3、設置用戶服務類型:



[HW-Switch-1-aaa]local-user admin-root@huawei service-type telnet
在AAA視圖下 設置用戶 admin-root@huawei 的服務類型為 telnet ——就是說這個賬戶可以使用telnet登錄

[HW-Switch-1-aaa]local-user admin-user@huawei service-type telnet
在AAA視圖下 設置用戶 admin-user@huawei 的服務類型為 telnet 

[HW-Switch-1-aaa]local-user admin-guest@huawei service-type telnet
在AAA視圖下 設置用戶 admin-guest@huawei 的服務類型為 telnet 

[HW-Switch-1-aaa]local-user shaolun password cipher SQjd@123.com privilege level 15
設置用戶 shaolun 密碼為 SQjd@123.com 授權級別為15級

[HW-Switch-1-aaa]local-user shaolun service-type terminal
設置用戶shaolun 的服務類型為 terminal  ——通過console 口的終端訪問
4、配置調用AAA認證:
[HW-Switch-1]user-interface console 0
進入console 接口

[HW-Switch-1-ui-console0]authentication-mode aaa
設置console 接口的認證模式為 AAA 認證

[HW-Switch-1]user-interface vty 0 4
進入VTY遠程接口

[HW-Switch-1-ui-vty0-4]authentication-mode aaa
設置遠程訪問認證模式為 AAA 認證
5、啟用Telnet服務:
[HW-Switch-1]telnet server enable
全局視圖下啟用telnet服務

[HW-Switch-1]user-interface vty 0 4
進入VTY遠程接口

[HW-Switch-1-ui-vty0-4]protocol inbound telnet
在VTY接口視圖下 手動啟用遠程telnet服務


注: 正常情況下,通過此配置后,就可以通過telnet的形式的對交換機進行配置了,但是隨着設備安全性能的提升,新版本默認是取消telnet接入的。當出現無法telnet的時候,我們可以通過以下的方法來排查問題

1、檢查路由是否可達。在遠端ping交換機的IP地址,發現是可以ping通的。

2、檢查交換機上的telnet服務是否開啟

華為交換機本身默認不支持telnet協議了,要在VTY視圖下手動允許telnet協議接入

protocol inbound telnet


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM