關於H3C交換機配置命令大全

H3C交換機從核心骨幹到邊緣接入,10多個系列上百款產品,全部通過中國信息產業部、Tolly Group、MetroEthernet論壇以及IPv6 Ready等權威部門的測]試和認證,下面YJBYS小編爲大家整理了關於H3C交換機配置命令大全,希望對你有所幫助。

關於H3C交換機配置命令大全

  一.用戶配置:

system-view

[H3C]super password H3C 設置用戶分級密碼

[H3C]undo super password 刪除用戶分級密碼

[H3C]localuser bigheap 123456 1 Web網管用戶設置,1(缺省)爲管理級用戶,缺省admin,admin

[H3C]undo localuser bigheap 刪除Web網管用戶

[H3C]user-interface aux 0 只支持0

[H3C-Aux]idle-timeout 2 50 設置超時爲2分50秒,若爲0則表示不超時,默認爲5分鐘

[H3C-Aux]undo idle-timeout 恢復默認值

[H3C]user-interface vty 0 只支持0和1

[H3C-vty]idle-timeout 2 50 設置超時爲2分50秒,若爲0則表示不超時,默認爲5分鐘

[H3C-vty]undo idle-timeout 恢復默認值

[H3C-vty]set authentication password 123456 設置telnet密碼,必須設置

[H3C-vty]undo set authentication password 取消密碼

[H3C]display users 顯示用戶

[H3C]display user-interface 顯示用戶界面狀態

  二.系統IP配置:

[H3C]vlan 20

[H3C]management-vlan 20

[H3C]interface vlan-interface 20 創建並進入管理VLAN

[H3C]undo interface vlan-interface 20 刪除管理VLAN接口

[H3C-Vlan-interface20]ip address 配置管理VLAN接口靜態IP地址(缺省爲)

[H3C-Vlan-interface20]undo ip address 刪除IP地址

[H3C-Vlan-interface20]ip gateway 指定缺省網關(默認無網關地址)

[H3C-Vlan-interface20]undo ip gateway

[H3C-Vlan-interface20]shutdown 關閉接口

[H3C-Vlan-interface20]undo shutdown 開啓

[H3C]display ip 顯示管理VLAN接口IP的相關信息

[H3C]display interface vlan-interface 20 查看管理VLAN的接口信息

debugging ip 開啓IP調試功能

undo debugging ip

  三客戶端配置:

[H3C-Vlan-interface20]ip address dhcp-alloc 管理VLAN接口通過DHCP方式獲取IP地址

[H3C-Vlan-interface20]undo ip address dhcp-alloc 取消

[H3C]display dhcp 顯示DHCP客戶信息

debugging dhcp-alloc 開啓DHCP調試功能

undo debugging dhcp-alloc

  四.端口配置:

[H3C]interface Ethernet0/3

[H3C-Ethernet0/3]shutdown

[H3C-Ethernet0/3]speed 100 速率,可爲10,100,1000和auto(缺省)

[H3C-Ethernet0/3]duplex full 雙工,可爲half,full和auto(缺省) 光口和匯聚後不能配置

[H3C-Ethernet0/3]flow-control 開啓流控,默認爲關閉

[H3C-Ethernet0/3]broadcast-suppression 20 設置抑制廣播百分比爲20%,可取5,10,20,100,缺省爲100,同時組播和未知單播也受此影響

[H3C-Ethernet0/3]loopback internal 內環測試

[H3C-Ethernet0/3]loopback external 外環測試,需插接自環頭,必須爲全雙工或者自協商模式

[H3C-Ethernet0/3]port link-type trunk 設置鏈路的類型爲trunk,可爲access(缺省),trunk

[H3C-Ethernet0/3]port trunk pvid vlan 20 設置20爲該trunk的缺省VLAN,默認爲1

(trunk線路兩端的PVID必須一致)

[H3C-Ethernet0/3]port access vlan 20 將當前access端口加入指定的VLAN

[H3C-Ethernet0/3]port trunk permit vlan all 允許所有的VLAN通過當前的trunk端口,可多次使用該命令

[H3C-Ethernet0/3]mdi auto 設置以太端口爲自動監測,normal(缺省)爲直通線,across爲交叉線

[H3C]link-aggregation Ethernet 0/1 to Ethernet 0/4 將1-4口加入匯聚組,1爲主端口,兩端需要同時配置,設置了端口鏡像以及端口隔離的端口無法匯聚

[H3C]undo link-aggregation Ethernet 0/1 刪除該匯聚組

[H3C]link-aggregation mode egress 配置端口匯聚模式爲根據目的MAC地址進行負荷分擔,可選爲 ingress,egress和both,缺省爲both

[H3C]monitor-port Ethernet 0/2 將該端口設置爲鏡像端口,必須先設置鏡像端口,刪除時必須先刪除被鏡像端口,而且它們不能同在一個端口,該端口不能在匯聚組中,設置新鏡像端口時,新取代舊,被鏡像不變

[H3C]mirroring-port Ethernet 0/3 to Ethernet 0/4 both 將端口3和4設置爲被鏡像端口,both爲同時監控接收和發送的報文,inbound表示僅監控接收的報文,outbound表示僅監控發送的報文

[H3C]display mirror

[H3C]display interface Ethernet 0/3

reset counters 清除所有端口的統計信息

[H3C]display link-aggregation Ethernet 0/3 顯示端口匯聚信息

[H3C-Ethernet0/3]virtual-cable-test 診斷該端口的電路狀況

  五配置:

[H3C]vlan 2

[H3C]undo vlan all 刪除除缺省VLAN外的所有VLAN,缺省VLAN不能被刪除

[H3C-vlan2]port Ethernet 0/4 to Ethernet 0/7 將4到7號端口加入到VLAN2中,此命令只能用來加access端口,不能用來增加trunk或者hybrid端口

[H3C-vlan2]port-isolate enable 打開VLAN內端口隔離特性,不能二層轉發,默認不啓用該功能

[H3C-Ethernet0/4]port-isolate uplink-port vlan 2 設置4爲VLAN2的隔離上行端口,用於轉發二層數據,只能配置一個上行端口,若爲trunk,則建議允許所有VLAN通過,隔離不能與匯聚同時配置

[H3C]display vlan all 顯示所有VLAN的詳細信息

S1550E支持基於端口的VLAN,通過創建不同的user-group來實現,一個端口可以屬於多個user-group,不屬於同一個user-group的端口不能互相通信,最多支持50個user-group

[H3C]user-group 20 創建user-group 20,默認只存在user-group 1

[H3C-UserGroup20]port Ethernet 0/4 to Ethernet 0/7 將4到7號端口加入到VLAN20中,初始時都屬於user-group 1中

[H3C]display user-group 20 顯示user-group 20的相關信息

  六.集羣配置:

S2100只能作爲成員交換機加入集羣中,加入後系統名改爲"集羣名_成員編號.原系統名"的格式.

即插即用功能通過兩個功能實現: 集羣管理協議MAC組播地址協商和管理VLAN協商

[H3C]cluster enable 啓用羣集功能,缺省爲啓用

[H3C]cluster 進入羣集視圖

[H3C-cluster]administrator-address H-H-H name switch H-H-H爲命令交換機的MAC,加入switch集羣

[switch_1.H3C-cluster]undo administrator-address 退出集羣

[H3C]display cluster 顯示集羣信息

[H3C]management-vlan 2 集羣報文只能在管理VLAN中轉發,同一集羣需在同一個管理VLAN中,需在建立集羣之前指定管理VLAN

debugging cluster