一、实验拓扑
二、实验要求
1.进行基础配置,配置对应的IP地址、access、trunk、接口。
2.实验运行MSTP协议,域名为MSTP1,设置修订版本号为1,实例1映射的vlan为1,实例2映射的vlan为2.
设置SW1为实例1的根桥,实例2的备份根桥.
SW2为实例2的根桥,实例1的备份根桥。
3.配置vrrp,设置vrrp组为2,虚拟网关为192.168.2.254, SW1为vid2中的master,SW2为backup.
设置vrrp组为3,虚拟网关为192.168.3.254, SW2为vid3中的master,SW1为backup。
在SW1和SW2上配置VRRP备份组监视接口。
4.在SW1,SW2,R1上配置OSPF 所有IP地址宣告进区域0中,router-id依次为2.2.2.2 ,3.3.3.3, 1.1.1.1。
5.最终目的是实现流量的负载均衡,使得pc1通过SW1可以访问到环回口,pc2通过SW2可以访问到环回口
三、实验配置
基础配置:
SW1,SW2:
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW3:
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 3
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
MSTP配置:
SW2:#
stp instance 1 priority 4096
stp instance 2 priority 0
stp region-configuration
region-name yqing
revision-level 1
instance 1 vlan 2
instance 2 vlan 3
active region-configuration
interface Vlanif2
ip address 192.168.2.253 255.255.255.0
#
interface Vlanif3
ip address 192.168.3.253 255.255.255.0
SW1:
interface Vlanif2
ip address 192.168.2.252 255.255.255.0
#
interface Vlanif3
ip address 192.168.3.252 255.255.255.0
stp region-configuration
region-name yqing
revision-level 1
instance 1 vlan 2
instance 2 vlan 3
active region-configuration
#
stp instance 1 priority 0
stp instance 2 priority 4096
vrrp 配置
SW1:
interface Vlanif2
vrrp vrid 2 virtual-ip 192.168.2.254
vrrp vrid 2 priority 150
vrrp vrid 2 track interface GigabitEthernet0/0/1 reduced 60
interface Vlanif3
vrrp vrid 3 virtual-ip 192.168.3.254
SW2:
interface Vlanif3
ip address 192.168.3.253 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.254
vrrp vrid 3 priority 150
vrrp vrid 3 track interface GigabitEthernet0/0/1 reduced 60
#
interface Vlanif2
vrrp vrid 2 virtual-ip 192.168.2.254
#
ospf:
R1:
ospf router-id 1.1.1.1
area 0
g0/0/0,g0/0/1,looback0:
ospf enable 1 area 0.0.0.0
SW1:
ospf router-id 2.2.2.2
area 0
vlanif2,vlanif3,vlanif12:
ospf enable 1 area 0.0.0.0
interface GigabitEthernet0/0/1
port link-type access
port default vlan 12
SW2:
ospf router-id 2.2.2.2
area 0
vlanif2,vlanif3,vlanif13:
ospf enable 1 area 0.0.0.0
interface GigabitEthernet0/0/1
port link-type access
port default vlan 13
四、配置验证
不好的的地方,或者有哪些地方有错误,请大家批评指正。谢谢!