(一)拓扑描述:
本次实验采用MSTP+OSPF+VRRP技术,提供网络高可靠性、稳定性。MSTP(多生成树实例)主要解决网络中(SW5—SW4—SW6)设备间的环路问题,对接入交换机双上行链路进行备份;对业务流进行负载分担。OSPF(开放最短路径优先协议)动态路由技术,处理(SW5—SW4—SW7)之间的路由学习,计算出多条路径,实现出口链路负载;vrrp(虚拟网关路由协议)通过将两台核心交换机上面的地址虚拟出来一个虚拟IP地址作为用户提供网关服务。核心层交换机任意一台出现故障不会影响用户网络服务。
设备需求:
采用四台5700-28C-HI交换机,两台PC,7条网线。
IP地址规划:
四台交换机采用192.168.1.1-192.168.1.4作为设备的管理地址及担当设备互联地址。
核心交换机SW4上面 vlan 2(192.168.2.252) vlan 3(192.168.2.252)
核心交换机SW5上面 vlan 2(192.168.3.252) vlan 3(192.168.3.252)
在两台核心交换机做VRRP(vlan2 vip:192.168.2.254;vlan 3 vip:192.168.3.254)
(二)配置步骤;
1、 配置交换机(SW4—SW5—SW6—SW7)的互联IP地址,设备互联端口启用TRUNK模式。
2、 配置MSTP生成树。
3、 配置VRRP
4、 配置ospf
5、 测试各项
(一)配置命令及验证结果:
1、 SW4:(SW5—SW6—SW7和SW4配置一致)
interface Vlanif1
ip address 192.168.1.3 255.255.255.0
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
2、 SW4
stp region-configuration
region-name h3c
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp instance 2 priority 4096
stp instance 3 priority 8192
SW5
stp region-configuration
region-name h3c
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp instance 2 priority 8192
stp instance 3 priority 4096
SW6
stp region-configuration
region-name h3c
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp instance 2 priority 12288
stp instance 3 priority 12288
3、 SW4
interface Vlanif2
ip address 192.168.2.252 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.2.254
vrrp vrid 1 priority 120
interface Vlanif3
ip address 192.168.3.252 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.3.254
SW5
interface Vlanif2
ip address 192.168.2.253 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.2.254
interface Vlanif3
ip address 192.168.3.253 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.3.254
vrrp vrid 2 priority 120
4、 SW4(其他配置雷同)
ospf 1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
5、 查看各协议状态
1、在接入交换机查看生成树实例
<Huawei>dis stp instance 2 brief
MSTID Port Role STP State Protection
2 GigabitEthernet0/0/1 ALTE DISCARDING NONE
2 GigabitEthernet0/0/2 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 DESI FORWARDING NONE
<Huawei>dis stp instance 3 brief
MSTID Port Role STP State Protection
3 GigabitEthernet0/0/1 ROOT FORWARDING NONE
3 GigabitEthernet0/0/2 ALTE DISCARDING NONE
3 GigabitEthernet0/0/4 DESI FORWARDING NONE
2、查看vrrp状态
[sw4]dis vrrp brief
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Master Vlanif2 Normal 192.168.2.254
2 Backup Vlanif3 Normal 192.168.3.254
----------------------------------------------------------------
Total:2 Master:1 Backup:1 Non-active:0
[sw5]dis vrrp brief
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Backup Vlanif2 Normal 192.168.2.254
2 Master Vlanif3 Normal 192.168.3.254
----------------------------------------------------------------
Total:2 Master:1 Backup:1 Non-active:0
3、查看路由表
[sw5]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.2 Vlanif1
192.168.1.2/32 Direct 0 0 D 127.0.0.1 Vlanif1
192.168.2.0/24 Direct 0 0 D 192.168.2.253 Vlanif2
192.168.2.253/32 Direct 0 0 D 127.0.0.1 Vlanif2
192.168.2.254/32 OSPF 10 2 D 192.168.2.252 Vlanif2
OSPF 10 2 D 192.168.3.252 Vlanif3
OSPF 10 2 D 192.168.1.3 Vlanif1
192.168.3.0/24 Direct 0 0 D 192.168.3.253 Vlanif3
192.168.3.253/32 Direct 0 0 D 127.0.0.1 Vlanif3
192.168.3.254/32 Direct 0 0 D 127.0.0.1 Vlanif3