注:需要设备支持
一、直通模式和门禁模式的区别:
1、直通模式主要应用于陌生人身份证比对场景,无需下发人员权限,门禁模式需要提前下发人员权限。
2、刷身份证人证比对的前提需要设备支持刷身份证读证件内容,或设备外接支持刷身份证读证件内容才行,只支持读身份证序列号是不行的(序列号是指一般默认刷身份证是读到10位的卡号)

二、设置方法
界面1:4200远程配置或者网页访问一体机:

界面2:4200访问控制-高级配置-更多参数-终端参数

注:需要设备支持
一、直通模式和门禁模式的区别:
1、直通模式主要应用于陌生人身份证比对场景,无需下发人员权限,门禁模式需要提前下发人员权限。
2、刷身份证人证比对的前提需要设备支持刷身份证读证件内容,或设备外接支持刷身份证读证件内容才行,只支持读身份证序列号是不行的(序列号是指一般默认刷身份证是读到10位的卡号)

二、设置方法
界面1:4200远程配置或者网页访问一体机:

界面2:4200访问控制-高级配置-更多参数-终端参数

步骤一:
请点击打印机的取消键
,打印机将回到就绪状态(此时也可继续使用)。
步骤二:
请根据华为喷墨打印机如何擦拭/清洁光栅条进行光栅条清洁,确认光栅条干净。
光栅条是打印机用于喷头定位的关键器件,在打印机使用(取卡纸、取异物、拆装喷头等)或运输过程中可能会导致光栅条被油脂、墨水或者指纹等污染,导致打印机喷头定位不准确,进而产生一系列故障现象。
注:擦拭光栅条时请控制力度,切勿弄断光栅条。
●光栅条脏污较轻微时(小面积油脂、墨水、指纹等),打印的画像会出现错位现象,可通过打印机的校准页或者清洁页清晰的反馈出来,如下图。


●光栅条脏污较严重时(较大片的油脂污染或者墨水污染)打印机会报错d系列错误码(d1/d2/d3),脏污位置不同,报错代码不同;或者打印机打印过程中会伴随有撞击音,跟正常打印过程中声音明显不同。
清洁/擦拭光栅条
如打印机在打印过程中出现以上现象,则需要清洁/擦拭光栅条,可按照以下步骤进行:
擦拭光栅条注意事项:
●光栅条下方的金属铁杆表面有润滑油,注意擦拭过程中不要将油脂带到光栅条表面。
●光栅条左侧靠弹簧拉着,擦拭过程中避免太用力拉扯光栅条,防止将光栅条扯下。
1、打印机准备:打印机正常状态下(此时面板数字键显示01)打开打印机带HUAWEI logo的前盖(此时面板数字键显示E4),轻按取消键,打印机喷头会运动到中间位置,在此状态下拔掉打印机电源。
2、光栅条检查:手动将打印机喷头推到最左端,找到光栅条所在位置:打印机内部银白色金属铁杆上方约2厘米处灰色半透明的长条塑料薄片(宽度约5毫米),使用闪光灯或手电筒检查光栅条表面脏污位置。

3、准备擦拭工具:优先选用带酒精的湿纸巾或者酒精棉片,其次选用普通纸巾喷酒精在表面,若无以上工具,也可选用不带酒精的湿纸巾或者湿水后的普通纸巾(此种情况擦拭后需要使用干纸巾复擦,避免水渍残留)。
4、擦拭光栅条:使用带酒精的湿纸巾(或上述道具)捏住光栅条两侧,由右往左轻轻擦拭光栅条,擦拭后打灯检查,脏污部位擦拭干净即可,如未擦拭干净可重复擦拭直到干净为止。
5、打印测试:擦拭完成后,关闭打印机前盖,通电开机,打印相关文件测试,如打印画像恢复正常则表示问题解决,
步骤三:
喷墨打印机喷头堵头进行喷头清洁。
长按打印机面板喷头校准键3S以上,打印机对喷头进行清洁,同时打印出清洁页(操作前需要放纸)。
注:如不小心点亮喷头校准键
,此时,打印机的操作面板上显示“A”,可按取消键
退回,待面板显示数字“01”后,重新长按喷头校准键3S以上,听到“滴”的一声即可。
步骤四:
请使用崭新的A4纸进行喷头校准操作。
请参阅:华为喷墨打印机喷头校准指导
打印校准页:
请在进纸托盘中放入全新干净的A4纸张,单击打印机面板喷头校准键
,面板显示字母A,按开始键
,开始键闪烁,数字键绕圈闪烁
,打印机将自动打出校准页,请稍等片刻。
将校准页放入扫描台:
校准页打出后,面板上数字键显示字母A,将校准页的标题朝左,内容面朝下,对齐左上角箭头处放入扫描区,盖上盖板。
扫描校准页:
按开始键
,开始键闪烁,数字键绕圈闪烁
,打印机开始扫描校准页,并进行自动校准,请稍等片刻。
查看校准结果:
数字键显示“01”,表示校准成功,此时您可以正常使用打印机;数字键显示“E6”,表示校准失败。
校准失败请参阅:华为喷墨打印机喷头校准失败,面板报错E6的解决方法
注:
1、拆喷头拆卸前,请务必要关闭止逆阀,否则会导致墨管中墨水会回退导致连供失败,打印缺色。
2、喷头取下来后不要用手或硬物触碰喷头前侧金属芯片部位和底部喷孔,防止喷头芯片损坏。
3、拆卸喷头后重新安装喷头,需重新进行喷头校准。
拆卸喷头
1、拆喷头的准备工具:
●拆卸喷头的准备工具要素:细长,长度15cm左右(可伸入喷头与字车上盖之间),坚硬(防止拆喷头过程中折断,卡在字车架内)。
●建议的工具:一根家用筷子(禁用一次性筷子,防止折断)或一支笔(外壳坚固,用笔尾部分伸入)或一把剪刀(用刀头部分伸入)或一把螺丝刀等。

2、工具以家用筷子为例,下面说明拆卸黑色喷头的操作流程,该方法同样适用于彩色喷头的拆卸。
●按打印机背面的开关键开机,操作面板指示灯显示“01”,用手握住打印机的前盖上方的中间托手凹槽位,轻轻向下拉,打开前盖,此时操作面板指示灯显示“E4”,字车移动到最右边的维护区。

●按操作面板的取消键,字车移动到出纸口中间,拔掉电源线插座断电,防止在通电状态下,字车自动移动碰伤手。

●关闭止逆阀:找到蓝色止逆阀,用手轻轻往左边推,直到听到“咔”的一声,代表止逆阀关闭,如下图所示:


●用手托住蓝色字车上盖的凸出位置,并且用力向上抬,听到“咔”的一声,字车盖被打开。

●一只手拖住喷头外侧凸起部分,将筷子放在喷头与字车盖之间弹簧卡扣的正下方,轻轻向上顶;顶起卡扣的同时,勾住喷头的手向外拨,喷头从字车架上松脱。然后,用手抓住喷头凸起位置,向外轻轻提拉,即可取下喷头,将取下的喷头平放在干净的桌面上。



安装喷头
1、如下图所示,用手拿住喷头,喷头的HUAWEI log面朝上,将喷头两边的凸点与字车架的卡槽对准,轻轻往里推字车,喷头进入字车架后用大拇指一顶,听到“咔”的一声,代表喷头已经安装到位。

2、找到蓝色字车盖子凸起位置,用手用力往下压,听到“咔哒”一声,代表已扣好字车盖,安装好黑色喷头后,可观察到黑色与彩色喷头的高度在同一水平线上。

3、打开止逆阀。

请接通电源,将打印机开机后,优先进行喷头校准,确保打印质量。
请参阅:华为喷墨打印机喷头校准指导
故障代码说明:
C2、C5————-黑色喷头故障
C6——————-彩色喷头故障
C3、C4————-黑色或彩色喷头故障
解决方法:
1、尝试打印机固件升级,再长按开关键重启打印机,查看问题是否解决。
2、请重新安装喷头,确保喷头安装到位。
一、组网需求
如下图:在Device A和B上开启MSTP协议,并配置相同的实例映射:配置实例1关联VLAN 10,
GigabitEthernet 0/1属于VLAN 10;配置实例2关联VLAN 20,GigabitEthernet 0/2属于VLAN 20。配置接口生成
树兼容,使接口发送的BPDU只携带所在VLAN对应的实例信息。
二、组网图

三、配置要点
● Device A和B可以采用相同配置,如下以Device A为例。
● 创建VLAN 10和20,创建实例1和2,实例1关联VLAN 10,实例2关联VLAN 20。再配置GigabitEthernet 0/1属于VLAN 10,GigabitEthernet 0/2属于VLAN 20,配置接口生成树兼容。最后开启生成树。
四、配置步骤
(1) 创建VLAN 10和20,创建实例1和2。实例1关联VLAN 10,实例2关联VLAN 20。
DeviceA> enable
DeviceA# configure terminal
DeviceA(config)# vlan range 10,20
DeviceA(config-vlan-range)# exit
DeviceA(config)# spanning-tree mst configuration
DeviceA(config-mst)# instance 1 vlan 10
DeviceA(config-mst)# instance 2 vlan 20
DeviceA(config-mst)# exit
(2) 配置GigabitEthernet 0/1属于VLAN 10;GigabitEthernet 0/2属于VLAN 20;配置接口生成树兼容。
DeviceA(config)# interface gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/1)# switchport access vlan 10
DeviceA(config-if-GigabitEthernet 0/1)# spanning-tree compatible enable
DeviceA(config-if-GigabitEthernet 0/1)# exit
DeviceA(config)# interface gigabitethernet 0/2
DeviceA(config-if-GigabitEthernet 0/2)# switchport access vlan 20
DeviceA(config-if-GigabitEthernet 0/2)# spanning-tree compatible enable
DeviceA(config-if-GigabitEthernet 0/2)# exit
(3) 开启生成树。
DeviceA(config)# spanning-tree
DeviceA(config)# end
DeviceA# write
五、验证配置结果
(1) 若未配置接口生成树兼容的情况下,查看生成树如下。
# Device A因桥ID较小成为Device B的根。Device A的GigabitEthernet 0/1和GigabitEthernet 0/2在各实例中均为指定端口。
DeviceA# show spanning-tree summary
Spanning tree enabled protocol mstp
略……………………………………….
Gi0/1 Desg FWD 20000 128 False P2p
Gi0/2 Desg FWD 20000 128 False P2p
MST 1 vlans map : 10
略……………………………………….
Gi0/1 Desg FWD 20000 128 False P2p
Gi0/2 Desg FWD 20000 128 False P2p
MST 1 vlans map : 20
略……………………………………….
Gi0/1 Desg FWD 20000 128 False P2p
Gi0/2 Desg FWD 20000 128 False P2p
# 查看Devcie B。在实例1生成树中,属于VLAN 10的GigabitEthernet 0/1为根端口,属于VLAN 20的GigabitEthernet 0/2为替换端口;但是因GigabitEthernet 0/2不许可VLAN 10通过,替换端口并不能起到替换作用。在实例2生成树中,属于VLAN 20的GigabitEthernet 0/2为根端口,属于VLAN 10的GigabitEthernet 0/1为替换端口;但是因GigabitEthernet 0/1不许可VLAN 20通过,替换端口并不能起到替换作用。
DevicB# show spanning-tree summary
Spanning tree enabled protocol mstp
略……………………………………….
Gi0/1 Root FWD 20000 128 False P2p
Gi0/2 Altn BLK 20000 128 False P2p
MST 1 vlans map : 10
略……………………………………….
Gi0/1 Root FWD 20000 128 False P2p
Gi0/2 Altn BLK 20000 128 False P2p
MST 1 vlans map : 20
略……………………………………….
Gi0/1 Altn BLK 20000 128 False P2p
Gi0/2 Root FWD 20000 128 False P2p
(2) 配置接口生成树兼容功能后,在Device A上查看生成树拓扑。Device A因桥ID较小成为Device B的根。
# 实例0未进行生成树裁剪,GigabitEthernet 0/1和GigabitEthernet 0/2为指定端口。
DeviceA# show spanning-tree summary
Spanning tree enabled protocol mstp
略……………………………………….
Interface Role Sts Cost Prio OperEdge Type
—————- —- — ———- ——– ——– —————-
Gi0/1 Desg FWD 20000 128 False P2p
Gi0/2 Desg FWD 20000 128 False P2p
# 实例1进行了生成树裁剪,只有属于VLAN 10的GigabitEthernet 0/1为指定端口。
略……………………………………….
Gi0/1 Desg FWD 20000 128 False P2p
Gi0/2 Desg FWD 20000 128 False P2p
……………………………………….
# 实例2进行了生成树裁剪,只有属于VLAN 20的GigabitEthernet 0/2为指定端口。
略……………………………………….
Gi0/1 Desg FWD 20000 128 False P2p
(3) 在DeviceB上查看生成树拓扑。Device A因桥ID较小成为Device B的根。
# 实例0未进行生成树裁剪,GigabitEthernet 0/1为根端口,GigabitEthernet 0/2为替换端口。
DeviceB# show spanning-tree summary
Spanning tree enabled protocol mstp
略……………………………………….
Gi0/1 Root FWD 20000 128 False P2p
Gi0/2 Altn BLK 20000 128 False P2p
……………………………………….
# 实例1进行了生成树裁剪,只有属于VLAN 10的GigabitEthernet 0/1为根端口,不存在替换端口。
略……………………………………….
Gi0/1 Root FWD 20000 128 False P2p
# 实例2进行了生成树裁剪,只有属于VLAN 20的GigabitEthernet 0/2为根端口,不存在替换端口。
略……………………………………….
Gi0/2 Root FWD 20000 128 False P2p
六、配置文件
●Device A和Device B的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-4094
instance 1 vlan 10
instance 2 vlan 20
!
spanning-tree
!
vlan range 1,10,20
!
interface GigabitEthernet 0/1
switchport access vlan 10
spanning-tree compatible enable
!
interface GigabitEthernet 0/2
switchport access vlan 20
spanning-tree compatible enable
注:常见错误
● 若链路两端接口VLAN列表不一致,当接口生成树兼容功能对VLAN进行裁剪后,可能导致通信异常。
● 若未配置不同的实例,或接口许可所有VLAN通过,则生成树兼容功能无法基于实例进行生成树裁剪,也没有必要配置生成树兼容功能。
MSTP协议(Multiple SpanningTree Protocol,多生成树协议)。
生成树协议是一种二层管理协议,它的主要功能是阻塞网络中的冗余链路来消除二层环路,在链路故障时启用备份链路。
VRRP(Virtual Router Redundancy Protocol,虚拟路由冗余协议)是一种路由容错协议。当局域网内承担路由转发功能的设备失效后,另一台将自动接管,从而实现IP路由的热备份与容错,同时也保证了局域网内主机通讯的连续性和可靠性,主要应用在局域网路由出口冗余备份的场景。
一、组网需求
MSTP+VRRP双核心应用方案为MSTP协议的一个典型应用场景。该方案采用层次化网络架构,使用MSTP+VRRP协议实现冗余备份和VLAN负载均衡,提高网络系统可用性。此架构的主要优点在于结构的层次化;每一层网络设备的容量指标、特点和功能,都可针对其网络位置和作用进行优化,以加强系统稳定性和可靠性。该方案通常采用三层(核心层、汇聚层和接入层)或二层(核心层和接入层)架构,如下图,采用二层架构,组网需求如下。
●核心层:配置MSTP多实例达到负载均衡的效果。创建实例1和实例2。实例1映射VLAN 10和30;实例2映射VLAN 20和40。Device A为实例0和1的根桥(实例0默认存在),同时为VLAN 10和30的VRRP主设备。
Device B为实例2根桥,同时为VLAN 20和40的VRRP主设备。
●接入层:将直连终端(PC或服务器)的端口配置成边缘端口,同时配置BPDU保护功能,防止用户私自接入非法的设备。
二、组网图

三、配置要点
1、配置MSTP:
●配置生成树模式为MSTP。缺省情况下,生成树模式为MSTP,不必配置。
●配置MST Region,在Device A、B、C和D上配置实例1映射VLAN 10和30;实例2映射VLAN 20和40。
●配置实例0和1在Device A上的桥优先级为4096,在Device B上的桥优先级为8192,使Device A成为实例0和1的根桥。
●配置实例2在Device A上的桥优先级为8192,在Device B上的桥优先级为4096,使Device B成为实例2的根桥。
●在接入设备Device C和D上,实例0、1和2的桥优先级采用缺省值32768,将连接用户的端口配置为边缘端口,不参与生成树计算,并开启BPDU保护功能。
2、配置VRRP组的监视端口:将Master设备的上链口配置为对应VLAN的监视接口。Device A的GigabitEthernet0/5监视VLAN10和30;Device B的GigabitEthernet 0/5监视VLAN20和40。
●在上链口的接口配置模式下使用no switchport命令,把监视端口配置为三层口,并配置接口的IP地址。三层口不参与生成树计算。
●在VLAN的SVI接口配置模式下,使用vrrp group-id track interface-type interface-number [ priority decrement ]命令,配置VRRP组group-id的监视端口interface-type interface-number,和VRRP优先级改变值priority decrement。priority decrement为被监视接口链路状态或IP路由可达状态变化时,VRRP优先级改变值;链路断开时,减少优先级,链路恢复时,还原优先级;取值范围为1~255,缺省值为10。
3、优先级参数的配置:VRRP优先级改变值需要和VRRP优先级结合在一起考虑。在VLAN的SVI接口配置模式下,使用命令vrrp group-id priority priority配置VRRP优先级,priority取值范围为1~254,缺省值为100。因
为priority decrement缺省值为10,当监视端口Down掉时,对应VRRP优先级降低为100-10=90。
●在本例中,将VLAN 10和30在其Master设备Device A上的VRRP优先级抬高到120,Device B上采用默认优先级100,并配置priority decrement为30。当Device A的监视端口GigabitEthernet 0/5因故障Down掉时,VLAN 10和30的VRRP优先级默认减30,变成90;低于它们在Device B上的默认优先级100,VLAN 10和30数据将通过Device B传输。当Device A的监视端口GigabitEthernet 0/5恢复通信时,VRRP
优先级为90+30=120,大于Device B上的优先级,VLAN 10和30数据恢复到Device A上传输。如此,VLAN 10和30则将Device A作为VRRP Master设备,Device B作为VRRP Backup设备。
●同理,将VLAN 20和40在Device B上的VRRP优先级抬高到120,Device A上采用默认优先级100。
4、 配置VRRP:将VLAN的SVI加入VRRP组,同时配置VRRP组的虚拟IP地址。
5、配置SVI地址需要注意,如果监视端口Down掉,VRRP优先级降低后,出现优先级相等的情况,将比较VLAN在两台设备上的SVI地址,IP越大优先级越高。所以建议VLAN 10和VLAN 30在Master设备Device A上的IP地址配置得比Device B大。其它VLAN同理。
6、 核心设备之间需要配置聚合链路。核心设备下联口和接入设备上联口需要配置为Trunk口。接入设备上连接用户的端口需要配置为Access口,并加入VLAN。
四、配置步骤
(1) 配置MSTP功能。
# 配置核心设备Device A的MSTP功能。创建VLAN,实例1映射VLAN 10和30;实例2映射VLAN 20和40。配置实例0和1的桥优先级为4096,实例2的桥优先级为8192,使Device A成为实例0和1的根桥。开启MSTP。
DeviceA> enable
DeviceA# configure terminal
DeviceA(config)# vlan range 10,20,30,40
DeviceA(config-vlan-range)# exit
DeviceA(config)# spanning-tree mode mstp
DeviceA(config)# spanning-tree mst configuration
DeviceA(config-mst)# instance 1 vlan 10,30
DeviceA(config-mst)# instance 2 vlan 20,40
DeviceA(config-mst)# exit
DeviceA(config)# spanning-tree mst 0 priority 4096
DeviceA(config)# spanning-tree mst 1 priority 4096
DeviceA(config)# spanning-tree mst 2 priority 8192
DeviceA(config)# spanning-tree
# 配置核心设备Device B的MSTP功能。创建VLAN,实例1映射VLAN 10和30;实例2映射VLAN 20和40。配置实例0和1的桥优先级为8192,实例2的桥优先级为4096,使Device B成为实例2的根桥。开启MSTP。
DeviceB> enable
DeviceB# configure terminal
DeviceB(config)# vlan range 10,20,30,40
DeviceB(config-vlan-range)# exit
DeviceB(config)# spanning-tree mode mstp
DeviceB(config)# spanning-tree mst configuration
DeviceB(config-mst)# instance 1 vlan 10,30
DeviceB(config-mst)# instance 2 vlan 20,40
DeviceB(config-mst)# exit
DeviceB(config)# spanning-tree mst 0 priority 8192
DeviceB(config)# spanning-tree mst 1 priority 8192
DeviceB(config)# spanning-tree mst 2 priority 4096
DeviceB(config)# spanning-tree
# 配置接入设备Device C和Device D的MSTP功能。接入设备上不需要配置桥优先级。配置直连用户的端口为边缘端口,同时启用BPDU保护。Device D和Device C配置类似,下面仅以Device C为例。
DeviceC> enable
DeviceC# configure terminal
DeviceC(config)# vlan range 10,20,30,40
DeviceC(config-vlan-range)# exit
DeviceC(config)# spanning-tree mode mstp
DeviceC(config)# spanning-tree mst configuration
DeviceC(config-mst)# instance 1 vlan 10,30
DeviceC(config-mst)# instance 2 vlan 20,40
DeviceC(config-mst)# exit
DeviceC(config)# spanning-tree
DeviceC(config)# interface range gigabitethernet 0/3-6
DeviceC(config-if-range)# spanning-tree portfast
DeviceC(config-if-range)# spanning-tree bpduguard enable
DeviceC(config-if-range)# exit
(2) 配置VRRP组的监视端口。
# 配置Device A的GigabitEthernet 0/5为路由口,并配置IP地址为10.10.1.1/24。以便作为VLAN10和30的监视端口。
DeviceA(config)# interface gigabitethernet 0/5
DeviceA(config-if-GigabitEthernet 0/5)# no switchport
DeviceA(config-if-GigabitEthernet 0/5)# ip address 10.10.1.1 255.255.255.0
DeviceA(config-if-GigabitEthernet 0/5)# exit
# 配置Device B的GigabitEthernet 0/5为路由口,并配置IP地址为10.10.2.1/24。以便作为VLAN20和40的监视端口。
DeviceB(config)# interface gigabitethernet 0/5
DeviceB(config-if-GigabitEthernet 0/5)# no switchport
DeviceB(config-if-GigabitEthernet 0/5)# ip address 10.10.2.1 255.255.255.0
DeviceB(config-if-GigabitEthernet 0/5)# exit
(3) 配置核心设备上VLAN10和30的VRRP。
# 配置Master设备Device A。进入SVI接口,配置SVI地址。配置SVI加入对应的VRRP组,同时配置VRRP组的虚网关IP地址。抬高VRRP优先级为120,配置监视端口GigabitEthernet 0/5,并配置priority decrement
为30。
DeviceA(config)# interface vlan 10
DeviceA(config-if-VLAN 10)# ip address 192.168.10.3 255.255.255.0
DeviceA(config-if-VLAN 10)# vrrp 10 ip 192.168.10.1
DeviceA(config-if-VLAN 10)# vrrp 10 priority 120
DeviceA(config-if-VLAN 10)# vrrp 10 track gigabitethernet 0/5 30
DeviceA(config-if-VLAN 10)# exit
DeviceA(config)# interface vlan 30
DeviceA(config-if-VLAN 30)# ip address 192.168.30.3 255.255.255.0
DeviceA(config-if-VLAN 30)# vrrp 30 ip 192.168.30.1
DeviceA(config-if-VLAN 30)# vrrp 30 priority 120
DeviceA(config-if-VLAN 30)# vrrp 30 track gigabitethernet 0/5 30
DeviceA(config-if-VLAN 30)# exit
# 配置Backup设备Device B。进入SVI接口,配置SVI地址。配置SVI加入对应的VRRP组,同时配置VRRP组的虚网关IP地址。在Backup设备上采用默认VRRP优先级100,不需要配置监视端口。
DeviceB(config)# interface vlan 10
DeviceB(config-if-VLAN 10)# ip address 192.168.10.2 255.255.255.0
DeviceB(config-if-VLAN 10)# vrrp 10 ip 192.168.10.1
DeviceB(config-if-VLAN 10)# exit
DeviceB(config)# interface vlan 30
DeviceB(config-if-VLAN 30)# ip address 192.168.30.2 255.255.255.0
DeviceB(config-if-VLAN 30)# vrrp 30 ip 192.168.30.1
DeviceB(config-if-VLAN 30)# exit
(4) 配置核心设备上VLAN20和40的VRRP。
# 配置Master设备Device B。进入SVI接口,配置SVI地址。配置SVI加入对应的VRRP组,同时配置VRRP组的虚网关IP地址。抬高VRRP优先级为120,配置监视端口GigabitEthernet 0/5,并配置priority decrement
为30。
DeviceB(config)# interface vlan 20
DeviceB(config-if-VLAN 20)# ip address 192.168.20.3 255.255.255.0
DeviceB(config-if-VLAN 20)# vrrp 20 ip 192.168.20.1
DeviceB(config-if-VLAN 20)# vrrp 20 priority 120
DeviceB(config-if-VLAN 20)# vrrp 20 track gigabitethernet 0/5 30
DeviceB(config-if-VLAN 20)# exit
DeviceB(config)# interface vlan 40
DeviceB(config-if-VLAN 40)# ip address 192.168.40.3 255.255.255.0
DeviceB(config-if-VLAN 40)# vrrp 40 ip 192.168.40.1
DeviceB(config-if-VLAN 40)# vrrp 40 priority 120
DeviceB(config-if-VLAN 40)# vrrp 40 track gigabitethernet 0/5 30
DeviceB(config-if-VLAN 40)# exit
# 配置Backup设备Device A。进入SVI接口,配置SVI地址。配置SVI加入对应的VRRP组,同时配置VRRP组的虚网关IP地址。在Backup设备上采用默认VRRP优先级100,不需要配置监视端口。
DeviceA(config)# interface vlan 20
DeviceA(config-if-VLAN 20)# ip address 192.168.20.2 255.255.255.0
DeviceA(config-if-VLAN 20)# vrrp 20 ip 192.168.20.1
DeviceA(config-if-VLAN 20)# exit
DeviceA(config)# interface vlan 40
DeviceA(config-if-VLAN 40)# ip address 192.168.40.2 255.255.255.0
DeviceA(config-if-VLAN 40)# vrrp 40 ip 192.168.40.1
DeviceA(config-if-VLAN 40)# exit
(5) 配置VRRP核心设备之间的聚合链路。
# 在Device A上配置GigabitEthernet 0/3和0/4聚合为AggregatePort 1,配置聚合口为Trunk模式。
DeviceA(config)# interface range gigabitethernet 0/3-4
DeviceA(config-if-range)# port-group 1
DeviceA(config-if-range)# exit
DeviceA(config-if-range)# interface aggregateport 1
DeviceA(config-if-AggregatePort 1)# switchport mode trunk
DeviceA(config-if-AggregatePort 1)# exit
# 在Device B上配置GigabitEthernet 0/3和0/4聚合为AggregatePort 1,配置聚合口为Trunk模式。
DeviceB(config)# interface range gigabitethernet 0/3-4
DeviceB(config-if-range)# port-group 1
DeviceB(config-if-range)# exit
DeviceB(config-if-range)# interface aggregateport 1
DeviceB(config-if-AggregatePort 1)# switchport mode trunk
DeviceB(config-if-AggregatePort 1)# exit
(6) 配置核心设备下联口和接入设备上联口为Trunk口。
# 配置Device A下联口GigabitEthernet 0/1~0/2为Trunk口。
DeviceA(config)# interface range gigabitethernet 0/1-2
DeviceA(config-if-range)# switchport mode trunk
DeviceA(config-if-range)# end
DeviceA# write
# 配置Device B下联口GigabitEthernet 0/1~0/2为Trunk口。
DeviceB(config)# interface range gigabitethernet 0/1-2
DeviceB(config-if-range)# switchport mode trunk
DeviceB(config-if-range)# end
DeviceB# write
# 配置Device C上联口GigabitEthernet 0/1~0/2为Trunk口。
DeviceC(config)# interface range gigabitethernet 0/1-2
DeviceC(config-if-range)# switchport mode trunk
DeviceC(config-if-range)# exit
# 配置Device D上联口GigabitEthernet 0/1~0/2为Trunk口。
DeviceD(config)# interface range gigabitethernet 0/1-2
DeviceD(config-if-range)# switchport mode trunk
DeviceD(config-if-range)# exit
(7) 配置接入设备用户端口为Access模式,并加入VLAN。
# 配置Device C。
DeviceC(config)# interface gigabitethernet 0/3
DeviceC(config-if-GigabitEthernet 0/3)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/3)# switchport access vlan 10
DeviceC(config-if-GigabitEthernet 0/3)# exit
DeviceC(config)# interface gigabitethernet 0/4
DeviceC(config-if-GigabitEthernet 0/4)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/4)# switchport access vlan 20
DeviceC(config-if-GigabitEthernet 0/4)# exit
DeviceC(config)# interface gigabitethernet 0/5
DeviceC(config-if-GigabitEthernet 0/5)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/5)# switchport access vlan 30
DeviceC(config-if-GigabitEthernet 0/5)# exit
DeviceC(config)# interface gigabitethernet 0/6
DeviceC(config-if-GigabitEthernet 0/6)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/6)# switchport access vlan 40
DeviceC(config-if-GigabitEthernet 0/6)# end
DeviceC# write
# 配置Device D。
DeviceD(config)# interface gigabitethernet 0/3
DeviceD(config-if-GigabitEthernet 0/3)# switchport mode access
DeviceD(config-if-GigabitEthernet 0/3)# switchport access vlan 10
DeviceD(config-if-GigabitEthernet 0/3)# exit
DeviceD(config)# interface gigabitethernet 0/4
DeviceD(config-if-GigabitEthernet 0/4)# switchport mode access
DeviceD(config-if-GigabitEthernet 0/4)# switchport access vlan 20
DeviceD(config-if-GigabitEthernet 0/4)# exit
DeviceD(config)# interface gigabitethernet 0/5
DeviceD(config-if-GigabitEthernet 0/5)# switchport mode access
DeviceD(config-if-GigabitEthernet 0/5)# switchport access vlan 30
DeviceD(config-if-GigabitEthernet 0/5)# exit
DeviceD(config)# interface gigabitethernet 0/6
DeviceD(config-if-GigabitEthernet 0/6)# switchport mode access
DeviceD(config-if-GigabitEthernet 0/6)# switchport access vlan 40
DeviceD(config-if-GigabitEthernet 0/6)# end
DeviceD# write
五、验证配置结果
# 在Device A上通过show spanning-tree summary查看生成树拓扑。
DeviceA# show spanning-tree summary
Spanning tree enabled protocol mstp
……………………………………….
# 在Device B上通过show spanning-tree summary查看生成树拓扑。
DeviceB# show spanning-tree summary
Spanning tree enabled protocol mstp
……………………………………….
# Device C和D上,通过show spanning-tree summary查看生成树拓扑计算的正确性。如下以Device C为例。
DeviceC# show spanning-tree summary
Spanning tree enabled protocol mstp
……………………………………….
# 在Device A,Device B上通过show vrrp brief查看VRRP主备是否建立成功。
DeviceA# show vrrp brief
# 断开Device A的上行链路GigabitEthernet 0/5,在Device A,Device B上查看设备的VRRP状态变化。
DeviceA#show vrrp brief
……………………………………….
DeviceB# show vrrp brief
……………………………………….
# 断开Device B的上行链路GigabitEthernet 0/5,在Device A,Device B上查看设备的VRRP状态变化。
DeviceA#show vrrp brief
……………………………………….
DeviceB# show vrrp brief
……………………………………….
六、配置文件
●Device A的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-29, 31-39, 41-4094
instance 1 vlan 10, 30
instance 2 vlan 20, 40
!
spanning-tree mst 0 priority 4096
spanning-tree mst 1 priority 4096
spanning-tree mst 2 priority 8192
spanning-tree
!
sysmac 00d0.f822.3344
!
vlan range 1,10,20,30,40
!
interface GigabitEthernet 0/1
switchport mode trunk
!
interface GigabitEthernet 0/2
switchport mode trunk
!
interface GigabitEthernet 0/3
port-group 1
!
interface GigabitEthernet 0/4
port-group 1
!
interface AggregatePort 1
switchport mode trunk
!
interface gigabitethernet 0/5
no switchport
ip address 10.10.1.1 255.255.255.0
!
interface vlan 10
ip address 192.168.10.3 255.255.255.0
vrrp 10 ip 192.168.10.1
vrrp 10 priority 120
vrrp 10 track gigabitethernet 0/5 30
!
interface vlan 20
ip address 192.168.20.2 255.255.255.0
vrrp 20 ip 192.168.20.1
!
interface vlan 30
ip address 192.168.30.3 255.255.255.0
vrrp 30 ip 192.168.30.1
vrrp 30 priority 120
vrrp 30 track gigabitethernet 0/5 30
!
interface vlan 40
ip address 192.168.40.2 255.255.255.0
vrrp 40 ip 192.168.40.1
●Device B的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-29, 31-39, 41-4094
instance 1 vlan 10, 30
instance 2 vlan 20, 40
!
spanning-tree mst 0 priority 8192
spanning-tree mst 1 priority 8192
spanning-tree mst 2 priority 4096
spanning-tree
!
sysmac 001a.a917.78cc
!
vlan range 1,10,20,30,40
!
interface GigabitEthernet 0/1
switchport mode trunk
!
interface GigabitEthernet 0/2
switchport mode trunk
!
interface GigabitEthernet 0/3
port-group 1
!
interface GigabitEthernet 0/4
port-group 1
!
interface AggregatePort 1
switchport mode trunk
!
interface gigabitethernet 0/5
no switchport
ip address 10.10.2.1 255.255.255.0
!
interface vlan 10
ip address 192.168.10.2 255.255.255.0
vrrp 10 ip 192.168.10.1
!
interface vlan 20
ip address 192.168.20.3 255.255.255.0
vrrp 20 ip 192.168.20.1
vrrp 20 priority 120
vrrp 20 track gigabitethernet 0/5 30
!
interface vlan 30
ip address 192.168.30.2 255.255.255.0
vrrp 30 ip 192.168.30.1
!
interface vlan 40
ip address 192.168.40.3 255.255.255.0
vrrp 40 ip 192.168.40.1
vrrp 40 priority 120
vrrp 40 track gigabitethernet 0/5 3
● Device C和Device D的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-29, 31-39, 41-4094
instance 1 vlan 10, 30
instance 2 vlan 20, 40
!
spanning-tree
!
vlan range 1,10,20,30,40
!
interface GigabitEthernet 0/1
switchport mode trunk
!
interface GigabitEthernet 0/2
switchport mode trunk
!
interface GigabitEthernet 0/3
switchport access vlan 10
spanning-tree bpduguard enable
spanning-tree portfast
!
interface GigabitEthernet 0/4
switchport access vlan 20
spanning-tree bpduguard enable
spanning-tree portfast
!
interface GigabitEthernet 0/5
switchport access vlan 30
spanning-tree bpduguard enable
spanning-tree portfast
!
interface GigabitEthernet 0/6
switchport access vlan 40
spanning-tree bpduguard enable
spanning-tree portfast
注:常见错误
● 在MSTP+VRRP拓扑中,不同设备上的MST域配置不一致。
● 配置实例和VLAN的映射关系时未提前创建VLAN。
●在MSTP+VRRP拓扑中,若某些设备运行的是STP或RSTP协议,则该设备将被当做不同MST域来进行生成
树计算,此时计算出的生成树将与预期不同。
生成树协议是一种二层管理协议,它的主要功能是阻塞网络中的冗余链路来消除二层环路,在链路故障时启用备份链路。
随着网络的发展不断更新,生成树协议已有多种版本:
STP协议(Spanning Tree Protocol,生成树协议),
RSTP协议(Rapid Spanning Tree Protocol,快速生成树协议)
MSTP协议(Multiple SpanningTree Protocol,多生成树协议)。
一、组网需求
如下图,两层拓扑结构,核心层设备为Device A和Device B,接入层设备为Device C,Device C连接内网终端。内网存在4个VLAN,配置MSTP功能满足如下需求:
● VLAN 10和VLAN 30的生成树根桥为Device A,并且从Device C的GigabitEthernet 0/1转发数据。
● VLAN 20和VLAN 40的生成树根桥为Device B,并且从Device C的GigabitEthernet 0/2转发数据。
● 在Device C的根端口上开启环路保护功能。在Device C连接终端的边缘端口上开启BPDU保护功能。
二、组网图

三、配置要点
●在Devcie A、B和C上创建相同的VLAN,配置相同的实例映射:实例1映射VLAN 10和30;实例2映射VLAN20和40。实例0包含其它未创建的VLAN。
●设备通过比较优先级向量< Root Identifier,Root Path Cost,Bridge ID,Port ID >选举出生成树中的设备角色和端口角色,配置实例的桥优先级和端口路径开销,以便算出组网需求中要求的拓扑。为便于管理,实例0配置和实例1同样的生成树。
实例0和1:
※Device A的桥优先级配置为4096,Device B的桥优先级配置为8192,Device C的桥优先级采用缺省值32768(无需配置),使Device A成为根。
※在Device B上,配置GigabitEthernet 0/2端口路径开销为1,GigabitEthernet 0/1端口路径开销为4,使得
GigabitEthernet 0/2成为Device B的根端口。
※在Device C上,配置GigabitEthernet 0/1端口路径开销为1,GigabitEthernet 0/2端口路径开销为4,使得
GigabitEthernet 0/1成为Device C的根端口。
※Device B的桥优先级8192高于Device C的桥优先级32768,Device B的GigabitEthernet 0/1成为指定端口,Device C的GigabitEthernet 0/2成为替换端口。
实例2:
※Device B的桥优先级配置为4096,Device A的桥优先级配置为8192,Device C的桥优先级采用缺省值32768(无需配置),使Device B成为根。
※在Device A上,配置GigabitEthernet 0/2端口路径开销为1,GigabitEthernet 0/1端口路径开销为4,使得GigabitEthernet 0/2成为Device A的根端口。
※在Device C上,配置GigabitEthernet 0/2端口路径开销为1,GigabitEthernet 0/1端口路径开销为4,使得
GigabitEthernet 0/2成为Device C的根端口。
※Device A的桥优先级8192高于Device C的桥优先级32768,Device A的GigabitEthernet 0/1成为指定端口,Device C的GigabitEthernet 0/1成为替换端口。
●在Device C的GigabitEthernet 0/1~0/2上配置MSTP环路保护,当根端口或备份口因收不到BPDU迁移为指定端口时,端口状态将一直保持Discarding(废弃)状态,直到重新收到BPDU进行生成树计算。
● 配置Device C连接终端的接口GigabitEthernet 0/3~0/6为边缘端口。在缺省情况下边缘端口自动识别功能处于开启状态,若GigabitEthernet 0/3~0/6被选举为指定端口后3秒内未接收到BPDU,则被自动识别为边缘端口并立即进入转发状态。若网络中存在丢包或收发报文延迟的现象,可能影响边缘端口自动识别功能。因此,关闭边缘端口自动识别功能,手工配置其为边缘端口,并开启BPDU保护功能。
● 在Devcie A、B和C上全局开启生成树功能,缺省为MSTP模式。
● 配置Devcie A、B和C的互联端口为Trunk口,许可所有VLAN通过。配置Device C连接终端的接口加入所在VLAN。
四、配置步骤
(1) 配置Device A。
# 创建VLAN,配置实例映射。
DeviceA>enable
DeviceA# configure terminal
DeviceA(config)# vlan range 10,20,30,40
DeviceA(config-vlan-range)# exit
DeviceA(config)# spanning-tree mst configuration
DeviceA(config-mst)# instance 1 vlan 10,30
DeviceA(config-mst)# instance 2 vlan 20,40
# 配置实例0和1的桥优先级为4094,实例2的桥优先级为8192。
DeviceA(config-mst)# spanning-tree mst 0 priority 4096
DeviceA(config)# spanning-tree mst configuration
DeviceA(config-mst)# spanning-tree mst 1 priority 4096
DeviceA(config)# spanning-tree mst configuration
DeviceA(config-mst)# spanning-tree mst 2 priority 8192
# 配置GigabitEthernet 0/2为Trunk口。在实例2中,配置端口路径开销为1。
DeviceA(config)# interface range gigabitethernet 0/2
DeviceA(config-if-GigabitEthernet 0/2)# switchport
DeviceA(config-if-GigabitEthernet 0/2)# switchport mode trunk
DeviceA(config-if-GigabitEthernet 0/2)# spanning-tree mst 2 cost 1
DeviceA(config-if-GigabitEthernet 0/2)# exit
# 配置GigabitEthernet 0/1为Trunk口。在实例2中,配置端口路径开销为4。
DeviceA(config)# interface range gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/1)# switchport
DeviceA(config-if-GigabitEthernet 0/1)# switchport mode trunk
DeviceA(config-if-GigabitEthernet 0/1)# spanning-tree mst 2 cost 4
DeviceA(config-if-GigabitEthernet 0/1)# exit
# 全局开启生成树功能。
DeviceA(config)# spanning-tree
DeviceA(config)# end
DeviceA# write
(2) 配置Device B。
# 创建VLAN,配置实例映射。
DeviceB> enable
DeviceB# configure terminal
DeviceB(config)# vlan range 10,20,30,40
DeviceB(config-vlan-range)# exit
DeviceB(config)# spanning-tree mst configuration
DeviceB(config-mst)# instance 1 vlan 10,30
DeviceB(config-mst)# instance 2 vlan 20,40
# 配置实例2的优先级为4094,实例0和1的桥优先级为8192。
DeviceB(config-mst)# spanning-tree mst 0 priority 8192
DeviceB(config)# spanning-tree mst configuration
DeviceB(config-mst)# spanning-tree mst 1 priority 8192
DeviceB(config)# spanning-tree mst configuration
DeviceB(config-mst)# spanning-tree mst 2 priority 4096
# 配置GigabitEthernet 0/2为Trunk口。在实例0和1中,配置端口路径开销为1。
DeviceB(config)# interface range gigabitethernet 0/2
DeviceB(config-if-GigabitEthernet 0/2)# switchport
DeviceB(config-if-GigabitEthernet 0/2)# switchport mode trunk
DeviceB(config-if-GigabitEthernet 0/2)# spanning-tree mst 0 cost 1
DeviceB(config-if-GigabitEthernet 0/2)# spanning-tree mst 1 cost 1
DeviceB(config-if-GigabitEthernet 0/2)# exit
# 配置GigabitEthernet 0/1为Trunk口。在实例0和1中,配置端口路径开销为4。
DeviceB(config)# interface range gigabitethernet 0/1
DeviceB(config-if-GigabitEthernet 0/1)# switchport
DeviceB(config-if-GigabitEthernet 0/1)# switchport mode trunk
DeviceB(config-if-GigabitEthernet 0/1)# spanning-tree mst 0 cost 4
DeviceB(config-if-GigabitEthernet 0/1)# spanning-tree mst 1 cost 4
DeviceB(config-if-GigabitEthernet 0/1)# exit
# 全局开启生成树功能。
DeviceB(config)# spanning-tree
DeviceB(config)# end
DeviceB# write
(3) 配置Device C。
# 创建VLAN,配置实例映射。
DeviceC> enable
DeviceC# configure terminal
DeviceC(config)# vlan range 10,20,30,40
DeviceC(config-vlan-range)# exit
DeviceC(config)# spanning-tree mst configuration
DeviceC(config-mst)# instance 1 vlan 10,30
DeviceC(config-mst)# instance 2 vlan 20,40
DeviceC(config-mst)# exit
# 配置上联口GigabitEthernet 0/1为Trunk口。在实例0和1中配置端口路径开销为1,在实例2中配置端口路径开销为4。配置端口环路保护。
DeviceC(config)# interface gigabitethernet 0/1
DeviceC(config-if-GigabitEthernet 0/1)# switchport
DeviceC(config-if-GigabitEthernet 0/1)# switchport mode trunk
DeviceC(config-if-GigabitEthernet 0/1)# spanning-tree mst 0 cost 1
DeviceC(config-if-GigabitEthernet 0/1)# spanning-tree mst 1 cost 1
DeviceC(config-if-GigabitEthernet 0/1)# spanning-tree mst 2 cost 4
DeviceC(config-if-GigabitEthernet 0/1)# spanning-tree guard loop
DeviceC(config-if-GigabitEthernet 0/1)# exit
# 配置上联口GigabitEthernet 0/2为Trunk口。在实例2中配置端口路径开销为1,在实例0和1中配置端口路径开销为4。配置端口环路保护。
DeviceC(config)# interface gigabitethernet 0/2
DeviceC(config-if-GigabitEthernet 0/2)# switchport
DeviceC(config-if-GigabitEthernet 0/2)# switchport mode trunk
DeviceC(config-if-GigabitEthernet 0/2)# spanning-tree mst 0 cost 4
DeviceC(config-if-GigabitEthernet 0/2)# spanning-tree mst 1 cost 4
DeviceC(config-if-GigabitEthernet 0/2)# spanning-tree mst 2 cost 1
DeviceC(config-if-GigabitEthernet 0/2)# spanning-tree guard loop
DeviceC(config-if-GigabitEthernet 0/2)# exit
# 配置下联口GigabitEthernet 0/3~0/6加入指定VLAN。配置接口为边缘端口,配置BPDU保护功能。
DeviceC(config)# interface gigabitethernet 0/3
DeviceC(config-if-GigabitEthernet 0/3)# switchport
DeviceC(config-if-GigabitEthernet 0/3)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/3)# switchport access vlan 10
DeviceC(config-if-GigabitEthernet 0/3)# spanning-tree autoedge disabled
DeviceC(config-if-GigabitEthernet 0/3)# spanning-tree portfast
DeviceC(config-if-GigabitEthernet 0/3)# spanning-tree bpduguard enable
DeviceC(config-if-GigabitEthernet 0/3)# exit
DeviceC(config)# interface gigabitethernet 0/4
DeviceC(config-if-GigabitEthernet 0/4)# switchport
DeviceC(config-if-GigabitEthernet 0/4)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/4)# switchport access vlan 20
DeviceC(config-if-GigabitEthernet 0/4)# spanning-tree autoedge disabled
DeviceC(config-if-GigabitEthernet 0/4)# spanning-tree portfast
DeviceC(config-if-GigabitEthernet 0/4)# spanning-tree bpduguard enable
DeviceC(config-if-GigabitEthernet 0/4)# exit
DeviceC(config)# interface gigabitethernet 0/5
DeviceC(config-if-GigabitEthernet 0/5)# switchport
DeviceC(config-if-GigabitEthernet 0/5)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/5)# switchport access vlan 30
DeviceC(config-if-GigabitEthernet 0/5)# spanning-tree autoedge disabled
DeviceC(config-if-GigabitEthernet 0/5)# spanning-tree portfast
DeviceC(config-if-GigabitEthernet 0/5)# spanning-tree bpduguard enable
DeviceC(config-if-GigabitEthernet 0/5)# exit
DeviceC(config)# interface gigabitethernet 0/6
DeviceC(config-if-GigabitEthernet 0/6)# switchport
DeviceC(config-if-GigabitEthernet 0/6)# switchport mode access
DeviceC(config-if-GigabitEthernet 0/6)# switchport access vlan 40
DeviceC(config-if-GigabitEthernet 0/6)# spanning-tree autoedge disabled
DeviceC(config-if-GigabitEthernet 0/6)# spanning-tree portfast
DeviceC(config-if-GigabitEthernet 0/6)# spanning-tree bpduguard enable
DeviceC(config-if-GigabitEthernet 0/6)# exit
# 全局开启生成树功能。
DeviceC(config)# spanning-tree
DeviceC(config)# end
DeviceC# write
五、验证配置结果
(1) 查看各设备上的实例映射关系相同。
# 查看Device A上的实例映射关系。
DeviceA# show spanning-tree mst configuration
Multi spanning tree protocol : Enable
………………………………………
# 查看Device B上的实例映射关系。
DeviceB# show spanning-tree mst configuration
Multi spanning tree protocol : Enable
………………………………………
# 查看Device C上的实例映射关系。
DeviceC# show spanning-tree mst configuration
Multi spanning tree protocol : Enable
………………………………………
(2) 在Device A上查看实例生成树拓扑及端口转发状态。
# 在实例0和1中,Device A(0074.9cee.f49e)为的根。Device A的GigabitEthernet 0/1~0/2为指定端口
(Desg);端口均处于转发状态(FWD)。
DeviceA# show spanning-tree summary
Spanning tree enabled protocol mstp
MST 0 vlans map : 1-9, 11-19, 21-29, 31-39, 41-4094
………………………………………
(3) 在Device B上查看实例生成树拓扑及端口转发状态。
# 在实例0和1中,Device A(0074.9cee.f49e)为的根。Device B的GigabitEthernet 0/1的为根端口(Root),端口路径开销(Cost)为1;Device B的GigabitEthernet 0/2为指定端口(Desg),端口路径开销
为4;端口均处于转发状态(FWD)。
DeviceB# show spanning-tree summary
Spanning tree enabled protocol mstp
MST 0 vlans map : 1-9, 11-19, 21-29, 31-39, 41-4094
………………………………………
# 在实例2中,Device B(00d0.f8ee.8c1e)为的根。Device B的GigabitEthernet 0/1~0/2为指定端口(Desg);端口均处于转发状态(FWD)。
(4) 在Device C上查看实例生成树拓扑及端口转发状态。
# 在实例0和1中,Device A(0074.9cee.f49e)为的根。Device C的GigabitEthernet 0/1的为根端口(Root),端口路径开销(Cost)为1,端口处于转发状态(FWD)。Device C的GigabitEthernet 0/2为替换端口(Altn),端口路径开销为4,端口处于阻塞状态(BLK)。Device C的GigabitEthernet 0/3~0/6为边缘端口(OperEdge),端口均处于转发状态(FWD)。
DeviceC# show spanning-tree summary
Spanning tree enabled protocol mstp
MST 0 vlans map : 1-9, 11-19, 21-29, 31-39, 41-4094
………………………………………
# 在实例2中,Device B(00d0.f8ee.8c1e)为的根。Device C的GigabitEthernet 0/2的为根端口(Root),端口路径开销(Cost)为1,端口处于转发状态(FWD)。Device C的GigabitEthernet 0/1为替换端口(Altn),端口路径开销为4,端口处于阻塞状态(BLK)。Device C的GigabitEthernet 0/3~0/6为边缘端口(OperEdge),端口均处于转发状态(FWD)。
(5) 查看实例1中各设备的根(DesignatedRoot)、根端口(RootPort)和到根路径开销(RootCost)。实例0和2的查看方式类似,过程略。
# Device A为根,到根路径开销为0。
DeviceA# show spanning-tree mst 1
###### MST 1 vlans mapped : 10, 30
BridgeAddr : 0074.9cee.f49
………………………………………
# Device B通过根端口GigabitEthernet 0/2到根(4097.0074.9cee.f49e)的路径开销(RootCost)为1
DeviceB# show spanning-tree mst 1
###### MST 1 vlans mapped : 10, 30
BridgeAddr : 00d0.f8ee.8c1e
………………………………………
# Device C通过根端口GigabitEthernet 0/1到根(4097.0074.9cee.f49e)的路径开销(RootCost)为1。
DeviceC# show spanning-tree mst 1
###### MST 1 vlans mapped : 10, 30
BridgeAddr : 0074.9cee.53ca
………………………………………
(6) 查看Device C上联口GigabitEthernet 0/1~0/2的环路保护功能(PortGuardmode:Guard loop)处于开启状
态,如下以GigabitEthernet 0/1为例。
DeviceC# show spanning-tree interface gigabitethernet 0/1
PortAdminPortFast : Disabled
PortOperPortFast : Disabled
………………………………………
六、配置文件
●Device A的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-29, 31-39, 41-4094
instance 1 vlan 10, 30
instance 2 vlan 20, 40
!
spanning-tree mst 0 priority 4096
spanning-tree mst 1 priority 4096
spanning-tree mst 2 priority 8192
spanning-tree
!
sysmac 0074.9cee.f49e
!
vlan range 1,10,20,30,40
!
interface GigabitEthernet 0/1
switchport mode trunk
spanning-tree mst 2 cost 4
!
interface GigabitEthernet 0/2
switchport mode trunk
spanning-tree mst 2 cost 1
● Device B的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-29, 31-39, 41-4094
instance 1 vlan 10, 30
instance 2 vlan 20, 40
!
spanning-tree mst 0 priority 8192
spanning-tree mst 1 priority 8192
spanning-tree mst 2 priority 4096
spanning-tree
!
sysmac 00d0.f8ee.8c1e
!
vlan range 1,10,20,30,40
!
interface GigabitEthernet 0/1
switchport mode trunk
spanning-tree mst 1 cost 4
spanning-tree mst 0 cost 4
!
interface GigabitEthernet 0/2
switchport mode trunk
spanning-tree mst 1 cost 1
spanning-tree mst 0 cost 1
● Device C的配置文件
spanning-tree mst configuration
instance 0 vlan 1-9, 11-19, 21-29, 31-39, 41-4094
instance 1 vlan 10, 30
instance 2 vlan 20, 40
!
spanning-tree
!
sysmac 0074.9cee.53ca
!
vlan range 1,10,20,30,40
!
interface GigabitEthernet 0/1
switchport mode trunk
spanning-tree guard loop
spanning-tree mst 2 cost 4
spanning-tree mst 1 cost 1
spanning-tree mst 0 cost 1
!
interface GigabitEthernet 0/2
switchport mode trunk
spanning-tree guard loop
spanning-tree mst 2 cost 1
spanning-tree mst 1 cost 4
spanning-tree mst 0 cost 4
!
interface GigabitEthernet 0/3
switchport access vlan 10
spanning-tree bpduguard enable
spanning-tree portfast
spanning-tree autoedge disabled
!
interface GigabitEthernet 0/4
switchport access vlan 20
spanning-tree bpduguard enable
spanning-tree portfast
spanning-tree autoedge disabled
!
interface GigabitEthernet 0/5
switchport access vlan 30
spanning-tree bpduguard enable
spanning-tree portfast
spanning-tree autoedge disabled
!
interface GigabitEthernet 0/6
switchport access vlan 40
spanning-tree bpduguard enable
spanning-tree portfast
spanning-tree autoedge disabled
注:常见错误
● 当设备非根时,若未配置低于根且高于接入设备的桥优先级,在生成树计算中,非根核心设备和接入设备将通过比较MAC地址确认上游设备,可能导致计算结果不符合组网需求。
● 当设备非根时,若未配置端口路径开销,因为链路情况的不同,可能导致生成树计算结果不符合组网需求。
●将根保护功能配置在根端口、Master端口或替换端口,可能会错误地将端口阻塞。
一、组网需求
如下图,用户使用DHCPv6分配IPv6地址,并开启了DHCPv6 snooping功能,还需要防ND路由信息攻击和防ND地址解析攻击。
二、组网图

三、配置要点
● 开启ND Snooping功能。
● 配置接口的Trust属性。
● 开启仅ND防地址解析攻击特性
四、配置步骤
Device> enable
Device# configure terminal
Device(config)# ipv6 nd snooping enable
Device(config)# interface gigabitethernet 0/1
Device(config-if-GigabitEthernet 0/1)# ipv6 nd snooping trust
Device(config-if-GigabitEthernet 0/1)# exit
Device(config)# interface gigabitethernet 0/2
Device(config-if-GigabitEthernet 0/2)# ipv6 nd snooping check address-resolution
Device(config-if-GigabitEthernet 0/2)# exit
Device(config)# interface gigabitethernet 0/3
Device(config-if-GigabitEthernet 0/3)# ipv6 nd snooping check address-resolution
五、配置文件
hostname Device
!
ipv6 nd snooping enable
!
interface GigabitEthernet 0/1
ipv6 nd snooping trust
!
interface GigabitEthernet 0/2
ipv6 nd snooping check address-resolution
!
interface GigabitEthernet 0/3
ipv6 nd snooping check address-resolution
!
end
一、组网需求
如下图,DHCPv6客户端用户可以通过合法DHCPv6服务器动态获取IPv6地址。
二、组网图

三、配置要点
● 在接入设备Device上开启DHCPv6 Snooping功能。
● 将上连口GigabitEthernet 0/1设置为TRUST口。
四、配置步骤
#配置Device。
Device> enable
Device# configure terminal
Device(config)# ipv6 dhcp snooping
Device(config)# interface gigabitethernet 0/1
Device(config-if-GigabitEthernet 0/1)# ipv6 dhcp snooping trust
五、 验证配置结果
# 查看Device的DHCPv6 Snooping配置情况,关注点为TRUST口是否正确。
Device# show ipv6 dhcp snooping
DHCPv6 snooping status : ENABLE
DHCPv6 snooping database write-delay time : 0 seconds
DHCPv6 snooping binding-delay time : 0 seconds
DHCPv6 snooping option18/37 status : DISABLE
DHCPv6 snooping link detection : DISABLE
Interface Trusted Filter DHCPv6
———————— ——- ————-
GigabitEthernet 0/1 YES DISABLE
# 查看Device生成的表项信息。
Device# show ipv6 dhcp snooping binding
Total number of bindings: 1
NO. MAC Address IPv6 Address Lease(sec) VLAN Interface
1 00d0.f801.0101 2001::10 42368 2
GigabitEthernet 0/1
六、配置文件
●Device的配置文件
hostname Device
!
ipv6 dhcp snooping
!
interface GigabitEthernet 0/1
ipv6 dhcp snooping trust
!
end
注:常见错误
●没有将上连口设置为DHCPv6 TRUST口。
●在上连口上配置了其他的接入安全选项,导致配置DHCPv6 TRUST口失败。