MSTP+VRRP组合实现S1和S2的(双交换)热备冗余及负载均衡

MSTP+VRRP组合实现S1和S2的(双交换)热备冗余及负载均衡_第1张图片

一、前期准备:

1.所属部门vlan划分:

vlan2 zongcaiban172.16.2.253/24

vlan3 fenxiaobu172.16.3.253/24

vlan4 quyufazhan172.16.4.253/24

vlan5 shangpinbu172.16.5.253/24

vlan6 shichangbu172.16.6.253/24

vlan7 yingxiaoch172.16.7.253/24

vlan8 kuajinggyl172.16.8.253/24

vlan9 shequnyy172.16.9.253/24

vlan10 yunyingzc172.16.10.253/24

vlan11 qdcpjs172.16.11.253/24

vlan12 hdcpjs172.16.12.253/24

vlan13 kefu172.16.13.253/24

vlan14 wuliu172.16.14.253/24

vlan15 hr172.16.15.253/24

vlan16 fc172.16.16.253/24

vlan17 firewall172.16.17.253/24

vlan100 server172.16.100.253/24

 

各vlan网关为172.16.x.254且为vrrp组虚拟网关


2.实现功能

能够实现S1和S2的互相冗余和负载均衡

二、进行配置(如上图所示)

S1:

#

sysname S2

#

undo info enable

#

vlan batch 2 to 17

vlan 100

quit

#

vlan 2

description zongcaiban

quit

#

vlan 3

description fenxiaobu

quit

#

vlan 4

description quyufazhan

quit

#

vlan 5

description shangpinbu

quit

#

vlan 6

description shichangbu

quit

#

vlan 7

description yingxiaoch

quit

#

vlan 8

description kuajinggyl

quit

#

vlan 9

description shenqunyy

quit

#

vlan 10

description yunyingzc

quit

#

vlan 11

description qdcpjs

quit

#

vlan 12

description hdcpjs

quit

#

vlan 13

description kefu

quit

#

vlan 14

description wuliu

quit

#

vlan 15

description hr

quit

#

vlan 16

description fc

quit

#

vlan 17

description firewall

quit

#

vlan 100

description server

quit

#

 interface vlan 2

 ipaddress 172.16.2.253 255.255.255.0

 quit

#

 interface vlan 3

 ipaddress 172.16.3.253 255.255.255.0

 quit

#

 interface vlan 4

 ipaddress 172.16.4.253 255.255.255.0

 quit

#

 interface vlan 5

 ipaddress 172.16.5.253 255.255.255.0

 quit

#

 interface vlan 6

 ipaddress 172.16.6.253 255.255.255.0

 quit

#

 interface vlan 7

 ipaddress 172.16.7.253 255.255.255.0

 quit

#

 interface vlan 8

 ipaddress 172.16.8.253 255.255.255.0

 quit

#

 interface vlan 9

 ipaddress 172.16.9.253 255.255.255.0

 quit

#

 interface vlan 10

 ipaddress 172.16.10.253 255.255.255.0

 quit

#

 interface vlan 11

 ipaddress 172.16.11.253 255.255.255.0

 quit

#

 interface vlan 12

 ipaddress 172.16.12.253 255.255.255.0

 quit

#

 interface vlan 13

 ipaddress 172.16.13.253 255.255.255.0

 quit

#

 interface vlan 14

 ipaddress 172.16.14.253 255.255.255.0

 quit

#

 interface vlan 15

 ipaddress 172.16.15.253 255.255.255.0

 quit

#

 interface vlan 16

 ipaddress 172.16.16.253 255.255.255.0

 quit

#

 interface vlan 17

 ipaddress 172.16.17.253 255.255.255.0

 quit

#

 interface vlan 100

 ipaddress 172.16.100.253 255.255.255.0

 quit

#

interface GigabitEthernet 0/0/24

port link-type trunk

port trunk allow-pass vlan 2 to 4094

quit

#

interface GigabitEthernet 0/0/3

port link-type trunk

port trunk allow-pass vlan 2 to 4094

quit

#

interface GigabitEthernet 0/0/2

port link-type trunk

port trunk allow-pass vlan 2 to 4094

quit

#

interface GigabitEthernet 0/0/1

port link-type trunk

port trunk allow-pass vlan 2 to 4094

quit

#

interface vlan 11     

vrrp vrid 11 virtual-ip 172.16.11.254

vrrp vrid 11 priority 120  

vrrp vrid 11 preempt-mode timer delay 20

quit

#

interface vlan 12     

vrrp vrid 12 virtual-ip 172.16.12.254

vrrp vrid 12 priority 120  

vrrp vrid 12 preempt-mode timer delay 20

quit

#

interface vlan 13     

vrrp vrid 13 virtual-ip 172.16.13.254

vrrp vrid 13 priority 120  

vrrp vrid 13 preempt-mode timer delay 20

quit

#

interface vlan 14     

vrrp vrid 14 virtual-ip 172.16.14.254

vrrp vrid 14 priority 120  

vrrp vrid 14 preempt-mode timer delay 20

quit

#

interface vlan 15     

vrrp vrid 15 virtual-ip 172.16.15.254

vrrp vrid 15 priority 120  

vrrp vrid 15 preempt-mode timer delay 20

quit

#

interface vlan 16     

vrrp vrid 16 virtual-ip 172.16.16.254

vrrp vrid 16 priority 120  

vrrp vrid 16 preempt-mode timer delay 20

quit

#

interface vlan 17     

vrrp vrid 17 virtual-ip 172.16.17.254

vrrp vrid 17 priority 120  

vrrp vrid 17 preempt-mode timer delay 20

quit

#

interface vlan 100   

vrrp vrid 100 virtual-ip 172.16.100.254

vrrp vrid 100 priority 120

vrrp vrid 100 preempt-mode timer delay 20

quit

#

interface vlan 2       

vrrp vrid 2 virtual-ip 172.16.2.254

quit

#

interface vlan 3       

vrrp vrid 3 virtual-ip 172.16.3.254

quit

#

interface vlan 4       

vrrp vrid 4 virtual-ip 172.16.4.254

quit

#

interface vlan 5       

vrrp vrid 5 virtual-ip 172.16.5.254

quit

#

interface vlan 6       

vrrp vrid 6 virtual-ip 172.16.6.254

quit

#

interface vlan 7       

vrrp vrid 7 virtual-ip 172.16.7.254

quit

#

interface vlan 8       

vrrp vrid 8 virtual-ip 172.16.8.254

quit

#

interface vlan 9       

vrrp vrid 9 virtual-ip 172.16.9.254

quit

#

interface vlan 10     

vrrp vrid 10 virtual-ip 172.16.10.254

quit

[S1]stp mode mstp 

[S1]stp region-configuration

[S1-mst-region]region-name myzj

[S1-mst-region]instance 1 vlan 2 to 10

[S1-mst-region]instance 2 vlan 11 to 17 100  

[S1-mst-region]active region-configuration

Info: This operation may take a few seconds.Please wait for a moment...done.

[S1-mst-region]quit

[S1]stp instance 1 root primary     

[S1]stp instance 2 root secondary

 

S2:

添加vlan和前面是一样的。Vlan的IP和s1是不能一样的。不然后面无法实现互为冗余。

#

 interface vlan 2

 ipaddress 172.16.2.252 255.255.255.0

 quit

#

 interface vlan 3

 ipaddress 172.16.3.252 255.255.255.0

 quit

#

 interface vlan 4

 ipaddress 172.16.4.252 255.255.255.0

 quit

#

 interface vlan 5

 ipaddress 172.16.5.252 255.255.255.0

 quit

#

 interface vlan 6

 ipaddress 172.16.6.252 255.255.255.0

 quit

#

 interface vlan 7

 ipaddress 172.16.7.252 255.255.255.0

 quit

#

 interface vlan 8

 ipaddress 172.16.8.252 255.255.255.0

 quit

#

 interface vlan 9

 ipaddress 172.16.9.252 255.255.255.0

 quit

#

 interface vlan 10

 ipaddress 172.16.10.252 255.255.255.0

 quit

#

 interface vlan 11

 ipaddress 172.16.11.252 255.255.255.0

 quit

#

 interface vlan 12

 ipaddress 172.16.12.252 255.255.255.0

 quit

#

 interface vlan 13

 ipaddress 172.16.13.252 255.255.255.0

 quit

#

 interface vlan 14

 ipaddress 172.16.14.252 255.255.255.0

 quit

#

 interface vlan 15

 ipaddress 172.16.15.252 255.255.255.0

 quit

#

 interface vlan 16

 ipaddress 172.16.16.252 255.255.255.0

 quit

#

 interface vlan 17

 ipaddress 172.16.17.252 255.255.255.0

 quit

#

 interface vlan 100

 ipaddress 172.16.100.252 255.255.255.0

 quit

[S2]interface GigabitEthernet 0/0/24

[S2-GigabitEthernet0/0/24]port link-typetrunk     

[S2-GigabitEthernet0/0/24]port trunkallow-pass vlan 2 to 4094

[S2-GigabitEthernet0/0/24]quit

[S2]interface GigabitEthernet 0/0/3

[S2-GigabitEthernet0/0/3]port link-typetrunk       

[S2-GigabitEthernet0/0/3]port trunkallow-pass vlan 2 to 4094

[S2-GigabitEthernet0/0/3]quit

[S2]interface GigabitEthernet 0/0/2

[S2-GigabitEthernet0/0/2]port link-typetrunk       

[S2-GigabitEthernet0/0/2]port trunkallow-pass vlan 2 to 4094

[S2-GigabitEthernet0/0/2]quit

[S2]interface GigabitEthernet 0/0/1

[S2-GigabitEthernet0/0/1]port link-typetrunk       

[S2-GigabitEthernet0/0/1]port trunkallow-pass vlan 2 to 4094

[S2-GigabitEthernet0/0/1]quit

[S2]stp mode mstp 

[S2]stp region-configuration

[S2-mst-region]instance 1 vlan 2 to 10

[S2-mst-region]instance 2 vlan 11 to 17 100  

[S2-mst-region]active region-configuration

Info: This operation may take a fewseconds. Please wait for a moment...done.

[S2-mst-region]quit

[S2]stp instance 1 root secondary

[S2]stp instance 2 root primary

[S2]stp enable

[S2]interface vlan 11       

[S2-Vlanif11]vrrp vrid 11 virtual-ip172.16.11.254

[S2-Vlanif11]vrrp vrid 11 priority 120      

[S2-Vlanif11]vrrp vrid 11 preempt-modetimer delay 20

[S2-Vlanif11]quit     

[S2]interface vlan 12

[S2-Vlanif12]vrrp vrid 12 virtual-ip172.16.12.254

[S2-Vlanif12]vrrp vrid 12 priority 120      

[S2-Vlanif12]vrrp vrid 12 preempt-modetimer delay 20

[S2-Vlanif12]quit     

[S2]interface vlan 13

[S2-Vlanif13]vrrp vrid 13 virtual-ip172.16.13.254

[S2-Vlanif13]vrrp vrid 13 priority 120      

[S2-Vlanif13]vrrp vrid 13 preempt-modetimer delay 20

[S2-Vlanif13]quit

[S2]interface vlan 14

[S2-Vlanif14]vrrp vrid 14 virtual-ip172.16.14.254

[S2-Vlanif14]vrrp vrid 14 priority 120      

[S2-Vlanif14]vrrp vrid 14 preempt-modetimer delay 20

[S2-Vlanif14]quit     

[S2]interface vlan 15

[S2-Vlanif15]vrrp vrid 15 virtual-ip172.16.15.254

[S2-Vlanif15]vrrp vrid 15 priority 120

[S2-Vlanif15]vrrp vrid 15 preempt-modetimer delay 20

[S2-Vlanif15]quit     

[S2]interface vlan 16

[S2-Vlanif16]vrrp vrid 16 virtual-ip172.16.16.254 

[S2-Vlanif16]vrrp vrid 16 priority 120

[S2-Vlanif16]vrrp vrid 16 preempt-modetimer delay 20

[S2-Vlanif16]quit     

[S2]interface vlan 17

[S2-Vlanif17]vrrp vrid 17 virtual-ip172.16.17.254 

[S2-Vlanif17]vrrp vrid 17 priority 120

[S2-Vlanif17]vrrp vrid 17 preempt-modetimer delay 20

[S2-Vlanif17]quit     

[S2]interface vlan 100

[S2-Vlanif100]vrrp vrid 100 virtual-ip172.16.100.254    

[S2-Vlanif100]vrrp vrid 100 priority 120

[S2-Vlanif100]vrrp vrid 100 preempt-modetimer delay 20

[S2-Vlanif100]quit   

[S2]interface vlan 2

[S2-Vlanif2]vrrp vrid 2 virtual-ip172.16.2.254

[S2-Vlanif2]quit        

[S2]interface vlan 3

[S2-Vlanif3]vrrp vrid 3 virtual-ip172.16.3.254

[S2-Vlanif3]quit        

[S2]interface vlan 4

[S2-Vlanif4]vrrp vrid 4 virtual-ip172.16.4.254

[S2-Vlanif4]quit        

[S2]interface vlan 5

[S2-Vlanif5]vrrp vrid 5 virtual-ip172.16.5.254

[S2-Vlanif5]quit        

[S2]interface vlan 6

[S2-Vlanif6]vrrp vrid 6 virtual-ip172.16.6.254

[S2-Vlanif6]quit        

[S2]interface vlan 7

[S2-Vlanif7]vrrp vrid 7 virtual-ip172.16.7.254

[S2-Vlanif7]quit        

[S2]interface vlan 8

[S2-Vlanif8]vrrp vrid 8 virtual-ip172.16.8.254

[S2-Vlanif8]quit        

[S2]interface vlan 9

[S2-Vlanif9]vrrp vrid 9 virtual-ip172.16.9.254

[S2-Vlanif9]quit        

[S2]interface vlan 10

[S2-Vlanif10]vrrp vrid 10 virtual-ip172.16.10.254

[S2-Vlanif10]quit

S3:

前面建立vlan和添加vlan的IP以及vlandescription的方式和S1一样。

[S3]interface GigabitEthernet 0/0/1

[S3-GigabitEthernet0/0/1]port link-typetrunk               ^

[S3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to17 100

[S3]interface GigabitEthernet 0/0/2

[S3-GigabitEthernet0/0/2]port link-typetrunk

[S3-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 to17 100

[S3]stp mode mstp

[S3]stp region-configuration   

[S3-mst-region]region-name myzj

[S3-mst-region]instance 1 vlan 2 to 10

[S3-mst-region]instance 2 vlan 11 to 17 100

[S3-mst-region]active region-configuration

Info: This operation may take a fewseconds. Please wait for a moment...done.

[S3-mst-region]quit

[S3]stp instance 1 priority 32768

[S3]stp instance 2 priority 32768

[S3]stp enable

[S3]interface Ethernet 0/0/22

[S3-Ethernet0/0/22]port link-type access

[S3-Ethernet0/0/22]port default vlan 12

[S3-Ethernet0/0/22]quit

剩余的S4以及S5的配置和S3基本相同。



你可能感兴趣的:(HuaWei)