預備知識學習
以太網技術要點:ui
以太網幀-Ethernet_Ⅱspa
以太網數據幀的長度在64-518字節之間。(大於或小於則稱爲無效幀)接口
初始狀態下,交換機的MAC地址表爲空,交換機將收到的數據幀的源MAC地址和對應接口記錄到MAC地址表中,交換機根據MAC地址表將目標主機的回覆信息單播轉發給源主機。ip
交換機基本工做原理:學習,轉發,泛洪,過時(老化時間),過濾ci
交換機設備配置路由
配置console口令terminal
(密碼模式,首選):it
[Huawei] user-interface console 0io
[Huawei-ui-console0] authentication-mode password
[Huawei-ui-console0] set authentication password simple/cipher 密碼
(AAA驗證模式):
[Huawei] user-interface console 0
[Huawei-ui-console0] authentication-mode aaa
[Huawei-ui-console0] quit
[Huawei] aaa
[Huawei-aaa] local-user 用戶名 password simple/cipher 密碼
[Huawei-aaa] local-user 用戶名 service-type terminal
配置交換機設備名
[Huawei] syaname 設備名
(undo sysname則將設備名回退,undo是個好東西)
配置交換機登錄權限
用戶等級 |
命令等級 |
名稱 |
0 |
0 |
參觀級 |
1 |
0and1 |
監控級 |
2 |
0,1,and2 |
配置級 |
3~15 |
0,1,2,and3 |
管理級 |
例如,配置console的登錄權限
[Huawei-ui-console0] user privilege level 2
(undo user privilege level,回退)
配置超時時間(仍是以console口爲例)
[Huawei] user-interface console 0
[Huawei-ui-console0] idle-timeout 分鐘 秒數
配置交換機管理接口和地址
例如VLAN20爲管理VLAN,PC能和交換機的管理地址相互通信則須要進行以下配置:
[Huawei] vlan 20
[Huawei-vlan20] quit
[Huawei] interface vlanif 2
[Huawei-Vlanif2] ip address 192.168.1.1 24(255.255.255.0)
[Huawei-Vlanif2] quit
[Huawei] interface G0/0/2
[Huawei-GigabitEthernet0/0/2] port link-type access
[Huawei-GigabitEthernet0/0/2] port default vlan 20
配置交換機的網關地址(默認路由)
[Huawei] ip route-static 0.0.0.0 0.0.0.0 網關地址
配置交換機能被遠程登錄(Telnet)
先決條件:1.交換機設置好管理IP,客戶端能ping通交換機
2.必需要設置vty口令(不然客戶端會登錄失敗)
設置vty口令:
[Huawei] user-intface vty 0 ? (最多能夠設置5個vty口)
[Huawei-ui-vty0-?] authentication-mode password/aaa
(後續設置步驟請參照以前設置密碼的過程)
配置交換機的接口
[Huawei] interface G0/0/1 //進入指定的接口
[Huawei-GigabitEthernet0/0/1] descpriton 對於接口的描述 //對接口進行描述
[Huawei-GigabitEthernet0/0/1] undo negotiation auto //關閉自動協商
[Huawei-GigabitEthernet0/0/1] speed 10/100/1000 //設置端口速率
[Huawei-GigabitEthernet0/0/1] duplex half/full //設置半/全雙工模式
設置交換機的端口組
[Huawei] port-group 1 //設置端口組1
[Huawei-port-group-1] group-member e0/0/1 to e0/0/10 //對於連續端口的設置
[Huawei-port-group-1] group-member e0/0/1 e0/0/5 e0/0/10 //對於不連續端口的設置
設置交換機端口組的好處:能夠批量運行指令,節省時間。