• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

H3C S6890係列以太網交換機 典型配置舉例-Release 27xx係列-6W100

目錄

48-MAC地址表典型配置舉例

本章節下載 48-MAC地址表典型配置舉例  (199.86 KB)

48-MAC地址表典型配置舉例

H3C S6890 MAC地址表配置舉例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

資料版本:6W100-20190628

 

Copyright © 2019 bobty下载软件 版權所有,保留一切權利。

非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。

除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。

本文檔中的信息可能變動,恕不另行通知。

 



1  簡介

本文檔介紹了MAC地址表的配置舉例。

2  配置前提

本文檔中的配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下舉例中的配置不衝突。

本文假設您已了解MAC地址表特性。

3  靜態MAC地址表項典型配置舉例

3.1  組網需求

圖1所示:

·     某企業網絡中,VLAN 100的用戶群需要訪問服務器。

·     如果有非法用戶從其他接口假冒服務器的MAC地址發送報文,則服務器的MAC地址將在其他接口學到,導致用戶不能與服務器正常通信,還會導致一些重要用戶信息被竊取。

·     為提高服務器安全性,在Device上配置一條靜態MAC地址表項,將服務器MAC地址0000-fc00-a249與接口XGE1/0/2綁定。

圖1 靜態MAC地址表項組網圖

 

3.2  使用版本

本舉例是在S6890-CMW710-R2712版本上進行配置和驗證的。

3.3  配置注意事項

缺省情況下,S6890係列交換機的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

3.4  配置步驟

在Device上進行如下配置:

# 創建VLAN 100,並將Ten-GigabitEthernet1/0/2加入VLAN 100。

<Device> system-view

[Device] vlan 100

[Device-vlan100] quit

[Device] interface ten-gigabitethernet 1/0/2

[Device-Ten-GigabitEthernet1/0/2] port access vlan 100

[Device-Ten-GigabitEthernet1/0/2] quit

# 將Device連接下級交換機的端口Ten-GigabitEthernet1/0/3的鏈路類型配置為Trunk,並允許VLAN 100的報文通過。

[Device] interface ten-gigabitethernet 1/0/3

[Device-Ten-GigabitEthernet1/0/3] port link-type trunk

[Device-Ten-GigabitEthernet1/0/3] port trunk permit vlan 100

[Device-Ten-GigabitEthernet1/0/3] quit

# 增加一個靜態MAC地址表項,目的地址為0000-fc00-a249,出接口為Ten-GigabitEthernet1/0/2,且該接口屬於VLAN 100。

[Device] mac-address static 0000-fc00-a249 interface ten-gigabitethernet 1/0/2 vlan 100

3.5  驗證配置

(1)     假設VLAN 100的某個用戶處於10.0.0.0/24網段,該用戶能夠和Server互通。

(2)     通過查看顯示信息,驗證配置是否成功。

# 查看Device的MAC地址表項信息。

[Device] display mac-address

MAC Address      VLAN ID    State            Port/NickName            Aging

0000-fc00-a249   100        Static           XGE1/0/2                 N

7425-8a02-4d00   100        Learned          XGE1/0/3                 Y

...

3.6  配置文件

·     Device

#

sysname Device

#

vlan 1

#

vlan 100

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 100

 mac-address static 0000-fc00-a249 vlan 100

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

4  MAC地址遷移監測典型配置舉例

4.1  組網需求

圖2所示,網絡中三台設備之間因誤接網線形成環路,由於這些設備都沒有使能生成樹協議,該環路網絡產生了MAC地址遷移,導致設備MAC地址表震蕩。

要求:

·     在Device A上通過配置MAC地址遷移抑製功能來消除環路。

·     通過查看MAC地址遷移記錄來定位環路問題。

圖2 MAC地址遷移監測組網圖

 

4.2  配置思路

·     將設備之間互連的端口加入VLAN 100,實現二層轉發。

·     在Device A上選擇可能在環路上的一個或多個端口(例如XGE1/0/1)配置MAC地址遷移抑製功能。同時,為了方便觀察端口狀態變化,在Device A上開啟對日誌信息和調試信息的顯示功能。

·     為了測試環路,在各設備上創建VLAN接口100並配置IP地址,然後在 Device A上ping Device B,查看MAC地址遷移記錄。

4.3  使用版本

本舉例是在S6890-CMW710-R2712版本上進行配置和驗證的。

4.4  配置注意事項

缺省情況下,S6890係列交換機的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

4.5  配置步驟

4.5.1  配置Device A

# 開啟當前終端對日誌信息和調試信息的顯示功能。

<DeviceA> terminal monitor

<DeviceA> terminal debugging

# 創建VLAN 100。將接口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2的鏈路類型配置為Trunk,並允許VLAN 100的報文通過。

<DeviceA> system-view

[DeviceA] vlan 100

[DeviceA-vlan100] quit

[DeviceA] interface range ten-gigabitethernet 1/0/1 ten-gigabitethernet 1/0/2

[DeviceA-if-range] port link-type trunk

[DeviceA-if-range] port trunk permit vlan 100

[DeviceA-if-range] quit

# 設置MAC地址遷移抑製功能的抑製時間間隔為300秒。配置後,當端口因檢測到MAC地址遷移而關閉後,需要經過5分鍾才自動恢複up狀態。

[DeviceA] mac-address notification mac-move suppression interval 300

# 設置MAC地址遷移抑製功能的檢測閾值為0。配置後,隻要係統在一個檢測周期內(缺省為1分鍾)監測到某端口出現一次MAC地址遷移,就把該端口關閉。

[DeviceA] mac-address notification mac-move suppression threshold 0

# 開啟端口Ten-GigabitEthernet1/0/1的MAC地址遷移抑製功能。

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] mac-address notification mac-move suppression

[DeviceA-Ten-GigabitEthernet1/0/1] quit

# 創建VLAN接口100並配置IP地址。

[DeviceA] interface vlan-interface 100

[DeviceA-Vlan-interface100] ip address 10.0.0.1 24

[DeviceA-Vlan-interface100] quit

4.5.2  配置Device B、Device C

Device C的配置與Device B類似,這裏以Device B為例。

# 創建VLAN 100。將接口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2的鏈路類型配置為Trunk,並允許VLAN 100的報文通過。

<DeviceB> system-view

[DeviceB] vlan 100

[DeviceB-vlan100] quit

[DeviceB] interface range ten-gigabitethernet 1/0/1 ten-gigabitethernet 1/0/2

[DeviceB-if-range] port link-type trunk

[DeviceB-if-range] port trunk permit vlan 100

[DeviceB-if-range] quit

# 創建VLAN接口100並配置IP地址。

[DeviceB] interface vlan-interface 100

[DeviceB-Vlan-interface100] ip address 10.0.0.2 24

[DeviceB-Vlan-interface100] quit

4.6  驗證配置

在Device A上ping Device B,由於環路的存在,將會導致MAC地址遷移。可以在Device A上看到端口Ten-GigabitEthernet1/0/1自動關閉的日誌信息:

[DeviceA] %Dec 11 09:51:06:309 2016 DeviceA IFNET/3/PHY_UPDOWN: -MDC=1; Physical state on the Ten-GigabitEthernet1/0/1 changed to down.

%Dec 11 09:51:06:323 2016 DeviceA IFNET/5/LINK_UPDOWN: -MDC=1; Line protocol state on

the interface Ten-GigabitEthernet1/0/1 changed to down.

# 顯示Ten-GigabitEthernet1/0/1的詳細信息,可以看到該端口down的原因為監測到MAC地址遷移。

[DeviceA] display interface ten-gigabitethernet 1/0/1

Ten-GigabitEthernet1/0/1

Current state: mac-address moving down

Line protocol state: DOWN

...

# 經過抑製時間5分鍾後,端口Ten-GigabitEthernet1/0/1自動恢複up。

[DeviceA] %Dec 11 09:56:07:002 2016 DeviceA IFNET/3/PHY_UPDOWN: -MDC=1; Physical state on the Ten-GigabitEthernet1/0/1 changed to up.

%Dec 11 09:56:07:004 2016 DeviceA IFNET/5/LINK_UPDOWN: -MDC=1; Line protocol state on

the interface Ten-GigabitEthernet1/0/1 changed to up.

# 查看Device A的MAC地址遷移記錄,可以看到同一條MAC地址表項(Device B的VLAN接口100的MAC地址)在Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2之間反複遷移,那麼這兩個端口之間存在環路。可以手工關閉其中一個端口來消除環路。

[DeviceA] display mac-address mac-move

MAC address    VLAN Current port  Source port   Last time              Times

0000-fc00-6506 100  XGE1/0/2      XGE1/0/1      2014-12-11 09:29:48    3

0000-fc00-6506 100  XGE1/0/1      XGE1/0/2      2014-12-11 09:51:03    4

 

---  2 MAC address moving records found  ---

4.7  配置文件

·     Device A

#

sysname DeviceA

#

mac-address notification mac-move suppression interval 300

mac-address notification mac-move suppression threshold 0

#

vlan 1

#

vlan 100

#

interface Vlan-interface100

 ip address 10.0.0.1 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

 mac-address notification mac-move suppression

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

·     Device B

#

sysname DeviceB

#

vlan 1

#

vlan 100

#

interface Vlan-interface100

 ip address 10.0.0.2 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

·     Device C

#

sysname DeviceC

#

vlan 1

#

vlan 100

#

interface Vlan-interface100

 ip address 10.0.0.3 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

5  相關資料

·     H3C S6890係列交換機 二層技術-以太網交換機配置指導(R27xx)

·     H3C S6890係列交換機 二層技術-以太網交換機命令參考(R27xx)

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們