STP管理
本章节介绍STP管理的配置模型,以及配置的XML报文举例说明。
数据模型
STP管理的对应配置模型文件名为huawei-stp.yang。
节点 |
说明 |
取值范围 |
备注 |
---|---|---|---|
/huawei-stp:stp/enable |
STP使能开关。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp/mode |
STP的模式。 |
枚举值类型:
|
NA |
/huawei-stp:stp/bpdu-protection |
BPDU保护。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp/edged-port-enable |
边缘端口。 |
枚举值类型:
|
NA |
/huawei-stp:stp/stp-priority/instance-id |
生成树实例编号。 |
整数形式,取值范围是0~4094。 |
NA |
/huawei-stp:stp/stp-priority/priority |
交换设备优先级。 |
整数形式,取值范围是0~61440。步长为4096,如0、4096、8192等。 |
NA |
/huawei-stp:stp/stp-mstp/process-list/processid |
MSTP进程。 |
整数形式,取值范围是1~31。 |
NA |
/huawei-stp:stp/stp-mstp/process-list/bpdu-protection |
进程下的BPDU保护。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp/stp-mstp/process-list/stp-priority/instance-id |
进程下的实例编号。 |
整数形式,取值范围是0~4094。 |
NA |
/huawei-stp:stp/stp-mstp/process-list/stp-priority/priority |
进程下的实例优先级。 |
整数形式,取值范围是0~61440。 |
NA |
/huawei-stp:stp/stp-mstp/process-list/mode |
进程下的STP模式。 |
枚举值类型:
|
NA |
/huawei-stp:stp/stp-mstp/process-list/enabled |
进程下的STP使能开关。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp/stp-mstp/process-list/tc-notify/tc-notify-process |
进程下的TC通告使能开关。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp/region-configuration/region-name |
MST域名。 |
字符串形式,长度范围是1~32。 |
NA |
/huawei-stp:stp/region-configuration /revision-level |
MST域修订级别。 |
整数形式,取值范围是0~65535。 |
NA |
/huawei-stp:stp/region-configuration/instance/instance-id |
MST域实例ID。 |
整数形式,取值范围是0~4094。 |
NA |
/huawei-stp:stp/region-configuration/instance/map-vlan |
MST域映射VLAN。 |
整数形式,取值范围是1~4094。 |
NA |
/huawei-stp:stp/auto-recovery/cause |
引起接口Error-down自恢复的原因。 |
枚举值类型:bpdu-protection |
NA |
/huawei-stp:stp/auto-recovery/interval |
自恢复时长。 |
整数形式,取值范围是30~86400 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/enable |
端口下STP使能开关。 |
布尔型,具体取值如下:
|
NA |
/ietf-interfaces:interface/huawei-stp:stp/edged-port-enable |
端口下边缘端口使能开关。 |
枚举值类型:
|
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-port-instance/ port-instance/instance-id |
端口下的实例ID。 |
整数形式,取值范围是0~4094。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-port-instance/port-instance/cost |
指定实例的端口cost值。 |
整数形式,取值范围是1~200000000。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-port-instance/port-instance/port-priority |
指定实例的端口优先级。 |
整数形式,取值范围是0~240。步长为16,如0、16、32等。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/process-mstp-id |
端口下的创建的进程编号。 |
整数形式,取值范围是1~31。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/instance-id |
端口下进程的实例ID。 |
整数形式,取值范围是0~4094。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/port-priority |
指定进程指定实例的端口优先级。 |
整数形式,取值范围是0~240。步长为16,如0、16、32等。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/cost |
指定进程的端口cost值。 |
整数形式,取值范围是1~200000000。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp-bind/process-list/process-id |
将端口加入到指定进程。 |
整数形式,取值范围是1~31。 |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp-bind/process-list/link-share-port |
端口下共享进程开关。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp-state-get/request-num |
指定一次查询到的生成树状态条目的最大值。 |
整数形式,取值范围是1~1024。若不指定此节点,则默认查询1024条。 |
NA |
/huawei-stp:stp-state-get/filter-condition/process-id |
指定MSTP进程ID。 |
整数形式,取值范围是0~256。查询VBST的状态信息时,默认是0。 |
NA |
/huawei-stp:stp-state-get/filter-condition/mstid-vlan-id |
指定生成树实例ID或VLAN ID。 |
整数形式,取值范围是0~4094。 |
NA |
/huawei-stp:stp-state-get/filter-condition/interface-name |
指定端口名称。 |
字符串形式,接口类型+接口编号,长度范围是1~63。 |
NA |
/huawei-stp:stp-state-get/get-next-request/last-process-id |
指定上一次查询生成树状态成功时的MSTP进程ID。 |
整数形式,取值范围是0~256。查看VBST的状态信息时,默认是0。 |
|
/huawei-stp:stp-state-get/get-next-request/last-mstid-vlan-id |
指定上一次查询生成树状态成功时的生成树实例ID或VLAN ID。 |
整数形式,取值范围是0~4094。 |
|
/huawei-stp:stp-state-get/get-next-request/last-interface-name |
指定上一次查询生成树状态成功时的端口名称。 |
字符串形式,接口类型+接口编号,长度范围是1~63。 |
|
/huawei-stp:stp-state-get/has-more |
是否还有更多的生成树状态信息未被查询到。 |
布尔型,具体取值如下:
|
NA |
/huawei-stp:stp-state-get/stp-state/process-id |
查询到的MSTP进程ID。 |
整数形式,取值范围是0~256。查看VBST的状态和统计信息时,默认是0。 |
NA |
/huawei-stp:stp-state-get/stp-state/mstid-vlan-id |
查询到的生成树实例ID或VLAN ID。 |
整数形式,取值范围是0~4094。 |
NA |
/huawei-stp:stp-state-get/stp-state/interface-name |
查询到的端口名称。 |
字符串形式,接口类型+接口编号,长度范围是1~63。 |
NA |
/huawei-stp:stp-state-get/stp-state/mode |
查询到的生成树模式。 |
枚举值类型:
|
NA |
/huawei-stp:stp-state-get/stp-state/role |
查询到的端口角色。 |
枚举值类型:
|
NA |
/huawei-stp:stp-state-get/stp-state/status |
查询到的端口状态。 |
枚举值类型:
|
NA |
/huawei-stp:stp-state-get/stp-state/protection |
查询到的端口保护类型。 |
枚举值类型:
|
NA |
查询STP状态
本章节主要介绍通过rpc方法查询STP的状态信息。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp-state-get |
数据需求
项目 |
数据 |
描述 |
---|---|---|
一次查询到的生成树状态条目的最大值 |
10 |
一次最多查询10条生成树状态信息。 |
MSTP进程ID |
0 |
- |
生成树实例ID |
0 |
- |
端口名称 |
XGigabitEthernet0/0/22 |
- |
请求示例
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<huawei-stp:stp-state-get xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp">
<huawei-stp:request-num>10</huawei-stp:request-num>
<huawei-stp:filter-condition>
<huawei-stp:process-id>0</huawei-stp:process-id>
<huawei-stp:mstid-vlan-id>0</huawei-stp:mstid-vlan-id>
<huawei-stp:interface-name>XGigabitEthernet0/0/22</huawei-stp:interface-name>
</huawei-stp:filter-condition>
</huawei-stp:stp-state-get>
</rpc>
响应示例
查询成功响应示例
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<stp-state-get xmlns="urn:huawei:params:xml:ns:yang:huawei-stp">
<has-more>false</has-more>
<stp-state>
<process-id>0</process-id>
<mstid-vlan-id>0</mstid-vlan-id>
<interface-name>XGigabitEthernet0/0/22</interface-name>
<mode>mstp</mode>
<role>designated</role>
<status>forwarding</status>
<protection>none</protection>
</stp-state>
</stp-state-get>
</rpc-reply>
查询失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-path>/huawei-stp:stp-state-get/filter-condition/process-id</error-path> <error-message>Value "257" does not satisfy the constraint "0..256" (range, length, or pattern).</error-message> </rpc-error> </rpc-reply>
配置STP模式
本章节主要介绍通过rpc方法配置STP模式。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/enable /huawei-stp:stp/mode |
数据需求
项目 |
数据 |
描述 |
---|---|---|
使能生成树功能 |
true |
使能生成树功能 |
配置生成树协议的模式 |
stp |
配置设备的生成树协议为STP模式 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:enabled>true</huawei-stp:enabled> <huawei-stp:mode>stp</huawei-stp:mode> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp</error-path> <error-message>parse rpc config error.(Unknown element "enabled".).</error-message> </rpc-error> </rpc-reply>
配置BPDU保护
本章节主要介绍通过rpc方法下发BPDU保护配置到设备。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/bpdu-protection |
数据需求
项目 |
数据 |
描述 |
---|---|---|
启动BPDU保护功能 |
true |
启动BPDU保护功能 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:bpdu-protection>true</huawei-stp:bpdu-protection> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/bpdu-protection</error-path> <error-message>parse rpc config error.(Invalid value "true1" in "bpdu-protection" element.).</error-message> </rpc-error> </rpc-reply>
配置边缘端口
本章节主要介绍通过rpc方法下发edged-port-enable配置到设备。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/edged-port-enable |
数据需求
项目 |
数据 |
描述 |
---|---|---|
配置边缘端口 |
true |
配置端口为边缘端口。 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:edged-port-enable>true</huawei-stp:edged-port-enable> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/edged-port-enable</error-path> <error-message>parse rpc config error.(Invalid value "true1" in "edged-port-enable" element.).</error-message> </rpc-error> </rpc-reply>
配置STP优先级
本章节主要介绍通过rpc方法下发stp-priority配置到设备。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/stp-priority |
数据需求
项目 |
数据 |
描述 |
---|---|---|
配置生成树实例的编号 |
1 |
指定生成树实例的编号为1。 |
配置设备在生成树中的优先级 |
4096 |
指定设备在生成树中的优先级为4096。 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:stp-priority> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:priority>4096</huawei-stp:priority> </huawei-stp:stp-priority> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/stp-priority</error-path> <error-message>parse rpc config error.(Unknown element "instance-id".).</error-message> </rpc-error> </rpc-reply>
基于MSTP进程视图配置
本章节主要介绍通过rpc方法下发基于MSTP进程视图的配置到设备。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/stp-mstp/process-list |
数据需求
项目 |
数据 |
描述 |
---|---|---|
配置MSTP的进程编号 |
1 |
MSTP进程ID为1。 |
MSTP进程使能BPDU保护 |
true |
MSTP进程使能BPDU保护。 |
MSTP进程中的实例编号 |
1 |
MSTP进程实例ID为1。 |
MSTP进程中的指定实例的优先级 |
0 |
MSTP进程1中实例1的优先级为0。 |
MSTP进程中使能生成树协议 |
true |
MSTP进程中使能生成树协议。 |
MSTP进程中的生成树协议模式 |
stp |
MSTP进程中的生成树协议模式为stp模式。 |
MSTP进程使能tc通告 |
true |
MSTP进程使能tc通告。 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:stp-mstp> <huawei-stp:process-list> <huawei-stp:process-id>1</huawei-stp:process-id> <huawei-stp:bpdu-protection>true</huawei-stp:bpdu-protection> <huawei-stp:stp-priority> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:priority>0</huawei-stp:priority> </huawei-stp:stp-priority> <huawei-stp:enabled>true</huawei-stp:enabled> <huawei-stp:mode>stp</huawei-stp:mode> <huawei-stp:tc-notify> <huawei-stp:tc-notify-process>true</huawei-stp:tc-notify-process> </huawei-stp:tc-notify> </huawei-stp:process-list> </huawei-stp:stp-mstp> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/stp-mstp/process-list</error-path> <error-message>parse rpc config error.(Unknown element "process-id".).</error-message> </rpc-error> </rpc-reply>
基于MST域配置
本章节主要介绍通过rpc方法下发MST域配置到设备。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/region-configuration |
数据需求
项目 |
数据 |
描述 |
---|---|---|
配置MST域名 |
11 |
MST域名为11。 |
配置MST域修订级别 |
1 |
MST域修订级别为1。 |
配置MST域的实例编号 |
1 |
MST域实例ID为1。 |
配置MST域的映射VLAN |
100 |
MST域映射VLAN 100。 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:region-configuration> <huawei-stp:region-name>11</huawei-stp:region-name> <huawei-stp:revision-level>1</huawei-stp:revision-level> <huawei-stp:instance> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:map-vlan>100</huawei-stp:map-vlan> </huawei-stp:instance> </huawei-stp:region-configuration> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp</error-path> <error-message>parse rpc config error.(Unknown element "region-configuration".).</error-message> </rpc-error> </rpc-reply>
auto-recovery配置
本章节主要介绍通过rpc方法下发自动恢复配置到设备。
操作 |
XPATH |
---|---|
rpc |
/huawei-stp:stp/auto-recovery |
数据需求
项目 |
数据 |
描述 |
---|---|---|
配置引起error-down自恢复的原因 |
bpdu-protection |
引起error-down自恢复的原因是BPDU保护。 |
配置自恢复时长 |
30 |
自恢复时长30秒。 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:auto-recovery> <huawei-stp:cause>bpdu-protection</huawei-stp:cause> <huawei-stp:interval>30</huawei-stp:interval> </huawei-stp:auto-recovery> </huawei-stp:stp> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>Wrong parameter.</error-message> <error-info>Error on node /huawei-stp:stp/auto-recovery</error-info> </rpc-error> </rpc-reply>
基于接口的stp配置
本章节主要介绍通过rpc方法下发基于接口的stp相关配置到设备。
操作 |
XPATH |
---|---|
rpc |
/ietf-interfaces:interfaces/interface/huawei-stp:stp |
数据需求
项目 |
数据 |
描述 |
---|---|---|
配置接口名称 |
Eth-Trunk1 |
接口名称为Eth-Trunk1。 |
接口下使能STP |
true |
接口下使能STP。 |
配置接口为边缘端口 |
true |
接口使能为边缘端口。 |
配置接口下的实例编号 |
1 |
接口下的实例ID为1。 |
配置接口下指定实例的开销值 |
1 |
接口实例开销为1。 |
配置指定实例的接口优先级 |
0 |
实例1的接口优先级为0。 |
配置接口下的进程编号 |
1 |
接口下的进程ID为1。 |
配置接口下指定进程的实例编号 |
1 |
接口下进程的实例ID为1。 |
配置指定进程指定实例的接口优先级 |
0 |
进程1的实例1的接口优先级为0。 |
配置接口下指定进程的开销值 |
1 |
接口下进程的开销为1。 |
配置接口下绑定的进程编号 |
1 |
接口下绑定的进程ID为1。 |
共享接口进程使能 |
true |
共享接口进程使能。 |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="11" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>Eth-Trunk1</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:enable>true</huawei-stp:enable> <huawei-stp:edged-port-enable>true</huawei-stp:edged-port-enable> <huawei-stp:stp-port-instance> <huawei-stp:port-instance> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:cost>1</huawei-stp:cost> <huawei-stp:port-priority>0</huawei-stp:port-priority> </huawei-stp:port-instance> </huawei-stp:stp-port-instance> <huawei-stp:port-protection>loop-mode</huawei-stp:port-protection> <huawei-stp:stp-mstp> <huawei-stp:stp-mstp-instance> <huawei-stp:process-mstp> <huawei-stp:process-mstp-id>1</huawei-stp:process-mstp-id> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:port-priority>0</huawei-stp:port-priority> <huawei-stp:cost>1</huawei-stp:cost> </huawei-stp:process-mstp> </huawei-stp:stp-mstp-instance> <huawei-stp:stp-mstp-bind> <huawei-stp:process-list> <huawei-stp:process-id>1</huawei-stp:process-id> <huawei-stp:link-share-port>true</huawei-stp:link-share-port> </huawei-stp:process-list> </huawei-stp:stp-mstp-bind> </huawei-stp:stp-mstp> </huawei-stp:stp> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
响应示例
配置成功响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="11"> <ok/> </rpc-reply>
配置失败响应示例
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="12"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/ietf-interfaces:interfaces/interface[name='Eth-Trunk1']/huawei-stp:stp/stp-mstp/stp-mstp-bind/process-list[processid='100000']/processid</error-path> <error-message>parse rpc config error.(Invalid value "100000" in "processid" element.).</error-message> </rpc-error> </rpc-reply>