MSTP+VRRP组合实现S1和S2的(双交换)热备冗余及负载均衡
来源:互联网 发布:日在校园知乎评价 编辑:程序博客网 时间:2024/06/05 16:41
一、前期准备:
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基本相同。
- MSTP+VRRP组合实现S1和S2的(双交换)热备冗余及负载均衡
- HSRP VRRP GLBP网关冗余和负载均衡
- LVS+Keepalived实现负载均衡和双机热备
- LVS+keepalived实现双机热备和负载均衡
- LVS+Keepalived实现负载均衡和双机热备
- VRRP负载均衡
- linux下双网卡绑定——实现:失效保护(冗余)和双网卡负载均衡
- 关于网络层的负载均衡和热备
- Mysql的双机热备和负载均衡
- linux配置双网卡绑定,以实现冗余和负载均衡
- centos多网卡绑定(汇聚),实现冗余和负载均衡
- 负载均衡和双机热备
- 负载均衡和双机热备
- HA热备和F5负载均衡
- [linux网络] 双网卡bonding实现冗余/负载均衡
- char *s1和char s2[]的区别
- RouterOS Vrrp多播及PCC负载均衡
- 实验: 使用 Apache 反向代理实现负载均衡及热备[摘]
- SpringMVC框架中jsp页面引用的js,css,html文件在运行时出现404错误
- invalidate()和postInvalidate() 的区别
- 曝光!!!扫码生活 App 其实是一个垃圾应用,毫无用处,下面我就给大家说说理由吧!
- SpringMVC 数据绑定 Map
- Android Studio系列教程(二)
- MSTP+VRRP组合实现S1和S2的(双交换)热备冗余及负载均衡
- IO协议栈前沿技术研究动态(2015存储峰会分享)
- ListView高度测量
- 关于微信内WebView跳转到App Store
- android图片压缩质量参数Bitmap.Config RGB_565等的含义
- 面试题31:二叉搜索树与双向链表
- android viewgroup 的事件传递机制学习笔记
- js方法数据验证
- iOS--代码关联storyboard