生成树STP配置 ------冗余的备份链路被自动激活
来源:互联网 发布:直播笑声软件下载 编辑:程序博客网 时间:2024/05/16 01:29
拓扑图如下:
配置交换机S1
Switch>en
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0002.1740.2CD7
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0002.1740.2CD7
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg LRN 19 128.1 P2p
Fa0/2 Desg LRN 19 128.2 P2p
Fa0/24 Desg LRN 19 128.24 P2p
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host S1
S1(config)#int fa0/24
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 20 !--- 没有事先创建VLAN 20,在使用的时候自动创建
% Access VLAN does not exist. Creating vlan 20
S1(config-if)#exit
S1(config)#int range fa0/1 - 2 !--- 一次性将两个端口指定为 Trunk 端口
S1(config-if-range)#switchport mode access
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
S1(config-if-range)#exit
S1(config)#spanning-tree mode rapid-pvst
S1(config)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 32769
Address 0002.1740.2CD7
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0002.1740.2CD7
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg LRN 19 128.1 P2p
Fa0/2 Desg LRN 19 128.2 P2p
VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 32788
Address 0002.1740.2CD7
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)
Address 0002.1740.2CD7
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/24 Desg FWD 19 128.24 P2p
S1#
配置交换机S2
Switch>en
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0002.1740.2CD7
Cost 19
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0002.4AB0.66E9
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/2 Altn BLK 19 128.2 P2p
Fa0/24 Desg FWD 19 128.24 P2p
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host S2
S2(config)#int fa0/24
S2(config-if)#switchport mode access
S2(config-if)#switchport access vlan 20 !--- 没有事先创建VLAN 20,在使用的时候自动创建
% Access VLAN does not exist. Creating vlan 20
S2(config-if)#exit
S2(config)#int range fa0/1 - 2 !--- 一次性将两个端口指定为 Trunk 端口
S2(config-if-range)#switchport mode access
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
S2(config-if-range)#exit
S2(config)#spanning-tree mode rapid-pvst
S2(config)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 32769
Address 0002.1740.2CD7
Cost 19
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0002.4AB0.66E9
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root LRN 19 128.1 P2p
Fa0/2 Altn BLK 19 128.2 P2p
VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 32788
Address 0002.1740.2CD7
Cost 19
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)
Address 0002.4AB0.66E9
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root LRN 19 128.1 P2p
Fa0/2 Altn BLK 19 128.2 P2p
Fa0/24 Desg FWD 19 128.24 P2p
S2#
测试快速生成树配置
PC>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::2E0:8FFF:FE77:2147
IP Address......................: 192.168.1.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1
PC>ping -t 192.168.1.3 !--- 不间断地ping客户端PC2这台计算机------目的是持续传输信息
Pinging 192.168.1.3 with 32 bytes of data:
Reply from 192.168.1.3: bytes=32 time=1ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=1ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=1ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128
回过头来关闭交换机S1正在通讯的端口fa0/1,人为地制造端口的“损坏”--------目的是让备份链路被自动激活,此时注意ping返回的结果。
S1#conf t
S1(config)#int fa0/1
S1(config-if)#shut !--- 关闭正在通讯的链路,注意交换机自动启动备份链路。
此时的效果拓扑图如下:
实验结果表明其中一条冗余链路被自动阻塞作为备份链路,只有当活动链路失败时,备份链路才会被激活,从而恢复设备之间的连接,保证网络的畅通。
- 生成树STP配置 ------冗余的备份链路被自动激活
- 交换机生成树协议STP的配置命令
- 生成树协议STP和快速生成树协议RSTP的配置及原理
- STP生成树的选举过程。
- STP生成树协议的理解
- stp生成树笔记
- stp生成树
- 生成树协议STP
- STP生成树协议
- STP生成树
- STP生成树协议
- STP生成树协议
- 生成树协议配置与管理STP——1
- 生成树协议配置与管理STP——2
- 生成树协议配置与管理STP——3
- 生成树协议配置与管理STP——4
- STP手动计算生成树以及STP\RSTP\MSTP的区别
- 运用STP VTP HSRP 构建冗余的网络
- 【转载】性能调优攻略
- &a[100]可以使用
- 线程实例的应用
- 数据结构与算法分析学习笔记三-循环队列C语言实现
- Dell笔记本电脑INSPIRON系列如何取消Caps Lock大小写切换时延迟
- 生成树STP配置 ------冗余的备份链路被自动激活
- 在VC++项目中使用.Net库,经过简单转换,可以直接使用C#代码
- 树状数组
- 软件工程之文档标准
- database quiesce and database suspend
- STC
- 6.判断整数序列是不是二元查找树的后序遍历结果
- Nutch-2.2.1学习之二编译部署Nutch及常见问题
- (work and tools)最简易的vim环境搭建