華爲CE交換機MSTP+VRRP冗餘備份配置

適用產品和版本

CE12800/CE6800/CE5800系列產品V100R001C00或更高版本,CE7800系列產品V100R003C00或更高版本,CE8800系列產品V100R006C00或更高版本,CE12800E系列產品V200R002C50或更高版本。

組網需求

在數據中心場景中,接入層交換機以雙上行方式接入核心層。用戶希望:

  • 考慮到業務的可靠性,部署冗餘鏈路,在一條上行鏈路斷開的時候,流量能切換到另外一條上行鏈路轉發。
  • 避免冗餘備份鏈路導致的環網問題,消除網絡中的環路。

圖2-37 配置MSTP+VRRP負載分擔組網

華為CE交換機MSTP+VRRP冗餘備份配置

華為CE交換機MSTP+VRRP冗餘備份配置

需求分析

  • 通過在SwitchA和SwitchB之間部署VRRP,實現鏈路冗餘備份。
  • 通過在SwitchA、SwitchB和SwitchC之間部署MSTP,消除網絡中的環路。

操作步驟

  1. 配置MSTP基本功能配置SwitchA、SwitchB、SwitchC到域名為RG1的域內,創建實例MSTI1
  2. # 配置SwitchA的MST域。

system-view

[~HUAWEI] sysname SwitchA

[*HUAWEI] commit

[~SwitchA] stp region-configuration

[~SwitchA-mst-region] region-name RG1

[*SwitchA-mst-region] instance 1 vlan 2

[*SwitchA-mst-region] commit

[~SwitchA-mst-region] quit

# 配置SwitchB的MST域。

system-view

[~HUAWEI] sysname SwitchB

[*HUAWEI] commit

[~SwitchB] stp region-configuration

[~SwitchB-mst-region] region-name RG1

[*SwitchB-mst-region] instance 1 vlan 2

[*SwitchB-mst-region] commit

[~SwitchB-mst-region] quit

# 配置SwitchC的MST域。

system-view

[~HUAWEI] sysname SwitchC

[*HUAWEI] commit

[~SwitchC] stp region-configuration

[~SwitchC-mst-region] region-name RG1

[*SwitchC-mst-region] instance 1 vlan 2

[*SwitchC-mst-region] commit

[~SwitchC-mst-region] quit

在域RG1內,配置MSTI1的根橋與備份根橋

配置MSTI1的根橋與備份根橋

# 配置SwitchA為MSTI1的根橋。

[~SwitchA] stp instance 1 root primary

[*SwitchA] commit

# 配置SwitchB為MSTI1的備份根橋。

[~SwitchB] stp instance 1 root secondary

[*SwitchB] commit

配置實例MSTI1中將要被阻塞端口的路徑開銷值大於缺省值

說明:

端口路徑開銷值取值範圍由路徑開銷計算方法決定,這裡選擇使用華為私有計算方法為例,配置實例MSTI1中將被阻塞端口的路徑開銷值為20000。

同一網絡內所有交換設備的端口路徑開銷應使用相同的計算方法。

# 配置SwitchA的端口路徑開銷的計算方法為華為私有計算方法。

[~SwitchA] stp pathcost-standard legacy

[*SwitchA] commit

# 配置SwitchB的端口路徑開銷的計算方法為華為的私有計算方法。

[~SwitchB] stp pathcost-standard legacy

[*SwitchB] commit

# 配置SwitchC的端口路徑開銷的計算方法為華為的私有計算方法,將端口10GE1/0/4在實例MSTI1中的路徑開銷值配置為20000。

[~SwitchC] stp pathcost-standard legacy

[*SwitchC] interface 10ge 1/0/4

[*SwitchC-10GE1/0/4] stp instance 1 cost 20000

[*SwitchC-10GE1/0/4] commit

[~SwitchC-10GE1/0/4] quit

使能MSTP,實現破除環路

說明:

設備上MSTP功能默認使能。

設備全局使能MSTP

# 在SwitchA上啟動MSTP。

[~SwitchA] stp enable

[*SwitchA] commit

# 在SwitchB上啟動MSTP。

[~SwitchB] stp enable

[*SwitchB] commit

# 在SwitchC上啟動MSTP。

[~SwitchC] stp enable

[*SwitchC] commit

將與Host相連的端口配置為邊緣端口

# 配置SwitchC端口10GE1/0/2和10GE1/0/3為邊緣端口。

[~SwitchC] interface 10ge 1/0/2

[~SwitchC-10GE1/0/2] stp edged-port enable

[*SwitchC-10GE1/0/2] commit

[~SwitchC-10GE1/0/2] quit

[~SwitchC] interface 10ge 1/0/3

[~SwitchC-10GE1/0/3] stp edged-port enable

[*SwitchC-10GE1/0/3] commit

[~SwitchC-10GE1/0/3] quit

配置保護功能,如在各實例的根橋設備的指定端口配置根保護功能

# 在SwitchA端口10GE1/0/1上啟動根保護。

[~SwitchA] interface 10ge 1/0/1

[~SwitchA-10GE1/0/1] stp root-protection

[*SwitchA-10GE1/0/1] commit

[~SwitchA-10GE1/0/1] quit

配置處於環網中的設備的二層轉發功能

在交換設備SwitchA、SwitchB、SwitchC上創建VLAN2

# 在SwitchA上創建VLAN2。

[~SwitchA] vlan batch 2

# 在SwitchB上創建VLAN2。

[~SwitchB] vlan batch 2

# 在SwitchC上創建VLAN2。

[~SwitchC] vlan batch 2

將交換設備上接入環路中的端口加入VLAN

# 將SwitchA端口10GE1/0/1加入VLAN。

[~SwitchA] interface 10ge 1/0/1

[~SwitchA-10GE1/0/1] port link-type trunk

[*SwitchA-10GE1/0/1] port trunk allow-pass vlan 2

[*SwitchA-10GE1/0/1] undo port trunk allow-pass vlan 1

[*SwitchA-10GE1/0/1] commit

[~SwitchA-10GE1/0/1] quit

# 將SwitchA端口10GE1/0/2加入VLAN。

[~SwitchA] interface 10ge 1/0/2

[~SwitchA-10GE1/0/2] port link-type trunk

[*SwitchA-10GE1/0/2] port trunk allow-pass vlan 2

[*SwitchA-10GE1/0/2] undo port trunk allow-pass vlan 1

[*SwitchA-10GE1/0/2] commit

[~SwitchA-10GE1/0/2] quit

# 將SwitchB端口10GE1/0/1加入VLAN。

[~SwitchB] interface 10ge 1/0/1

[~SwitchB-10GE1/0/1] port link-type trunk

[*SwitchB-10GE1/0/1] port trunk allow-pass vlan 2

[*SwitchB-10GE1/0/1] undo port trunk allow-pass vlan 1

[*SwitchB-10GE1/0/1] commit

[~SwitchB-10GE1/0/1] quit

# 將SwitchB端口10GE1/0/2加入VLAN。

[~SwitchB] interface 10ge 1/0/2

[~SwitchB-10GE1/0/2] port link-type trunk

[*SwitchB-10GE1/0/2] port trunk allow-pass vlan 2

[*SwitchB-10GE1/0/2] undo port trunk allow-pass vlan 1

[*SwitchB-10GE1/0/2] commit

[~SwitchB-10GE1/0/2] quit

# 將SwitchC端口10GE1/0/1加入VLAN。

[~SwitchC] interface 10ge 1/0/1

[~SwitchC-10GE1/0/1] port link-type trunk

[*SwitchC-10GE1/0/1] port trunk allow-pass vlan 2

[*SwitchC-10GE1/0/1] undo port trunk allow-pass vlan 1

[*SwitchC-10GE1/0/1] commit

[~SwitchC-10GE1/0/1] quit

# 將SwitchC端口10GE1/0/2加入VLAN。

[~SwitchC] interface 10ge 1/0/2

[~SwitchC-10GE1/0/2] port link-type access

[*SwitchC-10GE1/0/2] port default vlan 2

[*SwitchC-10GE1/0/2] commit

[~SwitchC-10GE1/0/2] quit

# 將SwitchC端口10GE1/0/3加入VLAN。

[~SwitchC] interface 10ge 1/0/3

[~SwitchC-10GE1/0/3] port link-type access

[*SwitchC-10GE1/0/3] port default vlan 2

[*SwitchC-10GE1/0/3] commit

[~SwitchC-10GE1/0/3] quit

# 將SwitchC端口10GE1/0/4加入VLAN。

[~SwitchC] interface 10ge 1/0/4

[~SwitchC-10GE1/0/4] port link-type trunk

[*SwitchC-10GE1/0/4] port trunk allow-pass vlan 2

[*SwitchC-10GE1/0/4] commit

[~SwitchC-10GE1/0/4] quit

配置設備間的網絡互連

# 配置設備各接口的IP地址,以SwitchA為例。SwitchB的配置與之類似,詳見配置文件。

[~SwitchA] vlan batch 4

[*SwitchA] interface 10ge 1/0/3

[*SwitchA-10GE1/0/3] port link-type trunk

[*SwitchA-10GE1/0/3] port trunk allow-pass vlan 4

[*SwitchA-10GE1/0/3] undo port trunk allow-pass vlan 1

[*SwitchA-10GE1/0/3] quit

[*SwitchA] interface vlanif 2

[*SwitchA-Vlanif2] ip address 10.1.2.102 24

[*SwitchA-Vlanif2] quit

[*SwitchA] interface vlanif 4

[*SwitchA-Vlanif4] ip address 10.1.4.102 24

[*SwitchA-Vlanif4] quit

[*SwitchA] commit

# 配置SwitchA、SwitchB和路由器間採用OSPF協議進行互連。以SwitchA為例,SwitchB的配置與之類似,詳見配置文件。

[~SwitchA] ospf 1

[*SwitchA-ospf-1] area 0

[*SwitchA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255

[*SwitchA-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255

[*SwitchA-ospf-1-area-0.0.0.0] quit

[*SwitchA-ospf-1] quit

[*SwitchA] commit

配置VRRP備份組

# 在SwitchA和SwitchB上創建VRRP備份組1,配置SwitchA的優先級為120,搶佔延時為20秒,作為Master設備;SwitchB的優先級為缺省值,作為Backup設備。

[~SwitchA] interface vlanif 2

[~SwitchA-Vlanif2] vrrp vrid 1 virtual-ip 10.1.2.100

[*SwitchA-Vlanif2] vrrp vrid 1 priority 120

[*SwitchA-Vlanif2] vrrp vrid 1 preempt-mode timer delay 20

[*SwitchA-Vlanif2] commit

[~SwitchA-Vlanif2] quit

[~SwitchB] interface vlanif 2

[~SwitchB-Vlanif2] vrrp vrid 1 virtual-ip 10.1.2.100

[*SwitchB-Vlanif2] commit

[~SwitchB-Vlanif2] quit

# 配置HostA和HostB的缺省網關為備份組1的虛擬IP地址10.1.2.100。

驗證

完成上述配置後,在SwitchA上執行display vrrp命令,可以看到SwitchA在備份組1中作為Master設備。

display vrrp verbose

Vlanif2 | Virtual Router 1

State : Master

Virtual IP : 10.1.2.100

Master IP : 10.1.2.102

PriorityRun : 120

PriorityConfig : 120

MasterPriority : 120

Preempt : YES Delay Time : 20 s Remain : --

TimerRun : 1 s

TimerConfig : 1 s

Auth type : NONE

Virtual MAC : 0000-5e00-0101

Check TTL : YES

Config type : normal-vrrp

Create time : 2013-05-11 11:39:18

Last change time : 2013-05-26 11:38:58

在SwitchB上執行display vrrp命令,可以看到SwitchB在備份組1中作為Backup設備。

display vrrp verbose

Vlanif2 | Virtual Router 1

State : Backup

Virtual IP : 10.1.2.100

Master IP : 10.1.2.102

PriorityRun : 100

PriorityConfig : 100

MasterPriority : 120

Preempt : YES Delay Time : 0 s Remain : --

TimerRun : 1 s

TimerConfig : 1 s

Auth type : NONE

Virtual MAC : 0000-5e00-0101

Check TTL : YES

Config type : normal-vrrp

Create time : 2012-05-11 11:39:18

Last change time : 2013-05-26 11:40:38

配置文件

SwitchA的配置文件

#

sysname SwitchA

#

vlan batch 2 4

#

stp instance 1 root primary

stp pathcost-standard legacy

#

stp region-configuration

region-name RG1

instance 1 vlan 2

#

interface Vlanif2

ip address 10.1.2.102 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.2.100

vrrp vrid 1 priority 120

vrrp vrid 1 preempt-mode timer delay 20

#

interface Vlanif4

ip address 10.1.4.102 255.255.255.0

#

interface 10GE1/0/1

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 2

stp root-protection

#

interface 10GE1/0/2

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 2

#

interface 10GE1/0/3

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 4

#

ospf 1

area 0.0.0.0

network 10.1.2.0 0.0.0.255

network 10.1.4.0 0.0.0.255

#

return

SwitchB的配置文件

#

sysname SwitchB

#

vlan batch 2 5

#

stp instance 1 root secondary

stp pathcost-standard legacy

#

stp region-configuration

region-name RG1

instance 1 vlan 2

#

interface Vlanif2

ip address 10.1.2.103 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.2.100

#

interface Vlanif5

ip address 10.1.5.103 255.255.255.0

#

interface 10GE1/0/1

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 2

stp root-protection

#

interface 10GE1/0/2

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 2

#

interface 10GE1/0/3

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 5

#

ospf 1

area 0.0.0.0

network 10.1.2.0 0.0.0.255

network 10.1.5.0 0.0.0.255

#

return

SwitchC的配置文件

#

sysname SwitchC

#

vlan batch 2

#

stp pathcost-standard legacy

#

stp region-configuration

region-name RG1

instance 1 vlan 2

#

interface 10GE1/0/1

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 2

#

interface 10GE1/0/2

port link-type access

port default vlan 2

stp edged-port enable

#

interface 10GE1/0/3

port link-type access

port default vlan 2

stp edged-port enable

#

interface 10GE1/0/4

port link-type trunk

undo port trunk allow-pass vlan 1

port trunk allow-pass vlan 2

stp instance 1 cost 20000

#

return


分享到:


相關文章: