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

[经验分享] CISCO PVST+

[复制链接]

尚未签到

发表于 2018-7-13 10:37:05 | 显示全部楼层 |阅读模式
DSC0000.jpg


  PVST+(每个VLAN 的生成树PVST +)
  实验拓扑:

  分别在 SW1 和SW2 上show spanning-tree 查看结果:
  SW1#show spanning-tree
  VLAN0001
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  This bridge is the root
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 0008.20ff.6400
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 15
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Desg FWD 19 128.23 P2p
  Fa0/24 Desg FWD 19 128.24 P2p
  SW2#show spanning-tree
  VLAN0001
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 19
  Port 23 (FastEthernet0/23)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Root FWD 19 128.23 P2p

  Fa0/24>  注:以上拓扑中经过选举最终SW1 为根网桥,SW2 的F0/24 为blocking 端口,也是就线路2 成为了备
  份链路。
  分别在 SW1 和SW2 上创建VLAN2,VLAN3,VLAN4,按如下拓扑要求完成本实验:
  在 SW1 上创建VLAN2,VLAN3,VLAN4 并查看:
  SW1(config)#vlan 2-4
  SW1#show vlan
  VLAN Name Status Ports
  —- ——————————– ——— ——————————-
  1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
  Fa0/5, Fa0/6, Fa0/7, Fa0/8
  Fa0/9, Fa0/10, Fa0/11, Fa0/12
  Fa0/13, Fa0/14, Fa0/15, Fa0/16
  Fa0/17, Fa0/18, Fa0/19, Fa0/20
  Fa0/21, Fa0/22
  2 VLAN0002 active
  3 VLAN0003 active
  4 VLAN0004 active
  在 SW2 上创建VLAN2,VLAN3,VLAN4 并查看:
  SW2(config)#vlan 2-4
  SW2#show vlan
  VLAN Name Status Ports
  —- ——————————– ——— ——————————-
  1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
  Fa0/5, Fa0/6, Fa0/7, Fa0/8
  Fa0/9, Fa0/10, Fa0/11, Fa0/12
  Fa0/13, Fa0/14, Fa0/15, Fa0/16
  Fa0/17, Fa0/18, Fa0/19, Fa0/20
  Fa0/21, Fa0/22
  2 VLAN0002 active
  3 VLAN0003 active
  4 VLAN0004 active
  按如下拓扑要求完成本实验:
  要求:SW2 的VLAN1 和VLAN2 流量通过线路1 到达SW1 , SW2 的VLAN3 和VLAN4 的流量经过线路2 到达SW1,当其中一条链路有问题走另一链路.

  分别在 SW1 SW2 上创建了VLAN2-4 后查看目前的生成树状态.
  在SW1 上查看:
  命令:show spanning-tree vlan 1
  show spanning-tree vlan 2
  show spanning-tree vlan 3
  show spanning-tree vlan 4
  SW1#show spanning-tree vlan 1
  VLAN0001
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  This bridge is the root
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 0008.20ff.6400
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Desg FWD 19 128.23 P2p
  Fa0/24 Desg FWD 19 128.24 P2p
  SW1#show spanning-tree vlan 2
  VLAN0002
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  This bridge is the root
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 0008.20ff.6400
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Desg FWD 19 128.23 P2p
  Fa0/24 Desg FWD 19 128.24 P2p
  SW1#show spanning-tree vlan 3
  VLAN0003
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  This bridge is the root
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 0008.20ff.6400
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Desg FWD 19 128.23 P2p
  Fa0/24 Desg FWD 19 128.24 P2p
  SW1#show spanning-tree vlan 4
  VLAN0004
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  This bridge is the root
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 0008.20ff.6400
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Desg FWD 19 128.23 P2p
  Fa0/24 Desg FWD 19 128.24 P2p
  结果:查看生成树状态后发现针对VLAN1,VLAN2,VLAN3,VLAN3,SW1 都是扮演根网桥角
  色.SW1 连接SW2 的两个端口F0/23,F0/24 都是指定端口.
  在SW2 上查看:
  命令:show spanning-tree vlan 1
  show spanning-tree vlan 2
  show spanning-tree vlan 3
  show spanning-tree vlan 4
  SW2#show spanning-tree vlan 1
  VLAN0001
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 19
  Port 23 (FastEthernet0/23)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Root FWD 19 128.23 P2p

  Fa0/24>  SW2#show spanning-tree vlan 2
  VLAN0002
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 19
  Port 23 (FastEthernet0/23)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Root FWD 19 128.23 P2p

  Fa0/24>  SW2#show spanning-tree vlan 3
  VLAN0003
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 19
  Port 23 (FastEthernet0/23)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Root FWD 19 128.23 P2p

  Fa0/24>  SW2#show spanning-tree vlan 4
  VLAN0004
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 19
  Port 23 (FastEthernet0/23)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–
  Fa0/23 Root FWD 19 128.23 P2p

  Fa0/24>  结果:查看生成树状态后发现针对VLAN1,VLAN2,VLAN3,VLAN3,SW2 都是扮演非根网桥角色,
  SW2 的端口F0/24 都处在blocking 状态.
  问题所在:通过在SW1 和SW2 查看得到的结果我们来分析一下,现在SW1 的VLAN1 和VLAN2
  是通过线路1 到达SW1 的,这符合本实验的要求,但VLAN3,VLAN4 到SW1 走线路1 不符合本实验的要
  求,VLAN3,VLAN4 到SW1 要求走线路2.
  分析:SW2 的VLAN3,VLAN4 到SW1 为什么走线路1 呢?因为SW2 相对于VLAN3,VLAN4 来说到
  达SW1 F0/24 都是blocking 状态,F0/23 为转发状态,导致VLNA3,VLAN3 通过F0/23 走线路1 到达SW1.
  解决方法:在SW2 上VLAN2,VLAN3 要到达SW1 只要SW2 的F0/23 为blocking 状态,F0/24 为转发
  状态,就达到本实验的要求(SW2 的VLAN3,VLAN4 到SW1 走线路2)
  之所以SW2 的F0/24 为blocking 状态,是因为相对于VLAN3,VLAN4 来说在通过生成树决策的第4

  步时,F0/23 端口号小于F0/23,小的优先,Lowest sender port>  时会用到这一项,<本实验就是这样>。通过以上分析,在SW2 上相对于VLAN3,VLAN4 来说,我们可以
  更改参数,也就是在生成树决策的第2 步就可以做出决策,即使用Lowest path cost to root bridge
  (到达根的最小路径开销)。
  在SW2 上相对于VLAN3,VLAN4 更F0/24 到根(SW1)的花费,目前为19,F0/23 到根也为19,我们更
  改F0/24 端口到达SW1 的花费为18 就可以满足本实验的要求.
  在SW2 上配置以下命令:
  SW2(config)#interface fastEthernet 0/24
  SW2(config-if)#spanning-tree vlan 3-4 cost 18
  查看更改的配置:
  SW2#show run int f0/24
  interface FastEthernet0/24
  spanning-tree vlan 3-4 cost 18
  end
  做上以上配置后在SW2 上查看当前的VLAN3,VLAN4 的生成树状态:
  SW2#show spanning-tree vlan 3
  VLAN0003
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 18
  Port 24 (FastEthernet0/24)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–

  Fa0/23>  Fa0/24 Root FWD 18 128.24 P2p
  SW2#show spanning-tree vlan 4
  VLAN0004
  Spanning tree enabled protocol ieee

  Root>  Address 0008.20ff.6400
  Cost 18
  Port 24 (FastEthernet0/24)
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge>  Address 000d.bce7.5940
  Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  Aging Time 300
  Interface Role Sts Cost Prio.Nbr Type
  —————- —- — ——— ——– ——————————–

  Fa0/23>  Fa0/24 Root FWD 18 128.24 P2p
  通过命令show spanning-tree vlan 3 , show spanning-tree vlan 4 查看,我们发现F0/23 为blocking 状
  态,SW2 的VLAN3,VLAN4 到达SW1 的通过F0/24 到达,也就是走线路2,实现在本实验的要求。最终线路1,线路2 流量走势图:
  VLAN1 VLAN2 数据走线路1  VLAN3 VLAN4走线路2

运维网声明 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-536730-1-1.html 上篇帖子: cisco ios命令 下篇帖子: CISCO ACL问题请教
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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