Spanning-tree的portfast接口会发送bpdu吗

portfast接口只是加快收敛,仍会正常发出BPDU

以下交换机接口直连笔记本终端抓包查看

interface GigabitEthernet1/0/1
 switchport access vlan 100
 switchport mode access
 spanning-tree portfast edge
end

终端wireshark抓包可看到STP报文
在这里插入图片描述
如果交换机接口下启用了bpdufilter,则不收也不发。

interface GigabitEthernet1/0/1
 switchport access vlan 100
 switchport mode access
 spanning-tree portfast edge
 spanning-tree bpdufilter enable
end

终端收不到BPDU
在这里插入图片描述

********* Following is from cisco.com

Understanding How PortFast Works
PortFast causes a switch or trunk port to enter the spanning tree forwarding state immediately, bypassing the listening and learning states.

You can use PortFast on switch or trunk ports that are connected to a single workstation, switch, or server to allow those devices to connect to the network immediately, instead of waiting for the port to transition from the listening and learning states to the forwarding state.

Caution You can use PortFast to connect a single end station or a switch port to a switch port. If you enable PortFast on a port that is connected to another Layer 2 device, such as a switch, you might create network loops.
When the switch powers up, or when a device is connected to a port, the port enters the spanning tree listening state. When the Forward Delay timer expires, the port enters the learning state. When the Forward Delay timer expires a second time, the port is transitioned to the forwarding or blocking state.

When you enable PortFast on a switch or trunk port, the port is immediately transitioned to the spanning tree forwarding state.


https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst4000/8-2glx/configuration/guide/stp_enha.html#wp1046787

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
首先,需要确定一下网络拓扑,假设四台交换机的名称和接口分别如下: - sw1:e0/0/1 连接 sw2 的 e0/0/2 - sw2:e0/0/1 连接 sw3 的 e0/0/2,e0/0/2 连接 sw1 的 e0/0/1,e0/0/3 连接 sw4 的 e0/0/2 - sw3:e0/0/1 连接 sw4 的 e0/0/2,e0/0/2 连接 sw2 的 e0/0/1 - sw4:e0/0/1 连接 sw3 的 e0/0/1,e0/0/2 连接 sw2 的 e0/0/3 根据 STP(Spanning Tree Protocol)的工作原理,交换机通过互相发送 BPDU(Bridge Protocol Data Unit)来选举根桥和备份根桥。在本例中,我们可以手动配置 sw4 为根桥,sw3 为备份根桥。具体配置如下: sw4: ``` ! spanning-tree mode rapid-pvst spanning-tree vlan 1 root primary ! ``` sw3: ``` ! spanning-tree mode rapid-pvst spanning-tree vlan 1 root secondary ! ``` 这样,交换机之间就建立起 STP 的拓扑关系,sw4 成为根桥,sw3 成为备份根桥。接下来,我们需要将 sw2 的 e0/0/1 接口配置为阻塞接口,以避免出现环路。具体配置如下: sw2: ``` ! interface Ethernet0/0/1 spanning-tree bpdufilter enable spanning-tree bpduguard enable spanning-tree guard root spanning-tree portfast edge spanning-tree cost 100 ! ``` 其中,spanning-tree bpdufilter enable 和 spanning-tree bpduguard enable 分别启用 BPDU 过滤和 BPDU 守卫功能,可以避免非法的 BPDU 进入网络。spanning-tree guard root 配置该接口为根保护端口,可以防止其他交换机通过该接口成为根桥。spanning-tree portfast edge 表示该接口连接的是一个端设备,可以快速进入 forwarding 状态。spanning-tree cost 100 指定该接口的 STP 代价为 100,比默认值 19 大,可以使该接口成为阻塞接口
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值