①:底层配置: vlan trunk 略
②:MSTP配置:
所有交换机:
stp region-configuration
region-name aa
revision-level 1
instance 1 vlan 2 to 3
instance 2 vlan 4 to 5
active region-configuration
核心1:
stp instance 1 root primary
stp instance 2 root secondary
核心2:
stp instance 2 root primary
stp instance 1 root secondary
MSTP配置完成后,在接入1、2查看对应instance的端口阻塞情况
③:VRRP配置:
核心交换机hexin1:
interface Vlanif2
ip address 192.168.2.254 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.1
vrrp vrid 2 priority 105
vrrp vrid 2 track interface GigabitEthernet0/0/6
vrrp vrid 2 track interface GigabitEthernet0/0/1(上下行端口检测)
#
interface Vlanif3
ip address 192.168.3.254 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.1
vrrp vrid 3 priority 105
vrrp vrid 3 track interface GigabitEthernet0/0/6
vrrp vrid 3 track interface GigabitEthernet0/0/1(上下行端口检测)
#
interface Vlanif4
ip address 192.168.4.254 255.255.255.0
vrrp vrid 4 virtual-ip 192.168.4.1
#
interface Vlanif5
ip address 192.168.5.254 255.255.255.0
vrrp vrid 5 virtual-ip 192.168.5.1
#
核心交换机
hexin2:
interface Vlanif2
ip address 192.168.2.253 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.1
#
interface Vlanif3
ip address 192.168.3.253 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.1
#
interface Vlanif4
ip address 192.168.4.253 255.255.255.0
vrrp vrid 4 virtual-ip 192.168.4.1
vrrp vrid 4 priority 105
vrrp vrid 4 track interface GigabitEthernet0/0/6
vrrp vrid 4 track interface GigabitEthernet0/0/4(上下行端口检测)
#
interface Vlanif5
ip address 192.168.5.253 255.255.255.0
vrrp vrid 5 virtual-ip 192.168.5.1
vrrp vrid 5 priority 105
vrrp vrid 5 track interface GigabitEthernet0/0/6
vrrp vrid 5 track interface GigabitEthernet0/0/4(上下行端口检测)
VRRP配置完成后,查看两个核心路由器,PC可ping测试各自的网关
④:OSPF配置
核心1 核心2
ospf 1 ospf 1
area 0.0.0.0 area 0.0.0.0
network 192.168.2.0 0.0.0.255 network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255 network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255 network 192.168.4.0 0.0.0.255
network 192.168.5.0 0.0.0.255 network 192.168.5.0 0.0.0.255
network 12.1.1.0 0.0.0.255 network 23.1.1.0 0.0.0.255
路由器:
ospf 1
area 0.0.0.0
network 12.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
缺省路由配置(配置缺省路由备份):
核心1:
ip route-static 0.0.0.0 0.0.0.0 12.1.1.1
ip route-static 0.0.0.0 0.0.0.0 23.1.1.1 preference 65
核心2:
ip route-static 0.0.0.0 0.0.0.0 23.1.1.1
ip route-static 0.0.0.0 0.0.0.0 12.1.1.1 preference 65
修改ospf开销值使来回报文传输路径一致
核心1: 核心2:
int vlanif4 int vlanif2
ospf cost 4 ospf cost 4
int vlanif5 int vlanif3
ospf cost 4 ospf cost 4
配置完成!