華三交換機(S5130)初始化配置講解(乾貨收藏)

您真的知道怎麼初始化一臺交換機嗎?

華三交換機(S5130)初始化配置講解(乾貨收藏)

48口全光交換機

初始化交換(其他華三的交換機(比如S5554、S6520等)初始化也是類似的): 配置除了業務配置之外的其他配置,如下所示:

  • 設備命名
<code>sysname xxxx   //交換機命名(一般命名位置+設備型號)/<code>
  • telnet服務開啟
<code>telnet server enable  //開啟telnet服務/<code>
  • 啟用3A遠程服務器認證
<code>【3A表示認證、授權、審計】
//啟用TACACS認證模式:

hwtacacs scheme hzcnc
primary authentication x.x.x.x //3A服務器(主用)
primary authorization x.x.x.x //3A服務器(主用)
primary accounting x.x.x.x //3A服務器(主用)
secondary authentication x.x.x.x //3A服務器(備用)
secondary authorization x.x.x.x //3A服務器(備用)
secondary accounting x.x.x.x //3A服務器(備用)
key authentication simple xxx //xxx表示認證秘鑰
key authorization simple xxx //xxx表示認證秘鑰
key accounting simple xxx //xxx表示認證秘鑰

user-name-format without-domain
nas-ip (本機IP)

domain hzcnc //域設置
authentication login hwtacacs-scheme hzcnc local //優先3A認證,在3A認證失效的情況下進行本地認證
authorization login hwtacacs-scheme hzcnc local
accounting login hwtacacs-scheme hzcnc local
authentication super hwtacacs-scheme hzcnc
authorization command hwtacacs-scheme hzcnc local
accounting command hwtacacs-scheme hzcnc

domain default enable hzcnc //域關聯使用hzcnc域


//啟用RADIUS認證模式:

domain system //設置domain域
authentication login radius-scheme system //使用radius認證登錄
authorization login none
access-limit disable
state active
idle-cut disable
self-service-url disable
radius scheme system //設置radius認證模板 system
primary authentication x.x.x.x 1645 //3A 服務器IP
primary accounting 127.0.0.1 1646 //無效
secondary authentication x.x.x.x 1645 //備用的3A服務器IP
key authentication sim chinahcn
user-name-format without-domain
nas-ip 本機IP
authentication-mode scheme //啟用AAA
domain default enable system //設置默認域system
/<code>
  • VTY及本地賬號配置
<code>local-user admin class manage
password hash xxxx //設置本地賬號密碼
service-type telnet
authorization-attribute user-role network-admin

authorization-attribute user-role network-operator
#
super password role network-admin hash xxxx //設置super密碼
#
line vty 0 63
authentication-mode scheme //一定要關聯scheme,若設置為password表示需要本地賬號登錄,設置為None表示免賬號登錄。
user-role network-operator
#/<code>
  • 管理地址配置及默認路由配置
<code>vlan 3  //配置管理VLAN
name MANAGER_VLAN3
//配置管理地址
interface Vlan-interface3
description manager_vlan for access switch
ip address xxxx
quit
//指默認路由 ,下一跳 網關IP
ip route-static 0.0.0.0 0 xxxx /<code>
  • NTP配置
<code> clock timezone beijing add 08:00:00 //設置clock時區(東八區)
clock protocol ntp
ntp-service enable
ntp-service unicast-server x.x.x.x source Vlan-interface3 //x.x.x.x表示ntp服務器的IP,也可設置上層交換機的管理IP/<code>
  • SNMP配置
<code>//SNMP配置:
snmp-agent
snmp-agent local-engineid xxxx
snmp-agent community read xxxxx //snmp認證的團體屬性名秘鑰,只讀權限

snmp-agent community write yyyyy //snmp認證的團體屬性名秘鑰,可寫權限
snmp-agent sys-info version all
snmp-agent target-host trap address udp-domain xxxx params securityname xxxx/<code>
  • SYSLOG配置
<code>info-center enable 
info-center source default loghost log level warnings //日誌設置默認源
info-center loghost x.x.x.x facility local2 //設置日誌服務器為x.x.x.x 默認使用的端口號是UDP 514 可以跟進syslog-server修改端口號
info-center loghost x.x.x.x facility local2/<code>
  • 業務配置
<code>interface GigabitEthernet1/0/49
description xxxx
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 2 to 4094 #trunk模式,放行除了vlan1的所有vlan,一般上行鏈路做聚合,trunk模式放行需要通過的vlan。
speed 1000 //設置速率
duplex full //配置全雙工,有些UPS還得半雙工的
quit
interface GigabitEthernet1/0/49
description xxxx
port link-type access
port access vlan100 #業務口配置access模式,上行數據包打上tag標籤100,下行數據包剝離vlan標籤。
speed 1000 //設置速率
duplex full //配置全雙工,有些UPS還得半雙工的
quit /<code>

綜上所述,一臺交換機的初始化配置完畢,其中包含安全認證(3A)可以對接ISE系統或者思科的ASA、日誌記錄(syslog或者對接ELK系統)、SNMP對接Zabbix服務器進行設備電源、鏈路流量\\廣播包\\錯誤包等進行監控。這些你們都理解了嗎?有疑問可在下發處留言。

對網絡工程或者Python開發感興趣的可以加個關注,我會不定期發佈相關技術分享。


分享到:


相關文章: