典型二层+三层+三层的组网
接入层与汇聚层之间启用MSTP,这样不但可以消除环路,同时还可以实现二层链路的负载均衡,有效利用二层链路带宽。同时在汇聚层使用VRRP,实现路由的冗余,提高可靠性,也具有路由负载均衡的效果。三层的路由使用OSPF组成区域零,实现路由的动态更新。内网与外网的连接采用BGP协议。
网络规划:
创建4个VLAN,使用MSTP将VLAN加入不同的实列当中
配置MSTP
stp enable
stp mode mstp
stp region-configuration
region-name GROUP1
instance 1 vlan 100 200 (将VLAN 100 200映射到实例1当中)
instance 2 vlan 300 400 (将VLAN 300 400映射到实例2当中)
active region-configuration
分别配置实例1和实例2的主备根桥,实现流量的负载分担
SW1
stp instance 1 root primary
stp instance 2 root secondary
SW2
stp instance 1 root secondary
stp instance 2 root primary
配置VRRP
网络中部署VRRP负载分担时,多台设备同时承担业务,每个虚拟设备都包括一个Master设备和若干个Backup设备。如果为了接入备份同时需要部署冗余链路,则需要部署MSTP消除网络中的环路,保证流量的负载分担。(MSTP+VRRP)
SW1:
int vlanif 100
vrrp vrid 1 virtual-ip 192.168.1.252
vrrp vrid 1 priority 120
vrrp vrid 1 preempt timer delay 20
int vlanif 200
vrrp vrid 2 virtual-ip 192.168.2.252
vrrp vrid 2 priority 120
vrrp vrid 2 preempt timer delay 20
int vlanif 300
vrrp vrid 3 virtual-ip 192.168.3.252
int vlanif 400
vrrp vrid 4 virtual-ip 192.168.4.252
SW2:
int vlanif 100
vrrp vrid 1 virtual-ip 192.168.1.252
int vlanif 200
vrrp vrid 2 virtual-ip 192.168.2.252
int vlanif 300
vrrp vrid 3 virtual-ip 192.168.3.252
vrrp vrid 3 priority 120
vrrp vrid 3 preempt timer delay 20
int vlanif 400
vrrp vrid 4 virtual-ip 192.168.4.252
vrrp vrid 4 priority 120
vrrp vrid 4 preempt timer delay 20
vrrp vrid 1 track int g1/0/1 reduce 30(监控上层链路故障时切换网关)
配置OSPF
ospf 1 router-id 100.100.100.100
area 0
authentication-mode md5 1 cipher huawei
network 10.1.1.0 0.0.0.255
network 10.3.3.0 0.0.0.255
配置BGP
bgp 10
router-id 3.3.3.3
peer 10.5.5.1 as-number 20
peer 10.6.6.2 as-number 20
ipv4-family unicast
undo synchronization
import-route direct
maximum load-balancing 2
peer 10.5.5.1 enable
peer 10.6.6.2 enable
bgp 20
router-id 1.1.1.1
peer 10.5.5.3 as-number 10
ipv4-family unicast
import-route direct
import-route ospf 1
peer 10.5.5.3 enable