RSTP、MSTP生成树协议 边缘端口、BPDU保护配置

 

RSTP实验:

实验步骤:

1、交换机配置vlan及接口类型,让PC1可以ping通pc2

2、修改交换机优先级

[SW1]stp priority 4096

3、修改交换机生成树模式为RSTP[SW1]stp mode rstp

4、配置e/0/0/3接口为边缘接口,观察收敛速度

[SW1-Ethernet0/0/3]stp edged-port enable 

5、配置 BPDU保护

[SW1]stp bpdu-protection

只要边缘端口收到配置bpdu,立刻被关闭

eNSP拓扑图


PC配置静态IP


配置交换机

SW1

[Huawei]sysname SW1
[SW1]v b 10
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/3
[SW1-Ethernet0/0/3]p l a
[SW1-Ethernet0/0/3]p d v 10
[SW1-Ethernet0/0/3]q
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]p l t
[SW1-Ethernet0/0/1]p t a v all
[SW1-Ethernet0/0/1]q
[SW1]int e0/0/2
[SW1-Ethernet0/0/2]p l t 
[SW1-Ethernet0/0/2]p t a v all
[SW1-Ethernet0/0/2]q
[SW1]stp priority 4096
[SW1]stp mode rstp 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/3
[SW1-Ethernet0/0/3]stp edged-port enable
[SW1-Ethernet0/0/3]q
[SW1]

SW2

[Huawei]sysname SW2
[SW2]v b 10
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]int e0/0/3
[SW2-Ethernet0/0/3]p l a
[SW2-Ethernet0/0/3]p d v 10
[SW2-Ethernet0/0/3]q
[SW2]int e0/0/1
[SW2-Ethernet0/0/1]p l t
[SW2-Ethernet0/0/1]p t a v all
[SW2-Ethernet0/0/1]q
[SW2]int e0/0/2
[SW2-Ethernet0/0/2]p l t
[SW2-Ethernet0/0/2]p t a v all
[SW2-Ethernet0/0/2]q
[SW2]stp priority 8192
[SW2]stp mode rstp
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]
[SW2]int e0/0/3
[SW2-Ethernet0/0/3]stp edged-port enable
[SW2-Ethernet0/0/3]q

SW3

[Huawei]sysname SW3
[SW3]stp mode rstp
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]v b 10
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]int e0/0/2
[SW3-Ethernet0/0/2]p l t
[SW3-Ethernet0/0/2]p t a v all
[SW3-Ethernet0/0/2]q
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l t
[SW3-Ethernet0/0/1]p t a v all
[SW3-Ethernet0/0/1]q

验证配置

PC1 ping PC2

PC>ping 192.168.10.2 -t

Ping 192.168.10.2: 32 data bytes, Press Ctrl_C to break
From 192.168.10.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.10.2: bytes=32 seq=2 ttl=128 time=94 ms
From 192.168.10.2: bytes=32 seq=3 ttl=128 time=109 ms

在ping的同时阻塞SW1交换机的E0/0/3口

[SW1]int e0/0/1
[SW1-Ethernet0/0/1]shutdown 

就会出现几个包ping不通(如下)

PC>ping 192.168.10.2 -t

Ping 192.168.10.2: 32 data bytes, Press Ctrl_C to break
From 192.168.10.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.10.2: bytes=32 seq=2 ttl=128 time=94 ms
From 192.168.10.2: bytes=32 seq=3 ttl=128 time=109 ms
Request timeout!
From 192.168.10.2: bytes=32 seq=5 ttl=128 time=63 ms
From 192.168.10.2: bytes=32 seq=6 ttl=128 time=94 ms
From 192.168.10.2: bytes=32 seq=7 ttl=128 time=109 ms
From 192.168.10.2: bytes=32 seq=8 ttl=128 time=93 ms

SW1恢复开启端口

[SW1-Ethernet0/0/1]undo shut

PC1停止ping:Ctrl+C



BPDU保护

加一台SW4交换机,先不要开机


SW1

[SW1]int e0/0/22
[SW1-Ethernet0/0/22]stp edged-port enable
[SW1-Ethernet0/0/22]q
[SW1]stp bpdu-protection

再启动SW4,就会发现SW1与SW4的连接线短暂的开启,然后被系统堵塞了shutdown



MSTP配置

eNSP拓扑图


交换机配置

SW1

[Huawei]sys SW1
[SW1]v b 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]port-group 1
[SW1-port-group-1]group-member g0/0/1 to g0/0/3
[SW1-port-group-1]p l t 
[SW1-GigabitEthernet0/0/1]p l t 
[SW1-GigabitEthernet0/0/2]p l t 
[SW1-GigabitEthernet0/0/3]p l t 
[SW1-port-group-1]p t a v 10 20
[SW1-GigabitEthernet0/0/1]p t a v 10 20
[SW1-GigabitEthernet0/0/2]p t a v 10 20
[SW1-GigabitEthernet0/0/3]p t a v 10 20
[SW1-port-group-1]q

SW2

[Huawei]sys SW2
[SW2] v b 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]port-group 1
[SW2-port-group-1]group-member g0/0/1 to g0/0/3
[SW2-port-group-1]p lt 
Error: Unknown host lt.
[SW2-port-group-1]p l t 
[SW2-GigabitEthernet0/0/1]p l t 
[SW2-GigabitEthernet0/0/2]p l t 
[SW2-GigabitEthernet0/0/3]p l t 
[SW2-port-group-1]p t a v 10 20
[SW2-GigabitEthernet0/0/1]p t a v 10 20
[SW2-GigabitEthernet0/0/2]p t a v 10 20
[SW2-GigabitEthernet0/0/3]p t a v 10 20
[SW2-port-group-1]q
[SW2]

SW3

[Huawei]sysname SW3
[SW3]v b 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]port-group 1
[SW3-port-group-1]group-member g0/0/1 to g0/0/3
[SW3-port-group-1]p l t
[SW3-GigabitEthernet0/0/1]p l t
[SW3-GigabitEthernet0/0/2]p l t
[SW3-GigabitEthernet0/0/3]p l t
[SW3-port-group-1]p t a v 10 20
[SW3-GigabitEthernet0/0/1]p t a v 10 20
[SW3-GigabitEthernet0/0/2]p t a v 10 20
[SW3-GigabitEthernet0/0/3]p t a v 10 20
[SW3-port-group-1]q
[SW3]

SW4

[SW4]v b 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4]port-group 1
[SW4-port-group-1]group-member g0/0/1 to g0/0/3
[SW4-port-group-1]p l t
[SW4-GigabitEthernet0/0/1]p l t
[SW4-GigabitEthernet0/0/2]p l t
[SW4-GigabitEthernet0/0/3]p l t
[SW4-port-group-1]p t a v 10 20
[SW4-GigabitEthernet0/0/1]p t a v 10 20
[SW4-GigabitEthernet0/0/2]p t a v 10 20
[SW4-GigabitEthernet0/0/3]p t a v 10 20
[SW4-port-group-1]q
[SW4]

SW1

[SW1]stp mode mstp
[SW1]stp region-configuration
[SW1-mst-region]region-name Region1
[SW1-mst-region]instance 10 vlan 10
[SW1-mst-region]instance 20 vlan 20
[SW1-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1-mst-region]q
[SW1]stp instance 10 priority 0
[SW1]stp instance 20 priority 4096

SW2

[SW2]stp mode mstp
[SW2]stp region-configuration
[SW2-mst-region]region-name Region1
[SW2-mst-region]instance 10 vlan 10
[SW2-mst-region]instance 20 vlan 20
[SW2-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2-mst-region]q
[SW2]stp instance 10 priority 4096
[SW2]stp instance 20 priority 0

SW3

[SW3]stp mode mstp
[SW3]stp region-configuration
[SW3-mst-region]region-name Region1
[SW3-mst-region]instance 10 vlan 10
[SW3-mst-region]instance 20 vlan 20
[SW3-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3-mst-region]

SW4

[SW4]stp mode mstp
[SW4]stp region-configuration
[SW4-mst-region]region-name Region1
[SW4-mst-region]instance 10 vlan 10
[SW4-mst-region]instance 20 vlan 20
[SW4-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4-mst-region]

验证配置

SW3

ROOT根端口 ALTE替代端口

[SW3-mst-region]dis stp b
 MSTID  Port                        Role  STP State     Protection
   0    GigabitEthernet0/0/1        DESI  FORWARDING      NONE
   0    GigabitEthernet0/0/3        DESI  FORWARDING      NONE
  10    GigabitEthernet0/0/1        ROOT  FORWARDING      NONE    //根端口(指定)
  10    GigabitEthernet0/0/3        ALTE  DISCARDING      NONE     //阻塞端口(替代)
  20    GigabitEthernet0/0/1        ALTE  DISCARDING      NONE
  20    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
  • 13
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值