作者tomsawyer (安安)
看板Network
标题[问答] 关於stp的小问题
时间Tue Mar 24 11:20:01 2020
大家好
我目前在某单位担任网管
但对以前学长留下来的stp设定不太了解
这个单位有2台cisco 2960s 一台 hpe A5500-24G 没有router
连线图大概是这样(更正)
cisco n7k
| | |
| | |
| | |
2960 2960 a5500
(三台都直连到不属於我们单位的switch 也无从得知上游sw怎麽设定的)
问题来了
这三台switch有开stp,并共用同一个vlan
查询後,两台2960的stp root 指向a5500
意思是否
1.资料会由 src->2960s->N7K->a5500->N7K->wan 这样绕一圈呢?
还是其实没差 根本不需要开stp?
附上show spanning-tree result
2960: (mac e8ba.****.****)
Spanning tree enabled protocol ieee
Root ID Priority 0
Address e8f7.****.****
Cost 4
Port ** (TenGigabitEthernet*/*/*)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address e8ba.****.****
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
a5500:(mac e8f7.****.****)
dis stp
----[Port**(Ten-GigabitEthernet*/*/*)][FORWARDING]----
Port Protocol :enabled
Port Role :CIST Designated Port
Port Priority :128
Port Cost(Legacy) :Config=auto / Active=2
Desg. Bridge/Port :0.e8f7-****-**** / 128.34
Port Edged :Config=disabled / Active=disabled
Point-to-point :Config=auto / Active=true
Transmit Limit :10 packets/hello-time
Protection Type :None
MST BPDU Format :Config=auto / Active=legacy
Port Config-
Digest-Snooping :disabled
Rapid transition :true
Num of Vlans Mapped :1
PortTimes :Hello 2s MaxAge 20s FwDly 15s MsgAge 0s RemHop 20
BPDU Sent :1572341
TCN: 0, Config: 0, RST: 1572341, MST: 0
BPDU Received :4891
TCN: 0, Config: 0, RST: 4891, MST: 0
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.115.154.130 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Network/M.1585020003.A.72A.html
※ 编辑: tomsawyer (140.115.154.130 台湾), 03/24/2020 11:29:56
1F:推 zaknafein: 观念错误 STP 作用只是建立任何点到点的单一路径03/24 11:56
2F:→ zaknafein: 不代表所有流量都会先去 STP root03/24 11:56
3F:→ zaknafein: 同样错误观念我也在快二十年的学长上看过 唉唉~03/24 11:57
也就是说stp只有建立在同vlan可以到的地方会做动吗?
※ 编辑: tomsawyer (180.217.140.144 台湾), 03/24/2020 12:00:47
4F:推 zaknafein: STP 本来就是为 layer2 设计的03/24 12:09
5F:推 zaknafein: 不同 vlan 会影响的话就天下大乱啦03/24 12:19
6F:→ zaknafein: 但你文中有说三台 switch 用同一个 vlan ?03/24 12:20
都设定是vlan 1 这样是叫做共用吗(?)
7F:→ zaknafein: 哪个 VLAN ? do these sw use the same ip network?03/24 12:22
这些sw上跑的都是同一个subnet的网路(/16)
※ 编辑: tomsawyer (180.217.140.144 台湾), 03/24/2020 12:33:37
8F:→ deadwood: 1.首先你们三台switch上串的也是一台switch,不然2960S03/24 13:07
9F:→ deadwood: 不会看到另一台的BPDU资讯而把他当root03/24 13:08
10F:→ deadwood: 2.三台switch都只有单port上串的话,哪台当root没有影响03/24 13:09
11F:→ deadwood: 如果2960S跟A5500又有另一port对接,就真的会所有流量先03/24 13:10
12F:→ deadwood: 过A5500了03/24 13:10
13F:推 zaknafein: 同一个subnet那上端的一定不是router03/24 13:10
14F:→ zaknafein: 可能是L3 switch03/24 13:11
问了一下学长 发现是一台n7k 修正一下
※ 编辑: tomsawyer (140.115.72.59 台湾), 03/24/2020 13:16:17
※ 编辑: tomsawyer (140.115.72.59 台湾), 03/24/2020 13:19:18
15F:推 birdy590: STP 只是用来避免 loop, 没踩到可以当它不存在 03/24 13:26
16F:推 zaknafein: n7k 是L3 Switch 2960 STP 跑到 a5500上面 表示设定有 03/24 13:28
17F:→ zaknafein: 问题 如果整个环境STP是自动运算的 你把a5500拿掉 03/24 13:29
所以这样会造成route上的问题/回圈吗?
18F:→ zaknafein: 会造成整个网路环境暂时失能 建议你玩玩看 XD03/24 13:29
之前单位停电时 有想要乘机调2960s的stp 可是无法调成root bridge
※ 编辑: tomsawyer (140.115.72.59 台湾), 03/24/2020 13:32:19
19F:推 zaknafein: root 不见 整个 stp 需要重新运算03/24 13:35
20F:→ zaknafein: 这段时间 网路不能使用 哈哈03/24 13:35
21F:推 zaknafein: 2960 把 priority 设成 O 应该可以抢赢 A550003/24 13:39
22F:→ zaknafein: 但是正常来说 root 摆在 n7k 那边比较好 因为变动少03/24 13:40
23F:推 zaknafein: 之前公司没有强制设定 root 加上又没做 bpdu guard03/24 13:43
24F:→ zaknafein: 员工私接 switch 进而导致网路常出问题 董事长跳脚...03/24 13:44
怕是n7k上有弄stp guard ,因为我2960s的prior降不下来 不知道为什麽
※ 编辑: tomsawyer (140.115.72.59 台湾), 03/24/2020 13:45:53
25F:→ deadwood: n7k要是有BPDU guard你也看不到STP讯息了吧.... 03/24 13:57
26F:→ deadwood: 然後如果有stp root guard,A5500也会直接被断03/24 13:58
27F:→ deadwood: 可见是n7k甚麽设定都没做,真的要解决你们环境的stp问题03/24 13:59
也就是说 我请n7k的管理员帮忙把root绑到他们身上就好了吧
28F:推 zaknafein: 同意楼上 不过认真讲 你自己lab玩玩就好03/24 13:59
因为这几台都负责一整栋/好几层楼的网路 断几分钟不是不行 但不能太久xD
29F:→ deadwood: 要解决stp问题根本的做法就是把A5500 priority设定改掉03/24 14:00
30F:→ deadwood: 至少要设定跟2960一样32768才对03/24 14:02
31F:→ deadwood: 不是去把2960S调成0去抢root03/24 14:03
※ 编辑: tomsawyer (140.115.72.59 台湾), 03/24/2020 14:22:39
※ 编辑: tomsawyer (140.115.72.59 台湾), 03/24/2020 14:32:37
32F:推 zaknafein: 对 管理员会对你刮目相看 (如果他听得懂的话)03/24 15:04
33F:→ zaknafein: 不过我猜应该不懂 然後 call out vendor03/24 15:04
反正n7k的管理员也是学生,应该会吧
※ 编辑: tomsawyer (140.115.50.48 台湾), 03/24/2020 15:09:50
34F:推 zaknafein: 我当学生时都不懂 (系电管理员03/24 15:22
所以我推测 N7K上没对这几台开stp/bpdu 所以才会导致root乱跳对吗?
※ 编辑: tomsawyer (140.115.50.48 台湾), 03/24/2020 15:26:30
35F:推 birdy590: 如果没特别设定, root bridge 本来就是选出来的03/24 15:57
36F:→ birdy590: 因为和资料流向其实无关 确定不会loop 关掉也不会怎麽样 03/24 16:01
37F:→ deadwood: root跑到不该是root的switch(5500)是因为5500设定不对03/24 16:13
38F:→ deadwood: spanning-tree的priority被设定为0(通常是core才这样设)03/24 16:15
39F:→ deadwood: N7K身为上层switch也没设定priority才会这样03/24 16:16
40F:→ deadwood: 怎麽解前面讲了,看你要不要去改而已,现在没问题也只是03/24 16:17
41F:→ deadwood: 问题还没浮现出来,最好是找n7K管理者一起解掉比较好03/24 16:18
42F:推 zaknafein: n7k 应设定 bpdu root guard 避免有sw宣告自己是 root03/24 16:47
43F:推 zaknafein: 这东西一时半刻也讲不清楚 出问题就会了03/24 16:49
我想要手设a5500 的stp port priority 结果超过240就不行了
仔细想想不对欸 明明priority是128.但在2960看过去是0 是因为是root的关系吗?
※ 编辑: tomsawyer (140.115.50.48 台湾), 03/24/2020 17:09:23
※ 编辑: tomsawyer (140.115.50.48 台湾), 03/24/2020 17:25:49
44F:推 birdy590: 要改的是 bridge priority, 不是 port priority03/24 17:31
ok 我改好了 问题是我现在不知道上游的N7K mac address了Orz
因为是不同的subnet(都是外网)
※ 编辑: tomsawyer (140.115.154.130 台湾), 03/24/2020 20:32:31
45F:推 zaknafein: Show cdp neighbor03/24 20:59
这个我刚刚有看到 问题是没东西
2960S>sh cdp neighbor detail
-------------------------
Device ID: ***-**-N7K(JA**********)
Entry address(es):
IP address: ***.**.***.187 <-某个与sw不同subnet的外网
Platform: N7K-C****, Capabilities: Router Switch IGMP CVTA phone port
Interface: TenGigabitEthernet*/*/*, Port ID (outgoing port): Ethernet*/*
Holdtime : 129 sec
Version :
Cisco Nexus Operating System (NX-OS) Software, Version *.*(**)
advertisement version: 2
Native VLAN: 3070 <-这是对面看过来的vlan对吧?
Duplex: full
Management address(es):
-------------------------
※ 编辑: tomsawyer (140.115.154.130 台湾), 03/24/2020 21:25:15
※ 编辑: tomsawyer (140.115.154.130 台湾), 03/24/2020 21:26:05
ok 我从hpe A5500那边捞到了
LLDP neighbor-information of port **[Ten-GigabitEthernet1/1/2]:
Neighbor index : 1
Update time : 0 days,0 hours,2 minutes,24 seconds
Chassis type : MAC address
Chassis ID : f0f7-5515-****
Port ID type : Locally assigned
Port ID : Eth4/6
Port description :
System name : ***-***N7K.***.***.tw
System capabilities supported : Bridge,Router
System capabilities enabled : Bridge,Router
Port VLAN ID(PVID): 3070
Unknown organizationally-defined TLV
TLV OUI : 00-01-42
TLV subtype : 1
Index : 1
TLV information : 01
STP也正常了
A5500:
----[CIST][Port**(Ten-GigabitEthernet1/1/2)][FORWARDING]----
Port Protocol :enabled
Port Role :CIST Root Port
Port Priority :64
Port Cost(Legacy) :Config=2 / Active=2
Desg. Bridge/Port :0.64a0-****-**** / 128.518
Port Edged :Config=disabled / Active=disabled
Point-to-point :Config=auto / Active=true
Transmit Limit :10 packets/hello-time
Protection Type :None
MST BPDU Format :Config=auto / Active=legacy
Port Config-
Digest-Snooping :disabled
Num of Vlans Mapped :1
PortTimes :Hello 2s MaxAge 20s FwDly 15s MsgAge 0s RemHop 0
BPDU Sent :1585837
TCN: 0, Config: 0, RST: 1584813, MST: 1024
BPDU Received :10002
TCN: 0, Config: 0, RST: 10002, MST: 0
2960s:
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 3070
Address 64a0.****.****
Cost 2
Port 28 (TenGigabitEthernet1/0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address e8ba.****.****
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
※ 编辑: tomsawyer (140.115.154.130 台湾), 03/24/2020 21:40:52
※ 编辑: tomsawyer (140.115.154.130 台湾), 03/24/2020 22:24:16
46F:→ deadwood: 现在还有一个小问题,两台switch对接N7K的switchport 03/24 22:25
47F:→ deadwood: mode可能不一致,对面是trunk port native vlan 307003/24 22:25
48F:→ deadwood: 你的两台switch可能都是access port vlan1(预设值)03/24 22:26
49F:→ deadwood: N7K上面其实也有设定switch priority=0,但是VLANID高於03/24 22:28
50F:→ deadwood: 底下5500(0+3070>0+1),root才会被抢走03/24 22:29
51F:→ deadwood: 虽然使用上没问题,但是也需要修正比较好的错误03/24 22:31
52F:→ deadwood: 看是要把n7k上把对接埠改成access vlan 1(通常不太可能)03/24 22:32
53F:→ deadwood: 或是把底下switch全部改成access vlan 3070,然後对接埠03/24 22:33
54F:→ deadwood: 改成跟n7k一样的mode跟vlan03/24 22:34
这样把vlan统一有差别在哪吗? 如果效能可以提高 我就一台一台慢慢改
有3台2960跟一堆aruba Orz
※ 编辑: tomsawyer (180.217.183.182 台湾), 03/25/2020 00:44:41
55F:→ deadwood: 现在N7K串接埠的native vlan是3070,下面是switch是 1 03/25 12:58
56F:→ deadwood: 表示不带vlan的封包在下串switch是当成vlan1流量,到了 03/25 12:59
57F:→ deadwood: N7K是送到vlan 3070处理,哪天N7K native vlan改掉 03/25 13:00
58F:→ deadwood: 下面的网路就不通了 03/25 13:00
59F:→ deadwood: 要改下串switch设定要先确认N7K的设定,调整成一致的 03/25 13:02
60F:→ deadwood: 自行修改不对照N7K的话可能改了也会不通,先确认清楚吧 03/25 13:03