STP(Spanning Tree Protocol)是生成树协议的英文缩写,可应用于计算机网络中树形拓扑结构建立,
主要作用是防止网桥网络中的冗余链路形成环路工作。但某些特定因素会导致STP失败,要排除故障可能
非常 困难,这取决于网络设计。生成树协议适合所有厂商的网络设备,在配置上和体现功能强度上有所差
别,但是 在原理和应用效果是一致的
?
基本配置:
接口不用配置,默认开启
LSW3: int eth0/0/1 #进入接口eth0/0/1中
port link-type access #可以不用配置vlan,但是access接口一定要开,不开不能通信
quit #退出接口配置模式
LSW4: int eth0/0/1 #进入接口eth0/0/1中
port link-type access #可以不用配置vlan,但是access接口一定要开,不开不能通信
quit #退出接口配置模式
PC1
配置
IP
地址

?PC2配置IP地址

?
?
LSW1:
stp enable #开启stp服务
stp mode stp #stp模式改为stp
stp priority 4096 #stp优先级为4096,也可以是stp root primary,数字和汉字都可
以,具体看题目上的优先级是数字还是汉字的
LSW2:
stp enable #开启stp服务
stp mode stp #stp模式改为stp
stp priority 8192 #stp优先级为8192,也可以是stp root secondary,数字和汉字都 可
以,具体看题目上的优先级是数字还是汉字的
LSW3: stp enable #开启stp服务
stp mode stp #stp模式改为stp
LSW4:
stp enable #开启stp服务
stp mode stp #stp模式改为stp
查看
STP
状态
在
LSW1
和
LSW2
上使用
display
查看
STP
状态时,系统输出的信息,从红色框框可以看出
STP
的模式为根网桥,
如果根网桥
4c1f-ccbd-49ae
与本地交换机的
MAC
地址一样,说明本地交换机就是这个
STP
域中的根网桥

?
?查看STP端口角色
使用命令
display stp brief
查看一下几台交换机上的
STP
端口角色,在
LSW1
上,我们可以看到三个端口都
是指定端口(
DESI
),状态都是转发(
FORWARDING
)。在
LSW2
上,我们则可以看到
Gthernet0/0/2
是
LSW2
的根端口(
ROOT
),状态也是转发(
FORWARDING
);
Ethernet0/0/1
和
Ethernet0/0/3
是指定端
口,状态都是转发(
FROWARDING
)。在
LSW3
和
LSW4
上,我们可以看到连接
LSW1
的端口为根端口(
ROOT
),
状态是转发(
FORWARDING
);而与
LSW2
相连的端口是预备端口(
ALTE
),状态是阻塞(
DISCARDING
)

?
?
?
|