发布网友 发布时间:2022-04-23 10:23
共2个回答
热心网友 时间:2023-10-11 09:59
注意图中
Vlan 10访问192.168.1.0/24的路径 sw1—sw2—R1,VLAN 20访问192.168.1.0/24的路径sw1—sw3-R1,互为主备,且来回路径一致
配置MSTP,保证VLAN 10的主、备份根分别是SW2、SW3,VLAN 20的主、备份根分别是SW3、SW2
配置VRRP,保证VLAN 10的主、备份网关是SW2、SW3,VLAN 20的主、备份网关分别是SW3、SW2
配置SW2和SW3的互联链路为AP
sw2#sh run
vlan 1
vlan 10
vlan 20
vlan 500-------互联vlan
spanning-tree
spanning-tree mst configuration
instance 0 vlan 1-19, 21-4094
instance 1 vlan 20
Spanning-tree mst 0 priority 4096
Spanning-tree mst 1 priority 8192
interface FastEthernet 0/1
switchport mode trunk
!
interface FastEthernet 0/22
no switchport
no ip proxy-arp
ip address 10.1.1.1 255.255.255.252
!
interface FastEthernet 0/23
port-group 1
!
interface FastEthernet 0/24
port-group 1!
interface AggregatePort 1
switchport mode trunk
!
interface VLAN 10
no ip proxy-arp
ip address 172.16.10.252 255.255.255.0
vrrp 10 priority 105 如果虚拟ip和接口ip相同,该接口的优先级为255
vrrp 10 ip 172.16.10.254
vrrp 10 track FastEthernet 0/22 -跟踪上行端口,如果上行链路无效,马上掉默认10的优先值
!
interface VLAN 20
no ip proxy-arp
ip address 172.16.20.252 255.255.255.0
vrrp 20 ip 172.16.20.254 -vrrp20未设优先级,默认就是100,sw3设置了105,故sw3是vlan20的master
!
interface VLAN 500
no ip proxy-arp
ip address 10.1.1.9 255.255.255.252
!
ip route 192.168.1.0 255.255.255.0 10.1.1.2
ip route 192.168.1.0 255.255.255.0 10.1.1.10 20
sw3#sh run
vlan 1
vlan 10
vlan 20
vlan 500-------互联vlan
spanning-tree
spanning-tree mst configuration
instance 0 vlan 1-19, 21-4094
instance 1 vlan 20
Spanning-tree mst 0 priority 8192
Spanning-tree mst 1 priority 4096
interface FastEthernet 0/1
switchport mode trunk
!
interface FastEthernet 0/22
no switchport
no ip proxy-arp
ip address 10.1.1.5 255.255.255.252
!
interface FastEthernet 0/23
port-group 1
!
interface FastEthernet 0/24
port-group 1
interface AggregatePort 1
switchport mode trunk
!
interface VLAN 10
no ip proxy-arp
ip address 172.16.10.253 255.255.255.0
vrrp 10 ip 172.16.10.254
!
interface VLAN 20
no ip proxy-arp
ip address 172.16.20.252 255.255.255.0
vrrp 20 ip 172.16.20.254
vrrp 20 priority 105
vrrp 20 track fa 0/22
!
interface VLAN 500
no ip proxy-arp
ip address 10.1.1.10 255.255.255.252
!
ip route 192.168.1.0 255.255.255.0 10.1.1.6
ip route 192.168.1.0 255.255.255.0 10.1.1.9 20
R1的配置,注意返回路由的和路由的优先级
R1# show run
Int fa0/0
No shutdown
Ip add 10.1.1.2 255.255.255.252
Int fa0/1
No shutdown
Ip add 10.1.1.6 255.255.255.252
Int loopback 0
Ip add 192.168.1.1 255.255.255.0
Ip route 172.16.10.0 255.255.255.0 10.1.1.1
Ip route 172.16.10.0 255.255.255.0 10.1.1.5 20
Ip route 172.16.20.0 255.255.255.0 10.1.1.5
Ip route 172.16.20.0 255.255.255.0 10.1.1.1 20
最后:在接入交换机
1、使用spanning-tree mst configuration进入mst 配置模式
2、使用instance 命令创建实例并和vlan建立映射关系,所有设备的实例及映射关系必须一致,否则就是不同的域
Sw1# show run
vlan 1
vlan 10
vlan 20
spanning-tree
spanning-tree mst configuration
instance 0 vlan 1-19, 21-4094
instance 1 vlan 20
interface FastEthernet 0/1
switchport access vlan 10
!
interface FastEthernet 0/10
switchport access vlan 20
interface FastEthernet 0/22
!
interface FastEthernet 0/23
switchport mode trunk
!
interface FastEthernet 0/24
switchport mode trunk
热心网友 时间:2023-10-11 09:59
SO GA。