华为生成树协议STP分析过程与配置方法docWord格式文档下载.docx
《华为生成树协议STP分析过程与配置方法docWord格式文档下载.docx》由会员分享,可在线阅读,更多相关《华为生成树协议STP分析过程与配置方法docWord格式文档下载.docx(24页珍藏版)》请在冰豆网上搜索。
2.disstpbrief
3、指定stp主根和备根
1.stprootprimary
2.stprootsecondary
4、手工指定根桥优先级
1.stppriority4096(4096的倍数)
2
5、指定RP
1.intg0/0/10
2.stpportpriority16(16的倍数)
6、指定DP
1.intg0/0/24
2.stpcost2000000
7、开启rstp
1.stpenable
3
2.stpmoderstp
8、配置mstp
2.stpmodemstp
3.stpregion-configuration
4.region-nameRG1
5.
instance
vlan
to
10
6.
11
20
7.
active
region-configuration
9、查看mstp实例配置
1.displaystpregion-configuration
4
10、配置mstp的多实例优先级
1.
stp
priority
4096
2.
8192
11、配置指定端口保护
1.配置在根桥的DP口上
2.intg0/0/1
3.stproot-protection
12、配置边缘端口保护
1.配置在接入服务器的端口
2.intg0/0/10
5
3.stpedged-portenable
13、配置环路保护
1.配置在非根桥交换机的上联口
2.intg0/0/13
3.stploop-protection
三、实验过程
1、实验拓扑
6
2、STP配置及验证
1.SW1-SW4:
2.stpenable
7
3.stpmodestp
查看stp状态:
1.SW1-SW4
2.disstp
3.disstpbrief
8
9
由图中我可以看出整个stp情况,如下图:
12
3、将SW1配置成主根网桥,将SW2配置成备份根网桥
13
1.SW1:
[SW1]stproot
primary
3.
4.SW2:
5.[SW2]stprootsecondary
在看下SW1和SW2的stp状态,可以看到设置成主根的priority为0,备根的priority为4096。
14
15
此时4台设备的生成树如下图:
16
4、手工指定优先级,使得SW2为主根,SW1为备根
17
2.[SW1]undostproot
[SW1]stppriority
4.
5.SW2:
6.[SW2]undostproot
7.[SW2]stppriority4096
再看下SW1和SW2的STP状态。
18
5、根端口选举控制
由于上一步把SW2设置成了根桥,所以SW1和SW2互联的两个口一定有一个属于ALTE状态,如下图:
19
可以发现9口是根端口,端口优先级默认是128,数值越小优先级越高,如果我们希望10端口变为根端口,怎么做
1.SW2:
2.[SW2]intg0/0/10
3.[SW2-GigabitEthernet0/0/10]stpportpriority16
此时再看SW1上的stp端口状态,10端口已经变成了RP。
6、指定端口选举控制
先看一下SW3的intg0/0/1以及SW4的intg0/0/24的端口stp状态
1.[SW3]disstpintg0/0/1
21
1.[SW4]disstpintg0/0/24
22
现在需求把SW3的G0/0/1变成指定端口:
1.SW4:
23
2.[SW4]intg0/0/24
3.[SW4-GigabitEthernet0/0/24]stpcost2000000
再看SW3的intg0/0/1以及SW4的intg0/0/24的端口stp状态,SW3的intg0/0/1变成了指定端口
24
25
7、STP的收敛速度
先在SW1和SW2上分别配置一个SVI口
26
1.SW1:
2.[SW1]intvlan1
3.[SW1-Vlanif1]ipadd
4.SW2:
5.[SW2]intvlan1
6.[SW2-Vlanif1]ipadd
看一下SW1的stp状态,9口block,10口root,此时在SW1上长pingSW2,并中断SW2的10口
我记了一下时间,大概中断了30秒钟,可见stp的收敛时间非常的慢,在对中断时间有极其严格要求的生产环节中不太适合。
27
28
8、RSTP配置
9、验证rstp的收敛时间
依然在SW1上长pingSW2,并中断SW2的10口,仅仅丢了一个包,中断在1-2秒钟左右。
29
30
10、STP和RSTP兼容
将SW1模式更改为stp:
2.[SW1]stpmodestp
看一下此时SW1的stp状态,和RSTP时一致;
再次关闭SW2的10口,验证此时的收敛情况,发现依然中断了
30秒
31
32
所以RSTP兼容STP,但是收敛方式以STP模式运行。
11、MSTP配置和验证
通过mstp可以实现多vlan下的负载,先创建vlan2到20,并配置trunk。
[SW1]vlan
batch2to20
[SW1]int
g0/0/9
[SW1-GigabitEthernet0/0/9]port
link-type
trunk
allow-pass
g0/0/10
[SW1-GigabitEthernet0/0/10]port
8.
9.
g0/0/13
10.
[SW1-GigabitEthernet0/0/13]port
11.
12.
g0/0/14
13.
[SW1-GigabitEthernet0/0/14]port
14.
15.
33
16.
SW2:
17.
[SW2]vlan
batch
18.
[SW2]int
19.
[SW2-GigabitEthernet0/0/9]port
20.
21.
22.
[SW2-GigabitEthernet0/0/10]port
23.
24.
25.
[SW2-Gig