1. 程式人生 > >華為三層交換機埠匯聚和交換機備份 例項介紹

華為三層交換機埠匯聚和交換機備份 例項介紹

1. 組網及功能實現

如圖,配置以三層太網埠匯聚和交換機備份功能

2. 三層交換機配置步驟

(1)配置介面IP地址

在SW1和SW2上分別建立VLAN1的三層地址10.1.1.1/30和10.1.1.2/30。

(2)配置匯聚的埠屬性

在配置埠匯聚之前,首先要保證Sw1和Sw2所有匯聚的埠必須工作在全雙工方式下,而且必須工作在相同的速率下(不能工作於自協商模式,自協商模式容易導致網路工作於半雙工或速率不匹配造成的網路癱瘓)。

(3)配置埠匯聚和vlan通過情況

3. 配置引數參考

(1)交換機Sw1的配置:

[SW1]interface Vlan-interface 1

[SW1-Vlan-interface1]ip add 10.1.1.1255.255.255.252

[SW1-Ethernet0/1]undo negotiation auto

[SW1-Ethernet0/1]speed 100

[SW1-Ethernet0/1]duplex full

[SW1-Ethernet0/1]port link-type trunk

[SW1-Ethernet0/1] port trunk allow-pass vlan all

[SW1-Ethernet0/2]speed 100

[SW1-Ethernet0/2]duplex full

[SW1-Ethernet0/1]port link-type trunk

[SW1-Ethernet0/1] port trunk allow-pass vlan all

(2)交換機SW2的配置:                                                                              

[SW2]interface Vlan-interface 1

[SW2-Vlan-interface1]ip add 10.1.1.2255.255.255.252

[SW2-Ethernet0/1]speed 100

[SW2-Ethernet0/1]duplex full

[SW2-Ethernet0/1]port link-type trunk

[SW2-Ethernet0/1] port trunk allow-pass vlan all

[SW2-Ethernet0/2]speed 100

[SW2-Ethernet0/2]duplex full

[SW2-Ethernet0/1]port link-type trunk

[SW2-Ethernet0/1] port trunk allow-pass vlan all

4. 結果驗證

(1)檢查配置的正確性

分別在SW1和SW2上顯示當前配置,在SW1的系統檢視執行display current-configuration,結果顯示

#

sysname SW1

#

cluster enable

ntdp enable

ndp enable

#

drop illegal-mac alarm

#

diffserv domain default

#

drop-profile default

#

aaa

 authentication-scheme default

 authorization-scheme default

 accounting-scheme default

 domain default

 domain default_admin

 local-user admin password simple admin

 local-user admin service-type http

#

interface Vlanif1

 ip address 10.1.1.1 255.255.255.252

#

interface MEth0/0/1

#

interfaceGigabitEthernet0/0/1

 undo negotiation auto

 shutdown

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interfaceGigabitEthernet0/0/2

 undo negotiation auto

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

同樣,在SW2上檢查配置正確性

(2)檢查兩個三層交換機的互通

分別在SW1、SW2上執行ping 10.1.1.2/1,顯示網路聯通

(3)驗證埠匯聚的互為備份這個特性。

首先在SW1上用display mac-address命令檢查MAC地址表,檢視目前SW2的Interface Vlan 1的MAC地址在E0/1還是E0/2,SW2的Interface Vlan 1的MAC地址可以通過在SW2上利用命令Display Interface Vlan 1觀察到。

1) [SW1]display mac-address
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
4c1f-ccd5-61b6 1           -      -      GE0/0/1         dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 1 

2) [SW2]display interface vlan
Vlanif1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-10 16:06:13 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.1.1.2/30
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccd5-61b6
Current system time: 2018-01-10 19:01:41-08:00
    Input bandwidth utilization  : --
    Output bandwidth utilization : --

由上述輸出可以知道,目前Sw1將要轉發到Sw2的interface vlan1資料幀是通過GE0/0/1轉發的。為了檢驗匯聚組中GE0/0/2是否能夠備份E0/0/1,我們只要手工關閉E0/0/1在檢查SW1和SW2之間的可通性即可。

3)關閉 GE0/0/1

[SW1-GigabitEthernet0/0/1]shutdown

[SW1-GigabitEthernet0/0/1]
Jan 10 2018 19:04:17-08:00 SW1 %%01PHY/1/PHY(l)[0]:    GigabitEthernet0/0/1: cha
nge status to down
Jan 10 2018 19:04:18-08:00 SW1 %%01PHY/1/PHY(l)[1]:    GigabitEthernet0/0/1: cha
nge status to down

4) 檢查交換機的備份效能

<SW2>ping 10.1.1.1

  PING10.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 10.1.1.1:bytes=56 Sequence=1 ttl=254 time = 13 ms

    Reply from 10.1.1.1:bytes=56 Sequence=2 ttl=254 time = 10 ms

    Reply from 10.1.1.1:bytes=56 Sequence=3 ttl=254 time = 8 ms

    Reply from 10.1.1.1:bytes=56 Sequence=4 ttl=254 time = 9 ms

    Reply from 10.1.1.1:bytes=56 Sequence=5 ttl=254 time = 10 ms

  --- 10.1.1.1ping statistics ---

    5 packet(s)transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 8/10/13ms

5)確認現在利用SW1利用GE0/0/2進行連線

[SW1]display mac-address
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
4c1f-ccd5-61b6 1           -      -      GE0/0/2         dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 1 

結語:到目前為止,已經完成了三層交換機的匯聚功能,並驗證了交換機備份的正確性