自制STP配置实验

本图使用Gns模拟器

实验需求:

1.要求利用vtp实现vlan同步设置

2.要求vtp server实现备份冗余

3.创建vlan 1~10要求MLSW1 是奇数vlan主根

MLSW2 是偶数vlan主根

且两个互为备份

4.接入层流量按拓扑表走

5.要求c1和c3,c2和c5 通讯

 

实验步骤:

拓扑图的构造:

a)MLSW1、MLSW2、ALSW1、ALSW1由四台 3640路由器构成

 

b)给主机配置IP(tools里点击vpcs )

vpcs[1]>ip 192.168.1.2/24 192.168.1.1

vpcs[1]>save !!!必须保存

vpcs[1]>2

 

vpcs[2]>ip 192.168.2.2/24 192.168.2.1

vpcs[2]>save

vpcs[2]>3

 

vpcs[3]>ip 192.168.1.3/24 192.168.1.1

vpcs[3]>save

vpcs[3]>4

 

vpcs[4]>ip 192.168.2.3/24 192.168.2.1

vpcs[4]>save

 

 

Step1:取消路由功能(工作没有此类情况,实验路由有)

MLSW1(config)#no ip routing

MLSW2(config)#no ip routing

ALSW1(config)#no ip routing

ALSW2(config)#no ip routing

 

Step2:完成trunk-link

ALSW1:

ALSW1(config)#int ran f0/3 -4

ALSW1(config-if-range)#switchport trunk encapsulation dot1q

ALSW1(config-if-range)#switchport mode trunk

 

ALSW2:

ALSW2(config)#int ran f0/3 -4

ALSW2(config-if-range)#switchport trunk encapsulation dot1q

ALSW2(config-if-range)#switchport mode trunk

 

MLSW1:

MLSW1(config)#int ran f0/3 -4

MLSW1(config-if-range)#switchport trunk encapsulation dot1q

MLSW1(config-if-range)#switchport mode trunk

MLSW1(config)#int ran f0/14 -15

MLSW1(config-if-range)#switchport trunk encapsulation dot1q

MLSW1(config-if-range)#switchport mode trunk

 

MLSW2:

MLSW2(config)#int ran f0/3 -4

MLSW2(config-if-range)#switchport trunk encapsulation dot1q

MLSW2(config-if-range)#switchport mode trunk

MLSW2(config)#int ran f0/14 -15

MLSW2(config-if-range)#switchport trunk encapsulation dot1q

MLSW2(config-if-range)#switchport mode trunk

 

Show interface trunk

 

Step3:完成VTP设置

MLSW1:

MLSW1#vlan database //vlan d

MLSW1(vlan)#vtp server //vtp s

MLSW1(vlan)#vtp domain a //vtp d a

MLSW1(vlan)#vtp password a

 

MLSW2:

MLSW2#vlan database

MLSW2(vlan)#vtp server

MLSW2(vlan)#vtp domain a

MLSW2(vlan)#vtp password a

 

ALSW1:

ALSW1#vlan database

ALSW1(vlan)#vtp client //vtp c

ALSW1(vlan)#vtp domain a

ALSW1(vlan)#vtp password a

 

ALSW2:

ALSW2#vlan database

ALSW2(vlan)#vtp client

ALSW2(vlan)#vtp domain a

ALSW2(vlan)#vtp password a

 

 

Step4:完成vlan配置并校验是否同步

MLSW1:

MLSW1#vlan database

MLSW1(vlan)#vlan 1

MLSW1(vlan)#vlan 2

MLSW1(vlan)#vlan 3

MLSW1(vlan)#vlan 4

MLSW1(vlan)#vlan 5

MLSW1(vlan)#vlan 6

MLSW1(vlan)#vlan 7

MLSW1(vlan)#vlan 8

MLSW1(vlan)#vlan 9

MLSW1(vlan)#vlan 10

 

Show vlan-switch(特例只在模拟器使用)

Show vtp status

 

Step5:完成接口划入vlan

ALSW1:

ALSW1#conf t

ALSW1 (config)#int f0/1

ALSW1 (config-if)#switchport mode access

ALSW1 (config-if)#switchport access vlan 2 //switchp a v 2

ALSW1 (config-if)#int f0/2

ALSW1 (config-if)#switchport mode access

ALSW1 (config-if)#switchport access vlan 3

 

ALSW2:

ALSW2#conf t

ALSW2 (config)#int f0/1

ALSW2 (config-if)#switchport mode access

ALSW2 (config-if)#switchport access vlan 2

ALSW2 (config-if)#int f0/2

ALSW2 (config-if)#switchport mode access

ALSW2 (config-if)#switchport access vlan 3

 

Show vlan-switch

Ping 主机检验

 

Step6:分析当前STP拓扑

6.1查看交换机BID,查看根桥

MLSW1#show spanning-tree bridge

MLSW2#show spanning-tree bridge

 

6.2确认根桥

MLSW1#show spanning-tree root

 

6.3确认交换机端口状态

MLSW1#show spanning-tree brief

 

 

Step7:修改根桥

MLSW1:

MLSW1#conf t

MLSW1(config)#spanning-tree vlan 1 priority 4096 //优先级越小越优

MLSW1(config)#spanning-tree vlan 3 priority 4096 //pvst

MLSW1(config)#spanning-tree vlan 5 priority 4096 //默认优先级32768

MLSW1(config)#spanning-tree vlan 7 priority 4096

MLSW1(config)#spanning-tree vlan 9 priority 4096

MLSW1(config)#spanning-tree vlan 2 priority 8192

MLSW1(config)#spanning-tree vlan 4 priority 8192

MLSW1(config)#spanning-tree vlan 6 priority 8192

MLSW1(config)#spanning-tree vlan 8 priority 8192

MLSW1(config)#spanning-tree vlan 10 priority 8192

 

 

MLSW2:

MLSW2#conf t

MLSW2(config)#spanning-tree vlan 2 priority 4096

MLSW2(config)#spanning-tree vlan 4 priority 4096

MLSW2(config)#spanning-tree vlan 6 priority 4096

MLSW2(config)#spanning-tree vlan 8 priority 4096

MLSW2(config)#spanning-tree vlan 10 priority 4096

MLSW2(config)#spanning-tree vlan 1 priority 8192

MLSW2(config)#spanning-tree vlan 3 priority 8192

MLSW2(config)#spanning-tree vlan 5 priority 8192

MLSW2(config)#spanning-tree vlan 7 priority 8192

MLSW2(config)#spanning-tree vlan 9 priority 8192

 

 

MLSW1#show spanning-tree brief

MLSW1#show spanning-tree root

 

Step8:多层交换机修改偶数vlan根端口 一上一下

MLSW1 偶数vlan 根端口 14 变15(不变流量不会一上一下)改大14的开销

MLSW1#conf t

MLSW1(config)#int f0/14

MLSW1(config-if)#spanning-tree vlan 2 cost 100

MLSW1(config-if)#spanning-tree vlan 4 cost 100

MLSW1(config-if)#spanning-tree vlan 6 cost 100

MLSW1(config-if)#spanning-tree vlan 8 cost 100

MLSW1(config-if)#spanning-tree vlan 10 cost 100

 

MLSW1#show spanning-tree brief

 

 

Step9:接入层检验奇偶,流量是否走各自根

ALSW1#show spanning-tree brief

最后用ping检测是否通讯

 

 

易错点:1)vpcs[1]是指20000 vpcs[2]是指20001 以此类推

2)输入完ip地址后必须save保存一下

转载于:https://www.cnblogs.com/jinhengyu/p/7517224.html

你可能感兴趣的:(自制STP配置实验)