多生成树协议,冗余备份,负载均衡
R4
上设置
R4>en
R4#conf t
R4(config)#no ip routing
去掉路由功能
R4(config)#vlan 10
R4(config-vlan)#vlan 20
R4(config-vlan)#inter f1/1
划分
VLAN
R4(config-if)#switchport access vlan 10
R4(config-if)#inter fa1/2
R4(config-if)#switchport access vlan 20
R4(config)#interface range f1/3 -4
设置成中继端口
R4(config-if-range)#switchport mode trunk
R4(config-if-range)#switchport trunk encapsulation dot1q
R4(config-if-range)#ex
R2
配置
R2>en
R2#conf t
R2(config)#no ip routing
R2(config)#vlan 10
R2(config-vlan)#vlan 20
R2(config-vlan)#end
R2(config)#interface range f1/1 -2
R2(config-if-range)#switchport mode trunk
R2(config-if-range)#switchport trunk encapsulation dot1q
R2(config-if-range)#ex
R2(config)#spanning-tree vlan 10 root primary
生成树根优先级
VLAN 10 bridge priority set to 8192
VLAN 10 bridge max aging time unchanged at 20
VLAN 10 bridge hello time unchanged at 2
VLAN 10 bridge forward delay unchanged at 15
R2(config)#spanning-tree vlan 20 root secondary
VLAN 20 bridge priority set to 16384
VLAN 20 bridge max aging time unchanged at 20
VLAN 20 bridge hello time unchanged at 2
VLAN 20 bridge forward delay unchanged at 15
在
R3
设置
R3>en
R3#conf t
R3(config)#no ip routing
R3(config)#vlan 10
R3(config-vlan)#vlan 20
R3(config)#interface range f1/1 -2
R3(config-if-range)#switchport mode trunk
R3(config-if-range)#switchport trunk encapsulation dot1q
R3(config-if-range)#ex
R3(config)#spanning-tree vlan 10 root secondary
VLAN 10 bridge priority set to 16384
VLAN 10 bridge max aging time unchanged at 20
VLAN 10 bridge hello time unchanged at 2
VLAN 10 bridge forward delay unchanged at 15
R3(config)#spanning-tree vlan 20 root primary
VLAN 20 bridge priority set to 8192
VLAN 20 bridge max aging time unchanged at 20
VLAN 20 bridge hello time unchanged at 2
VLAN 20 bridge forward delay unchanged at 15
在三层交换上配置!
R1>en
R1#conf t
R1(config)#vlan 10
R1(config)#vlan 20
R1(config)#interface range f1/0 -1
R1(config-if-range)#switchport mode trunk
R1(config-if-range)#switchport trunk encapsulation dot1q
R1(config-if-range)#inter vlan 10
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter vlan 20
R1(config-if)#ip add
R1(config-if)#ip address 192.168.20.1 255.255.255.0
R1(config-if)#no shut
本文转自 cs312779641 51CTO博客,原文链接:http://blog.51cto.com/chenhao6/1163716