扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
//实现:配置快速生成树(RSTP),做冗余备份,并将物理上的环路从逻辑上断开。
//环境:
Cisco 2960-01
Cisco 2960-02
PC01
PC02
//拓扑:如图(快速生成树配置-RSTP)
//查看交换机的生成树协议
Cisco 2960-01#show spanning-tree
//配置Cisco 2960-01
Cisco 2960-01>enenable
Cisco 2960-01#configure terminal
Cisco 2960-01(config)#vlan 2
Cisco 2960-01(config-vlan)#exit
Cisco 2960-01(config)#interface fastEthernet 0/1
Cisco 2960-01(config-if)#switchport access vlan 2
Cisco 2960-01(config-if)#exit
Cisco 2960-01(config)#interface fastEthernet 0/24
Cisco 2960-01(config-if)#switchport mode trunk //设置TRUNK
Cisco 2960-01(config-if)#exit
Cisco 2960-01(config)#interface fastEthernet 0/23
Cisco 2960-01(config-if)#switchport mode trunk //设置TRUNK
Cisco 2960-01(config-if)#exit
Cisco 2960-01(config)#spanning-tree mode rapid-pvst //修改生成树模式为RSTP
//保存配置
Cisco 2960-01#write
//配置Cisco 2960-02
Cisco 2960-02>enenable
Cisco 2960-02#configure terminal
Cisco 2960-02(config)#vlan 2
Cisco 2960-02(config-vlan)#exit
Cisco 2960-02(config)#interface fastEthernet 0/1
Cisco 2960-02(config-if)#switchport access vlan 2
Cisco 2960-02(config-if)#exit
Cisco 2960-02(config)#interface fastEthernet 0/24
Cisco 2960-02(config-if)#switchport mode trunk
Cisco 2960-02(config-if)#exit
Cisco 2960-02(config)#interface fastEthernet 0/23
Cisco 2960-02(config-if)#switchport mode trunk
Cisco 2960-02(config-if)#exit
Cisco 2960-02(config)#spanning-tree mode rapid-pvst //修改生成树模式为RSTP
//保存配置
Cisco 2960-02#write
//测试:(终端计算机)
VLAN2-PC01>ping 192.168.1.102
Pinging 192.168.1.102 with 32 bytes of data:
Reply from 192.168.1.102: bytes=32 time=26ms TTL=128
Reply from 192.168.1.102: bytes=32 time=14ms TTL=128
Ping statistics for 192.168.1.102:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 14ms, Maximum = 26ms, Average = 20ms
Control-C
//禁用正在通信的23号端口,模拟故障
Cisco 2960-01#configure terminal
Cisco 2960-01(config)#interface fastEthernet 0/23
Cisco 2960-01(config-if)#shutdown
VLAN2-PC01>ping 192.168.1.102
Pinging 192.168.1.102 with 32 bytes of data:
Reply from 192.168.1.102: bytes=32 time=11ms TTL=128
Ping statistics for 192.168.1.102:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 11ms, Maximum = 11ms, Average = 11ms
Control-C
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者