CCNA重点难点:生成树配置

后台收到粉丝留言说讲一下生成树的配置,小微作为一个宠粉专业户,这还不快分分钟安排上,所以小伙伴们有想学想看的知识点都可以留言给小微,小微加更都会安排上~

 

实验目的

 

1. 理解生成树的运行原理

2. 掌握生成树的配置方法

 

实验拓扑

 

图片

 

实验需求

 

1. 根据实验拓扑图,完成设备的基本配置;

2. 把交换机互连的链路配置成Trunk,采用Dot1q封装;

3. 分别在SW1、SW2和SW3上创建VLAN10和VLAN20,并将相应的接口划到对应的VLAN;

4. SW1要作为VLAN10的根,VLAN20的备份根,使PC1访问Server1的路径通过:PC1->SW3->SW1->Server1;

5. SW2要作为VLAN20的根,VLAN10的备份根,使PC2访问Server2的路径通过:PC2->SW3->SW2->Server2;

 

实验步骤

 

步骤1:设备的基本配置

配置PC1

  •  
  •  
VPCS> set pcname PC1   //设置主机名PC1> ip 192.168.1.1/24      //设置IP地址

 

配置PC2

  •  
  •  
VPCS> set pcname PC2PC2> ip 172.16.1.1/24

 

配置Server1

  •  
  •  
VPCS> set pcname Server1Server1> ip 192.168.1.88/24

 

配置Server2

  •  
  •  
VPCS> set pcname Server2Server2> ip 172.16.1.88/24

 

配置SW1

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Switch>enableSwitch#configure terminalSwitch(config)#hostname SW1SW1(config)#no ip domain-lookupSW1(config)#line console 0SW1(config-line)#exec-timeout 0 0SW1(config-line)#logging synchronousSW1(config-line)#endSW1#

 

配置SW2

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Switch>enableSwitch#configure terminalSwitch(config)#hostname SW2SW2(config)#no ip domain-lookupSW2(config)#line console 0SW2(config-line)#exec-timeout 0 0SW2(config-line)#logging synchronousSW2(config-line)#endSW2#

 

配置SW3

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Switch>enableSwitch#configure terminalSwitch(config)#hostname SW3SW3(config)#no ip domain-lookupSW3(config)#line console 0SW3(config-line)#exec-timeout 0 0SW3(config-line)#logging synchronousSW3(config-line)#endSW3#

步骤2:配置Trunk与VLAN

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
配置SW1:SW1(config)#interface range Eth0/0 - 1SW1(config-if-range)#switchport trunk encapsulation dot1qSW1(config-if-range)#switchport mode trunkSW1(config-if-range)#exitSW1(config)#vlan 10SW1(config-vlan)#name ITSW1(config-vlan)#exitSW1(config)#vlan 20SW1(config-vlan)#name HRSW1(config-vlan)#exitSW1(config)#interface Eth0/2SW1(config-if)#switchport mode accessSW1(config-if)#switchport access vlan 10SW1(config-if)#exitSW1(config)#endSW1#

配置SW2:

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW2(config)#interface range Eth0/1 , Eth0/3SW2(config-if-range)#switchport trunk encapsulation dot1qSW2(config-if-range)#switchport mode trunkSW2(config-if-range)#exitSW2(config)#vlan 10SW2(config-vlan)#name ITSW2(config-vlan)#exitSW2(config)#vlan 20SW2(config-vlan)#name HRSW2(config-vlan)#exitSW2(config)#interface Eth0/2SW2(config-if)#switchport mode accessSW2(config-if)#switchport access vlan 20SW2(config-if)#exitSW2(config)#endSW2#

 

配置SW3:

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW3(config)#interface range Eth0/0 , Eth0/3SW3(config-if-range)#switchport trunk encapsulation dot1qSW3(config-if-range)#switchport mode trunkSW3(config-if-range)#exitSW3(config)#vlan 10SW3(config-vlan)#name ITSW3(config-vlan)#exitSW3(config)#vlan 20SW3(config-vlan)#name HRSW3(config-vlan)#exitSW3(config)#interface Eth0/1SW3(config-if)#switchport mode accessSW3(config-if)#switchport access vlan 10SW3(config-if)#exitSW3(config)#interface Eth0/2SW3(config-if)#switchport mode accessSW3(config-if)#switchport access vlan 20SW2(config-if)#exitSW3(config)#endSW3#

步骤3:配置生成树

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
配置SW1:SW1(config)#spanning-tree vlan 10 root primarySW1(config)#spanning-tree vlan 20 root secondary

配置SW2:SW2(config)#spanning-tree vlan 20 root primarySW2(config)#spanning-tree vlan 10 root secondary

 

实验检查

 

步骤1:检查VLAN10的生成树

检查SW1

 

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW1#show spanning-tree vlan 10VLAN0010  Spanning tree enabled protocol ieee  Root ID    Priority    24586             Address     aabb.cc00.1000             This bridge is the root             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24586  (priority 24576 sys-id-ext 10)             Address     aabb.cc00.1000             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec             Aging Time  15  sec

Interface           Role Sts Cost      Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Et0/0               Desg FWD 100       128.1    P2pEt0/1               Desg FWD 100       128.2    P2pEt0/2               Desg FWD 100       128.3    P2p

SW1是VLAN10的根网桥,因为SW2是VLAN10的备份根网桥,所以SW3的E0/3针对VLAN10肯定是阻塞状态。

 

检查SW3

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW3#show spanning-tree vlan 10VLAN0010  Spanning tree enabled protocol ieee  Root ID    Priority    24586             Address     aabb.cc00.1000             Cost        100             Port        1 (Ethernet0/0)             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)             Address     aabb.cc00.3000             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Et0/0               Root FWD 100       128.1    P2pEt0/1               Desg FWD 100       128.2    P2pEt0/3               Altn BLK 100       128.4    P2p针对VLAN10,SW3的E0/3是阻塞的,E0/0是转发的,这样PC1访问Server1的路径就是:PC1->SW3->SW1->Server1。

步骤2:检查VLAN20的生成树检查SW2:SW2#show spanning-tree vlan 20VLAN0020  Spanning tree enabled protocol ieee  Root ID    Priority    24596             Address     aabb.cc00.2000             This bridge is the root             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24596  (priority 24576 sys-id-ext 20)             Address     aabb.cc00.2000             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Et0/1               Desg FWD 100       128.2    P2pEt0/2               Desg FWD 100       128.3    P2pEt0/3               Desg FWD 100       128.4    P2pSW2是VLAN20的根网桥,因为SW1是VLAN10的备份根网桥,所以SW3的E0/0针对VLAN20肯定是阻塞状态。

检查SW3:SW3#show spanning-tree vlan 20VLAN0020  Spanning tree enabled protocol ieee  Root ID    Priority    24596             Address     aabb.cc00.2000             Cost        100             Port        4 (Ethernet0/3)             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)             Address     aabb.cc00.3000             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Et0/0               Altn BLK 100       128.1    P2pEt0/2               Desg FWD 100       128.3    P2pEt0/3               Root FWD 100       128.4    P2p针对VLAN20,SW3的E0/0是阻塞的,E0/3是转发的,这样PC2访问Server2的路径就是:PC2->SW3->S
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

厦门微思网络

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值