Cumulus Linux 与 Cisco IOS - 生成树协议

问题

用户已了解 Cisco IOS 格式,并希望将其转换为 mstpd(Linux 的生成树协议守护程序)。

有关更多信息,请参阅 STP 参数列表

您可以在此处找到用于解释其命令的 Cisco 配置指南。

生成树转换表

Cumulus LinuxCisco Systems IOS描述
net add bridge stp maxage 20
在网桥下配置
spanning-tree vlan vlan-id max-age 20
全局配置命令
将网桥/VLAN最大老化时间设置为 <max_age> 秒。两种操作系统的默认值均为 20。
net add bridge stp fdelay 15
在网桥下配置
spanning-tree vlan vlan-id forward-time seconds
全局配置命令
将网桥/VLAN转发延迟设置为 <time> 秒。两种操作系统的默认值均为 15。
net add bridge stp maxhops 20
在网桥下配置
spanning-tree vlan vlan-id root primary [ diameter net-diameter [ hello-time seconds ]]
全局配置命令
将网桥最大跳数设置为 <max_hops>。Cumulus Linux 上的默认值为 20。在 Cisco 上,范围为 2 到 7,默认值为 7。
net add bridge stp txholdcount 6
在网桥下配置
spanning-tree transmit hold-count value

全局配置命令

将网桥/VLAN传输保持计数设置为 <tx_hold_count>。两种操作系统的默认值均为 6。Cisco 将其描述为“在暂停 1 秒之前可以发送的 BPDU 数量”。
net add bridge stp forcevers rstp
在网桥下配置
spanning-tree mode{ pvst | mst | rapid-pvst }
全局配置命令
将网桥/VLAN 设置为特定的生成树模式(MST、RSTP 等)
net add bridge stp treeprio 32768
在网桥下配置
spanning-tree vlan vlan-id priority priority
全局配置命令
配置交换机的网桥/VLAN 优先级。两种操作系统的默认值均为 32768。范围是 0 到 65535 之间的数字
net add bridge stp hello 2
在网桥下配置
spanning-tree vlan vlan-id hello-time seconds
全局配置命令
将网桥/VLAN Hello 时间设置为 <time> 秒。两种操作系统的默认值均为 2。
net add interface swp10 stp portpathcost 10
在接口节下配置
spanning-tree vlan vlan-id cost cost

-接口配置命令

配置网桥/VLAN 的成本。范围为 1 到 200000000。Cisco 从接口的介质速度派生出成本。在 Cumulus Linux 上,默认值为 0。
net add interface swp1 stp portadminedge yes

在接口下配置

spanning-tree portfast default

全局配置命令

spanning-tree portfast

-接口配置命令

立即将配置为访问端口或 trunk 端口的接口从阻塞状态转换为转发状态,绕过侦听和学习状态。
net add interface swp2 stp portautoedge yes
在接口下配置
No Comparable Command
端口上 BPDU 的接收确定端口是否为边缘端口。当端口未接收到 BPDU 时,它将成为边缘端口。
net add interface swp3 stp portp2p yes

在接口下配置

spanning-tree link-type { point-to-point | shared }

-接口配置命令

启用/禁用网桥 <bridge> 中端口 <port> 的点对点检测模式。Cumulus Linux 上的默认值为自动。Cisco 通过双工设置确定链路类型(全双工为 p2p,半双工为共享)。
net add interface swp4 stp portrestrrole yes
在接口下配置
spanning-tree guard root

-接口配置命令

启用/禁用网桥 <bridge> 中端口 <port> 担任根角色的能力。默认值为否。
net add interface swp5 stp bpduguard yes
在接口下配置
spanning-tree portfast bpduguard default
全局配置命令,但仅影响配置了的端口
spanning-tree portfast
启用/禁用 BPDU 保护配置
net add interface swp6 stp portbpdufilter yes
在接口下配置
spanning-tree portfast bpdufilter default
全局配置命令,但仅影响配置了的端口
spanning-tree portfast
在交换机端口上启用 bpdufilter,这会在两个方向上过滤 BPDU。
net add interface swp7 stp portrestrtcn yes
在接口下配置
没有等效项启用/禁用网桥 <bridge> 中端口 <port> 传播接收到的拓扑更改通知的能力。默认值为否。
net add interface swp8 stp portnetwork yes
在接口下配置
spanning-tree bridge assurance
全局配置命令
启用/禁用网桥保证功能
net add interface swp9 stp treeportprio 128
在接口下配置
spanning-tree port-priority priority
在接口下配置
配置接口的端口优先级。两种操作系统的默认值均为 128。

完整配置示例

cumulus@switch:~$ cat /etc/network/interfaces

auto bridge
iface bridge
    bridge-ports glob swp1-10
    bridge-vlan-aware yes
    bridge-vids 1-2000
    bridge-pvid 1
    bridge-stp on
    mstpctl-maxhops 20
    mstpctl-maxage 20

auto swp1
iface swp1
    mstpctl-portadminedge yes

auto swp2
iface swp2
    mstpctl-portautoedge yes

auto swp3
iface swp3
    mstpctl-portp2p yes

auto swp4
iface swp4
    mstpctl-portrestrrole yes

auto swp5
iface swp5
    mstpctl-bpduguard yes

auto swp6
iface swp6
    mstpctl-portbpdufilter yes

auto swp7
iface swp7
    mstpctl-portrestrtcn yes

auto swp8
iface swp8
    mstpctl-portnetwork yes

auto swp9
iface swp9
    mstpctl-treeportprio 128

auto swp10
iface swp10
    mstpctl-portpathcost 10