MSTP:多生成树协议 VRRP:虚拟路由器协议
拓扑图:
逻辑图:正常的状态
#配置代码:
lsw1-----------------------------------------------
sy
vlan 10
vlan 20
quit
interface e0/0/1
port link-type access
port default vlan 10
quit
interface e0/0/2
port link-type access
port default vlan 20
quit
interface e0/0/3
port link-type trunk
port trunk allow-pass vlan all
quit
interface e0/0/4
port link-type trunk
port trunk allow-pass vlan all
quit
配置mstp:
stp enable
stp mode mstp
stp region-configuration
region-name RegionA
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
quit
lsw2-----------------------------------------------
sy
vlan 10
vlan 20
quit
interface e0/0/1
port link-type access
port default vlan 10
quit
interface e0/0/2
port link-type access
port default vlan 20
quit
interface e0/0/3
port link-type trunk
port trunk allow-pass vlan all
quit
interface e0/0/4
port link-type trunk
port trunk allow-pass vlan all
quit
配置mstp:
stp enable
stp mode mstp
stp region-configuration
region-name RegionA
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
quit
lsw3-----------------------------------------------
sy
vlan 10
vlan 20
vlan 100
quit
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan all
quit
端口捆绑:
interface Eth-Trunk 1
quit
interface g0/0/3
eth-trunk 1
quit
interface g0/0/4
eth-trunk 1
quit
interface Eth-Trunk 1
port link-type trunk
port trunk allow-pass vlan all
quit
interface g0/0/5
port link-type access
port default vlan 100
quit
interface vlanif 100
ip add 10.0.0.1 24
quit
配置rip:
rip
version 2
network 192.168.10.0
network 192.168.20.0
network 10.0.0.0
quit
配置mstp:
stp enable
stp mode mstp
stp region-configuration
region-name RegionA
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
quit
stp instance 1 priority 4096
配置vrrp:
interface vlanif 10
ip add 192.168.10.251 24
vrrp vrid 1 virtual-ip 192.168.10.254
vrrp vrid 1 priority 200
quit
interface vlanif 20
ip add 192.168.20.251 24
vrrp vrid 2 virtual-ip 192.168.20.254
quit
配置端口跟踪:
interface vlanif 10
vrrp vrid 1 track interface g0/0/5 reduced 150
quit
lsw4-----------------------------------------------
vlan 10
vlan 20
vlan 200
quit
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan all
quit
端口捆绑:
interface Eth-Trunk 1
quit
interface g0/0/3
eth-trunk 1
quit
interface g0/0/4
eth-trunk 1
quit
interface Eth-Trunk 1
port link-type trunk
port trunk allow-pass vlan all
quit
interface g0/0/5
port link-type access
port default vlan 200
quit
interface vlanif 200
ip add 20.0.0.1 24
quit
配置rip:
rip
version 2
network 192.168.10.0
network 192.168.20.0
network 20.0.0.0
quit
配置mstp:
stp enable
stp mode mstp
stp region-configuration
region-name RegionA
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
quit
stp instance 2 priority 4096
配置vrrp:
interface vlanif 10
ip add 192.168.10.252 24
vrrp vrid 1 virtual-ip 192.168.10.254
quit
interface vlanif 20
ip add 192.168.20.252 24
vrrp vrid 2 virtual-ip 192.168.20.254
vrrp vrid 2 priority 200
quit
配置端口跟踪:
interface vlanif 20
vrrp vrid 2 track interface g0/0/5 reduced 150
quit
AR1------------------------------------------------
sy
interface g0/0/0
ip add 10.0.0.2 24
quit
interface g0/0/1
ip add 20.0.0.2 24
quit
interface g0/0/2
ip add 30.0.0.254 24
quit
配置rip:
rip
version 2
network 10.0.0.0
network 20.0.0.0
network 30.0.0.0
quit
#测试图
#将LSW3关闭测试
#关闭后的逻辑图(注:此图的LSW3为开机状态,关闭时状态的图忘截了,所以用的最开始的图片)