08
2022
07
12:01:22

思科服务器查看生成树协议,思科基于端口的生成树协议命令



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

思科基于端口的生成树协议命令

【命令格式】set port [portlist|all] spanning-tree enable

【使用指南】该命令用于使能基于端口的生成树协议。参数为交换机物理端口列表,输入的形式可以是“1-2”或者“1,2,4-6”,如果要设置全部的物理 端口可以使用“all”参数项。

【举例】

switch#set port 1-10 spanning-tree enable

successfully enable ports' stp protocol.

禁止基于端口的生成树协议命令

【命令格式】set port [portlist|all] spanning-tree disable

【使用指南】该命令用于禁止基于端口的生成树协议。参数为交换机物理端口列表,输入的形式可以是“1-2”或者“1,2,4-6”,如果要设置全部的物理 端口可以使用“all”参数项。

【举例】

switch#set port 1-10 spanning-tree disable

successfully forbidden ports' stp protocol.

switch#

设定端口路径花销命令

用户执行该命令设置该端口stp 的端口路径开销。

【命令格式】1. set port [portlist|all] spanning-tree cost [1-65535]

2. no set port [portlist|all] spanning-tree cost

【使用指南】命令1 设置端口stp 的端口路径开销,命令2 恢复它的缺省值。默认情况下,每个1000mbps 网段有一个指定的路径开销值为4, 100mbps 网段的路径开销为19, 10mbps网段的路径开销值为100。

【参数说明】[portlist|all]为交换机物理端口列表,输入的形式可以是“1-2”或者“1,2,4-6”,如果要设置全部的物理端口可以使用 “all”参数项。[1-65535]表示端口路径开销的数值。

【举例】

switch#set port 1-10 spanning-tree cost 100

successfully set ports' stp cost.

switch#

可以用show spanning-tree interface 命令显示设置的结果。

可以用下面的命令取消设置的结果。

switch#no set port 1-10 spanning-tree cost

successfullly set port path cost to default.

switch#

下面是取消后显示的结果:

switch#show spanning-tree ethernet

设定端口stp 优先级命令

用户执行该命令设置指定端口的stp 优先级。

【命令格式】1. set port [portlist|all] spanning-tree port-priority [0-255]

2. no set port [portlist|all] spanning-tree port-priority

【使用指南】命令2 恢复它的缺省值。端口优先权可设置为从0 到255 中的一个数值。较小的数值表示端口有较大的可能性被选作为根端口。

【参数说明】[portlist|all]为交换机物理端口列表,输入的形式可以是“1-2”或者“1,2,4-6”,如果要设置全部的物理端口可以使用 “all”参数项。[0-255]表示端口生成树优先级数值大小。

【举例】

switch#set port 1-3 spanning-tree port-priority 10

successfully set ports' stp priority.

switch#

可以使用show spanning-tree interface 命令显示设置的结果。

switch#show spanning-tree ethernet

对于上面的设置结果,可以用no 命令取消。

switch#no set port 1-3 spanning-tree port-priority

successfully set port priority to default.

switch#

可以看到进行取消操作后的结果:

switch#show spanning-tree etherne

基本stp 设置命令

对于stp 的基本设置包括:

1 使能或者关闭stp

2 配置指定的stp 参数

使能stp

【命令格式】spanning-tree enable

【使用指南】该命令用于使能stp,无参数。

【举例】

switch(config)#spanning-tree enable

successfully enable spanning tree protocol.

switch(config)#

禁止stp

【命令格式】spanning-tree disable

【使用指南】从系统全局禁止stp 协议运行,无参数。

【举例】

switch(config)#spanning-tree disable

successfully disable spanning tree protocol.

switch(config)#

设置forward-time 命令

用户执行该命令用于设置stp 的转发时间。

【命令格式】1. spanning-tree forward-time []

2. no spanning-tree forward-time

【使用指南】该命令1 能设置成4 到30 秒中的一个值。在从阻塞状态转换到转发状态时,这是任何交换机端口在侦听情况下所花费的时间。命令2 恢复forward time 的缺省值,缺省值为15s。

【参数说明】[400-3000]为转发延迟大小,单位为1/100 秒。

【举例】

switch(config)#spanning-tree forward-time 2400

successfully set forward delay time.

switch(config)#

switch(config)# no spanning-tree forward-time

successfully set forward delay time to default.

switch(config)#

设置hello-time 命令

设置当本交换机被选为根桥时发送bpdu 的时间间隔。

【命令格式】1. spanning-tree hello-time [100-1000]

2. no spanning-tree hello-time

【使用指南】hello time 能被设置为从1 到10 秒中的一个值。这是根网桥发送两个通知其它交换机它是根网桥的bpdu 包的发送时间间隔。命令2 恢复hello time 的缺省值,缺省值为is。

【参数说明】[100-1000]为呼叫时间大小,单位为1/100 秒。

【举例】

switch(config)#spanning-tree hello-time 500

successfully set hello time.

switch(config)#

switch(config)#no spanning-tree hello-time

successfully set hello time to default.

switch(config)#

设置报max-age 命令

设置bpdu 报文老化的最长时间间隔,收到超过这个时间的bpdu 报文,就直接丢弃。

【命令格式】1. spanning-tree max-age [600-4000]

2. no spanning-tree max-age

【使用指南】max. age 能被设置为从6 到40 秒中的一个值。在max. age 结束时,如果仍没有从根网桥接收到一个bpdu,你的交换机将开始发送它自己的bpdu 给其它所有交换机来确定成为根网桥。命令2 恢复max age 的缺省值,缺省值为20s。

设置stp max age。

【举例】

switch(config)#spanning-tree max-age 3000

successfully set max age.

switch(config)#

switch(config)#no spanning-tree max-age

sucessfully set max age to default.

switch(config)#

设置priority 命令

用户执行该命令用于设置本交换机的优先级。

【命令格式】1. spanning-tree priority [0-65535]

2. no spanning-tree priority

【使用指南】命令1 为交换机设定的priority,能设置成0 到65535 中的一个数值。命令2恢复stp priority 的缺省值,缺省值为32768。

【参数说明】优先级数值。

【举例】

switch(config)#spanning-tree priority 4000

successfully set priority.

switch(config)#

switch(config)# no spanning-tree priority

successfully set priority to default.

switch(config)#

可以使用show spanning-tree protocol 命令显示设置的结果。


本文链接:https://hqyman.cn/post/2438.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: