STP协议基础实验

1.STP定义

  • STP是一个用于局域网中消除环路的协议,它的标准是IEEE 802.1D。

2.作用

  • STP通过将部分冗余链路强制为阻塞状态,其他链路处于转发状态,将环形网络结构修剪成无环路的树形网络结构,可实现消除环路。当处于转发状态的链路不可用时,STP重新配置网络,并激活合适的备用链路状态,恢复恢复网络连通性。

3.实验基础搭建

  • 配置环网中的设备生成树协议工作在 STP 模式
  • 配置根桥和备份根桥设备
  • 配置端口的路径开销值,实现将该端口阻塞
  • 使能 STP,实现破除环路

4.STP协议配置

  • 配置环网中的设备生成树协议工作在 STP 模式
# SW1
[SW1]stp mode stp 

# SW2
[SW2]stp mode stp 

# SW3
[SW3]stp mode stp 

# SW4
[SW4]stp mode stp 
  • 将SW1配置为根桥,SW2配置为备份根桥
# SW1
[SW1]stp root primary

# SW2
[SW2]stp root secondary 
  • 配置端口的路径开销值,实现将该端口阻塞
# SW1
[SW1]stp pathcost-standard legacy 


# SW2
[SW2]stp pathcost-standard legacy

# SW3
[SW3]stp pathcost-standard legacy
[SW3]interface GigabitEthernet 0/0/3
[SW3-GigabitEthernet0/0/3]stp cost 20000

# SW4
[SW4]stp pathcost-standard legacy 
  • 使能 STP,实现破除环路
# SW3
[SW3]interface g0/0/24	
[SW3-GigabitEthernet0/0/24]stp edged-port enable 
[SW3-GigabitEthernet0/0/24]stp bpdu-filter enable 

# SW4
[SW4]interface g0/0/24	
[SW4-GigabitEthernet0/0/24]stp edged-port enable 
[SW4-GigabitEthernet0/0/24]stp bpdu-filter enable 
  • 全局使能 STP
# SW1
[SW1]stp enable 

# SW2
[SW2]stp enable 

# SW3
[SW3]stp enable 

# SW4
[SW4]stp enable 

5.实验验证

  • 在 Switch1 和 Switch2 上执行 display stp brief 命令
            查看端口状态和端口的保护类型

  • 在 Switch3上执行 display stp interface gigabitethernet 0/0/3 brief 命令
            查看端口 GigabitEthernet0/0/3 状态

  • 在 Switch4上执行 display stp brief 命令
            查看端口状态

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

阿巴阿巴啊啊啊

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

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

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

打赏作者

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

抵扣说明:

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

余额充值