所有交换机配置vlan
[JR_03]vlan batch 2 3 4 5 6 7
交换机之间链路打trunk
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
接入交换机与终端接口打access
interface Ethernet0/0/3
port link-type access
port default vlan 6
#
interface Ethernet0/0/4
port link-type access
port default vlan 7
所有交换机配置MSTP
HX_01]stp region-configuration
[HX_01-mst-region]region-name aa
[HX_01-mst-region]revision-level 1
[HX_01-mst-region]instance 1 ?
vlan Virtual LAN
[HX_01-mst-region]instance 1 vlan 2 3 6
[HX_01-mst-region]instance 2 vlan 4 5 7
[HX_01-mst-region]ac
[HX_01-mst-region]active r
[HX_01-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[HX_01-mst-region]dis
[HX_01-mst-region]display this
#
stp region-configuration
region-name aa
revision-level 1
instance 1 vlan 2 to 3 6
instance 2 vlan 4 to 5 7
active region-configuration
#
return
核心交换机配置STP优先级
[HX_01]stp instance 1 root primary
[HX_01]stp instance 2 root secondary
---------------------
[HX_02]stp instance 1 root secondary
[HX_02]stp instance 2 root primary
查看部分交换机MSTP状态-接入交换机1
[JR_01]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING NONE
0 Ethernet0/0/2 DESI FORWARDING NONE
0 Ethernet0/0/3 DESI FORWARDING NONE
0 Ethernet0/0/4 DESI FORWARDING NONE
1 Ethernet0/0/1 ROOT FORWARDING NONE
1 Ethernet0/0/2 ALTE DISCARDING NONE
1 Ethernet0/0/3 DESI FORWARDING NONE
1 Ethernet0/0/4 DESI FORWARDING NONE
2 Ethernet0/0/1 ALTE DISCARDING NONE
2 Ethernet0/0/2 ROOT FORWARDING NONE
查看核心交换机在不同STP 实例优先级
[HX_02]display stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID :4096.4c1f-cc35-7460
MSTI RegRoot/IRPC :0.4c1f-cc29-17a7 / 20000
MSTI RootPortId :128.2
MSTI Root Type :Secondary root
Master Bridge :32768.4c1f-cc02-50a4
Cost to Master :20000
TC received :43
TC count per hello :0
Time since last TC :0 days 0h:4m:11s
Number of TC :23
Last TC occurred :GigabitEthernet0/0/2
----[Port2(GigabitEthernet0/0/2)][FORWARDING]----
Port Role :Root Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.4c1f-cc29-17a7 / 128.2
Port Times :RemHops 20
TC or TCN send :9
TC or TCN received :26
----[Port3(GigabitEthernet0/0/3)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.4c1f-cc35-7460 / 128.3
Port Times :RemHops 19
TC or TCN send :21
TC or TCN received :14
----[Port4(GigabitEthernet0/0/4)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.4c1f-cc35-7460 / 128.4
Port Times :RemHops 19
TC or TCN send :5
TC or TCN received :0
----[Port5(GigabitEthernet0/0/5)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.4c1f-cc35-7460 / 128.5
Port Times :RemHops 19
TC or TCN send :7
TC or TCN received :1
[HX_02]dis
[HX_02]display stp in
[HX_02]display stp instance 2
-------[MSTI 2 Global Info]-------
MSTI Bridge ID :0.4c1f-cc35-7460
MSTI RegRoot/IRPC :0.4c1f-cc35-7460 / 0
MSTI RootPortId :0.0
MSTI Root Type :Primary root
Master Bridge :32768.4c1f-cc02-50a4
Cost to Master :20000
TC received :58
TC count per hello :0
Time since last TC :0 days 0h:2m:39s
Number of TC :28
Last TC occurred :GigabitEthernet0/0/4
----[Port2(GigabitEthernet0/0/2)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.4c1f-cc35-7460 / 128.2
Port Times :RemHops 20
TC or TCN send :25
TC or TCN received :28
----[Port3(GigabitEthernet0/0/3)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.4c1f-cc35-7460 / 128.3
Port Times :RemHops 20
TC or TCN send :32
TC or TCN received :17
----[Port4(GigabitEthernet0/0/4)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.4c1f-cc35-7460 / 128.4
Port Times :RemHops 20
TC or TCN send :2
TC or TCN received :4
----[Port5(GigabitEthernet0/0/5)][FORWARDING]----
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.4c1f-cc35-7460 / 128.5
Port Times :RemHops 20
TC or TCN send :14
TC or TCN received :1
配置VRRP-vlanif 地址配置
核心交换机1配置:
[HX_01]int vlanif 2
[HX_01-Vlanif2]ip add 192.168.2.253 24
[HX_01-Vlanif2]int vlanif 3
[HX_01-Vlanif3]ip add 192.168.3.253 24
[HX_01-Vlanif3]int vlanif 4
[HX_01-Vlanif4]ip add 192.168.4.253 24
[HX_01-Vlanif4]int vlanif 5
[HX_01-Vlanif5]ip add 192.168.5.253 24
[HX_01-Vlanif5]int vlanif 6
[HX_01-Vlanif6]ip add 192.168.6.253 24
[HX_01-Vlanif6]int vlanif 7
[HX_01-Vlanif7]ip add 192.168.7.253 24
[HX_01-Vlanif7]
---------------
核心交换机2配置
[HX_02]int vlanif 2
[HX_02-Vlanif2]ip add 192.168.2.254 24
[HX_02-Vlanif2]int vlanif 3
[HX_02-Vlanif3]ip add 192.168.3.254 24
[HX_02-Vlanif3]int vlanif 4
[HX_02-Vlanif4]ip add 192.168.4.254 24
[HX_02-Vlanif4]int vlanif 5
[HX_02-Vlanif5]ip add 192.168.5.254 24
[HX_02-Vlanif5]int vlanif 6
[HX_02-Vlanif6]ip add 192.168.6.254 24
[HX_02-Vlanif6]int vlanif 7
[HX_02-Vlanif7]ip add 192.168.7.254 24
[HX_02-Vlanif7]
查看vlanif 配置结果
[HX_02]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 9
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 8
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned up down
Vlanif2 192.168.2.254/24 up up
Vlanif3 192.168.3.254/24 up up
Vlanif4 192.168.4.254/24 up up
Vlanif5 192.168.5.254/24 up up
Vlanif6 192.168.6.254/24 up up
Vlanif7 192.168.7.254/24 up up
Vlanif800 23.1.1.1/24 up up
每个vlanif接口配置vrrp vrid
[HX_01]int Vlanif 2
[HX_01-Vlanif2]vrrp vrid 2 virtual-ip 192.168.2.1 ?
<cr>
[HX_01-Vlanif2]vrrp vrid 2 virtual-ip 192.168.2.1
[HX_01-Vlanif2]vrrp vrid 2 priority 105
[HX_01]int vlanif 3
[HX_01-Vlanif3]vrrp vrid 3 virtual-ip 192.168.3.1
[HX_01-Vlanif3]vrrp vrid 3 priority 105
[HX_01-Vlanif3]int vlanif 4
[HX_01-Vlanif4]vrrp vrid 4 virtual-ip 192.168.4.1
[HX_01-Vlanif4]int vlanif 5
[HX_01-Vlanif5]vrrp vrid 5 virtual-ip 192.168.5.1
[HX_01-Vlanif5]int vlanif 6
[HX_01-Vlanif6]vrrp vrid 6 virtual-ip 192.168.6.1
[HX_01-Vlanif6]vrrp vrid 6 priority 105
[HX_01-Vlanif7]vrrp vrid 7 virtual-ip 192.168.7.1
----------
[HX_02-Vlanif1]int vlanif 2
[HX_02-Vlanif2]vrrp vrid 2 virtual-ip 192.168.2.1
[HX_02-Vlanif2]int vlanif 3
[HX_02-Vlanif3]vrrp vrid 3 virtual-ip 192.168.3.1
[HX_02-Vlanif3]int vlanif 4
[HX_02-Vlanif4]vrrp vrid 4 virtual-ip 192.168.4.1
[HX_02-Vlanif4]int vlanif 5
[HX_02-Vlanif5]vrrp vrid 5 virtual-ip 192.168.5.1
[HX_02-Vlanif5]vrrp vrid 5 priority 105
[HX_02-Vlanif5]int vlanif 4
[HX_02-Vlanif4]vrrp vrid 4 priority 105
[HX_02-Vlanif4]int vlanif 6
[HX_02-Vlanif6]vrrp vrid 6 virtual-ip 192.168.6.1
[HX_02-Vlanif6]int vlanif 7
[HX_02-Vlanif7]vrrp vrid 7 virtual-ip 192.168.7.1
[HX_02-Vlanif7]vrrp vrid 7 priority 105
核心交换机1VRRP配置结果
[HX_01]display vrrp brief
VRID State Interface Type Virtual IP
----------------------------------------------------------------
2 Master Vlanif2 Normal 192.168.2.1
3 Master Vlanif3 Normal 192.168.3.1
4 Backup Vlanif4 Normal 192.168.4.1
5 Backup Vlanif5 Normal 192.168.5.1
6 Master Vlanif6 Normal 192.168.6.1
7 Backup Vlanif7 Normal 192.168.7.1
----------------------------------------------------------------
Total:6 Master:3 Backup:3 Non-active:0
核心交换机2VRRP配置结果
[HX_02]display vrrp brief
VRID State Interface Type Virtual IP
----------------------------------------------------------------
2 Backup Vlanif2 Normal 192.168.2.1
3 Backup Vlanif3 Normal 192.168.3.1
4 Master Vlanif4 Normal 192.168.4.1
5 Master Vlanif5 Normal 192.168.5.1
6 Backup Vlanif6 Normal 192.168.6.1
7 Master Vlanif7 Normal 192.168.7.1
----------------------------------------------------------------
Total:6 Master:3 Backup:3 Non-active:0
实验拓扑