设为首页 收藏本站
查看: 1332|回复: 0

[经验分享] Packet Tracer 5.0实验(五) 快速生成树配置

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-3-31 09:15:23 | 显示全部楼层 |阅读模式
一、实验目标
  • 理解生成树协议工作原理;
  • 掌握快速生成树协议RSTP基本配置方法;

二、实验背景
学校为了开展计算机教学和网络办公,建立了一个计算机教室和一个校办公区,这两处的计算机网络通过两台交换机互相连接组成内部校园网,为了提高网络的可靠性,作为网络管理员,你要用2条链路将交换机互连,现要求在交换机上做适当的配置,使网络避免环路。

三、技术原理
生成树协议(spanning-tree),作用是在交换网络中提供冗余备份链路,并且解决交换网络中的环路问题;
生成树协议是利用SPA算法,在存在交换环路的网络中生成一个没有环路的树形网络。运用该算法将交换网络的冗余备份链路从逻辑上断开,当主链路出现故障时,能够自动的切换到备份链路,保证数据的正常转发;
生成树协议版本:STP、RSTP(快速生成树)、MSTP(多生成树协议);
生成树协议的特点是收敛时间长,从主要链路出现故障到切换至备份链路需要50秒的时间;
快速生成树协议在生成树协议的基础上增加了两种端口角色:替换端口和备份端口,分别做为根端口和指定端口的冗余端口。当根端口或指定端口出现故障时,冗余端口不需要经过50秒的收敛时间,可以直接切换到替换端口或备份端口,从而实现RSTP协议小于1秒的快速收敛。

四、实验步骤
实验拓扑
2012071423032433.jpg
默认情况下STP协议启用的,通过两台交换机之间传送BPDU协议数据单元,选出根交换机、根端口等,以便确定端口的转发状态。上图中标记为橙色的端口处于block堵塞状态。
设置RSTP
查看交换机 show spanning-tree 状态,了解根交换机和根端口情况;
通过更改交换机生成树的优先级spanning-tree vlan * priority 4096 可以变化根交换机的角色;
S1:


Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console

S1#show spanning-tree                                    //查看交换机spanning-tree 状态
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.5C36.5620
             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     0060.7078.8BDE
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/10           Desg FWD 19        128.10   P2p
Fa0/1            Root FWD 19        128.1    P2p
Fa0/2            Altn BLK 19        128.2    P2p

S1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S1(config)#interface fa0/10
S1(config-if)#switchport access vlan 10                            //将fa0/10划分到vlan 10
% Access VLAN does not exist. Creating vlan 10
S1(config-if)#exit
S1(config)#interface range fa0/1 - 2                               //设置fa0/1,fa0/2端口状态为trunk模式
S1(config-if-range)#switchport mode trunk

%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 ?                                    //设置spanning-tree 为RSTP模式
  pvst        Per-Vlan spanning tree mode
  rapid-pvst  Per-Vlan rapid spanning tree mode
S1(config)#spanning-tree mode rapid-pvst
S1(config)#



S2:


Switch>en
Switch#show spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.5C36.5620
             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     0060.5C36.5620
             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/10           Desg FWD 19        128.10   P2p

Switch#
%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

Switch#
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#interface fa0/10
S2(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
S2(config-if)#exit
S2(config)#interface range fa0/1 - 2
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#exit
S2(config)#spanning-tree mode rapid-pvst
S2(config)#





五、测试

当主链路处于down状态时,能够自动的切换到备份链路,保证数据的正常转发。

在S2上shutdown 掉 fa0/1


Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int
Switch(config)#interface fa0/1
Switch(config-if)#shu
Switch(config-if)#shutdown                                         //shutdown fa0/1端口

Switch(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down


Switch#show spanning-tree
VLAN0001
  Spanning tree enabled protocol rstp
  Root ID    Priority    32769
             Address     0001.63E2.4A7A
             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     0001.63E2.4A7A
             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

VLAN0010

  Spanning tree enabled protocol rstp
  Root ID    Priority    32778
             Address     0001.63E2.4A7A
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
             Address     0001.63E2.4A7A
             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/10           Desg FWD 19        128.10   P2p

Switch#



PC1:


PC>ipconfig

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

Pinging 192.168.1.3 with 32 bytes of data:

Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
Reply from 192.168.1.3: bytes=32 time=93ms TTL=128
Reply from 192.168.1.3: bytes=32 time=93ms TTL=128
Reply from 192.168.1.3: bytes=32 time=62ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
Reply from 192.168.1.3: bytes=32 time=79ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
......




测试效果:

2012071500042911.jpg


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-197948-1-1.html 上篇帖子: Packet Tracer 5.0实验(四) 利用三层交换机实现VLAN间路由 下篇帖子: Packet Tracer 5.0实验(六) 路由器基本配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表