當前位置:才華齋>IT認證>H3C認證>

h3c交換機配置

H3C認證 閱讀(2.52W)

我們知道交換機可以為接入交換機的任意兩個網路節點提供獨享的電訊號通路。最常見的交換機是乙太網交換機。那麼你知道H3C交換機可以怎麼配置嗎?有哪些配置命令呢?一起來看看吧!

h3c交換機配置

  H3C交換機配置命令

1、system-view 進入系統檢視模式

2、sysname 為裝置命名

3、display current-configuration 當前配置情況

4、 language-mode Chinese|English 中英文切換

5、interface Ethernet 1/0/1 進入乙太網埠檢視

6、 port link-type Access|Trunk|Hybrid 設定埠訪問模式

7、 undo shutdown 開啟乙太網埠

8、 shutdown 關閉乙太網埠

9、 quit 退出當前檢視模式

10、 vlan 10 建立VLAN 10並進入VLAN 10的檢視模式

11、 port access vlan 10 在埠模式下將當前埠加入到vlan 10中

12、port E1/0/2 to E1/0/5 在VLAN模式下將指定埠加入到當前vlan中

13、port trunk permit vlan all 允許所有的vlan通過

  H3C華為交換機埠繫結基本配置

1,埠 MAC

a)AM命令

使用特殊的AM User-bind命令,來完成MAC地址與埠之間的繫結。例如:

[SwitchA]am user-bind mac-address 00e0-fc22-f8d3 interface Ethernet 0/1

配置說明:由於使用了埠引數,則會以埠為參照物,即此時埠E0/1只允許PC1上網,而使用其他未繫結的MAC地址的PC機則無法上網。但

是PC1使用該MAC地址可以在其他埠上網。

b)mac-address命令

使用mac-address static命令,來完成MAC地址與埠之間的繫結。例如:

[SwitchA]mac-address static 00e0-fc22-f8d3 interface Ethernet 0/1 vlan 1

[SwitchA]mac-address max-mac-count 0

配置說明:由於使用了埠學習功能,故靜態繫結mac後,需再設定該埠mac學習數為0,使其他PC接入此埠後其mac地址無法被學習。

2,IP MAC

a)AM命令

使用特殊的AM User-bind命令,來完成IP地址與MAC地址之間的繫結。例如:

[SwitchA]am user-bind ip-address mac-address 00e0-fc22-f8d3

配置說明:以上配置完成對PC機的IP地址和MAC地址的全域性繫結,即與繫結的地址或者MAC地址不同的PC機,在任何埠都無法上網。

支援型號:S3026E/EF/C/G/T、S3026C-PWR、E026/E026T、S3050C、E050、S3526E/C/EF、S5012T/G、S5024G

b)arp命令

使用特殊的arp static命令,來完成IP地址與MAC地址之間的繫結。例如:

[SwitchA]arp static 00e0-fc22-f8d3

配置說明:以上配置完成對PC機的IP地址和MAC地址的全域性繫結。

3,埠 IP MAC

使用特殊的AM User-bind命令,來完成IP、MAC地址與埠之間的繫結。例如:

[SwitchA]am user-bind ip-address mac-address 00e0-fc22-f8d3 interface Ethernet 0/1

配置說明:可以完成將PC1的IP地址、MAC地址與埠E0/1之間的繫結功能。由於使用了埠引數,則會以埠為參照物,即此時埠E0/1只允

許 PC1上網,而使用其他未繫結的IP地址、MAC地址的PC機則無法上網。但是PC1使用該IP地址和MAC地址可以在其他埠上網。

###############################################################

[S2016-E1-Ethernet0/1]mac-address max-mac-count 0;

進入到埠,用命令mac max-mac-count 0(埠mac學習數設為0)

[S2016-E1]mac static 0000-9999-8888 int e0/1 vlan 10;

將0000-9999-8888繫結到e0/1埠上,此時只有繫結mac的pc可以通過此口上網,同時E0/1屬於vlan 10

就這樣,ok了,不過上面兩個命令順序不能弄反,除非埠下沒有接pc

#################################################################

dis vlan 顯示vlan

name text 指定當前vlan的名稱

undo name 取消

[h3c] vlan 2

[h3c-vlan2]name test vlan

dis users 顯示使用者

dis startup 顯示啟動配置檔案的資訊

dis user-interface 顯示使用者介面的相關資訊

dis web users 顯示web使用者的相關資訊。

header login 配置登陸驗證是顯示資訊

header shell

undo header

lock 鎖住當前使用者介面

acl 訪問控制列表 acl number inbound/outbound

[h3c]user-interface vty 0 4

[h3c-vty0-4] acl 2000 inbound

shutdown:關閉vlan介面

undo shutdown 開啟vlan介面

關閉vlan1 介面

[h3c] interface vlan-interface 1

[h3c-vlan-interface] shutdown

vlan vlan-id 定義vlan

undo valn vlan-id

display ip routing-table

display ip routing-table protocol static

display ip routing-table statistics

display ip routing-table verbose 檢視路由表的全部詳細資訊

interface vlan-interface vlan-id 進入valn

management-vlan vlan-id 定義管理vlan號

reset ip routing-table statistics protocol all 清除所有路由協議的路由資訊.

display garp statistics interface GigabitEthernet 1/0/1 顯示乙太網埠上的garp統計資訊

display voice vlan status 檢視語音vlan狀態

[h3c-GigabitEthernet1/0/1] broadcast-suppression 20 允許接受的最大廣播流量為該埠傳輸能力的20%.超出部分丟棄.

[h3c-GigabitEthernet1/0/1] broadcast-suppression pps 1000 每秒允許接受的最大廣播資料包為1000傳輸能力的20%.超出部分丟棄.

display interface GigabitEthernet1/0/1 檢視埠資訊

display brief interface GigabitEthernet1/0/1 檢視埠簡要配置資訊

display loopback-detection 用來測試環路測試是否開啟

display transceiver-information interface GigabitEthernet1/0/50 顯示光口相關資訊

duplex auto/full/half

[h3c]interface GigabitEthernet1/0/1

[h3c-GigabitEthernet1/0/1]duplux auto 設定埠雙工屬性為自協商

port link-type access/hybrid/trunk 預設為access

port trunk permit vlan all 將trunk扣加入所有vlan中

reset counters interface GigabitEthernet1/0/1 清楚埠的統計資訊

speed auto 10/100/1000

display port-security 檢視埠安全配置資訊

am user-bind mac-addr 00e0-fc00-5101 ip-addr interface GigabitEthernet1/0/1 埠ip繫結

display arp 顯示arp

display am user-bind 顯示埠繫結的配置資訊

display mac-address 顯示交換機學習到的mac地址

display stp 顯示生成樹狀態與統計資訊

[h3c-GigabitEthernet1/0/1]stp instance 0 cost 200 設定生成樹例項0上路徑開銷為200

stp cost 設定當前埠在指定生成樹例項上路徑開銷。instance-id 為0-16 0表cist 取值範圍1-200000

< h3c> display system-guard ip-record 顯示防攻擊記錄資訊.

system-guard enable 啟用系統防攻擊功能

display icmp statistics icmp流量統計

display ip socket

display ip statistics

display acl all

acl number acl-number match-order auto/config

acl-number (2000-2999 是基本acl 3000-3999是高階acl為管理員預留的編號)

rule deny/permit protocal

訪問控制

[h3c] acl number 3000

[h3c-acl-adv-3000]rule permit tcp source destination destination-port eq 80 (

定義高階acl 3000,允許129.0.0/16網段的主機向202.38.160/24網段主機訪問埠80)

rule permit source

rule deny cos 3 souce 00de-bbef-adse ffff-ffff-fff dest 0011-4301-9912 ffff-ffff-ffff

(禁止mac地址00de-bbef-adse傳送到mac地址0011-4301-9912且802.1p優先順序為3的報文通過)

display qos-interface GigabitEthernet1/0/1 traffic-limit 檢視埠上流量

埠速率限制

line-rate inbound/outbound target-rate

inbound:對埠接收報文進行速率限制

outbound: 對埠傳送報文進行速率限制

target-rate 對報文限制速率,單位kbps 千兆口 inbound範圍1-1000000 outbound範圍20-1000000

undo line-rate取消限速.

[h3c]interface GigabitEthernet1/0/1

[h3c-GigabitEthernet1/0/1]line-rate outbound 128 限制出去速率為128kbps

display arp | include 77

display arp count 計算arp表的記錄數

display ndp 顯示交換機埠的詳細配置資訊。

display ntdp device-list verbose 收集裝置詳細資訊

display lock

display users

display cpu

display memory

display fan

display device

display power