Loopback Detection管理
本章节介绍Loopback Detection管理的配置模型,以及配置的XML报文举例说明。
数据模型
Loopback Detection管理的对应配置模型文件名为huawei-loopback-detect.yang。
节点 |
说明 |
取值范围 |
备注 |
---|---|---|---|
/hw-loopback-detect:loopback-detect/hw-loopback-detect:auto-detection/hw-loopback-detect:enabled |
LBDT自动检测环路功能的使能状态。 |
布尔型:
|
NA |
/hw-loopback-detect:loopback-detect/hw-loopback-detect:auto-detection/hw-loopback-detect:action |
MAC漂移触发LBDT自动环路检测功能检测到漂移VLAN中存在环路的处理动作。 |
枚举值类型:
|
当前仅支持alarm和quitvlan两种取值。 |
/hw-loopback-detect:loopback-detect/hw-loopback-detect:transmit-interval-time |
接口环回检测报文发送周期。 |
整数形式,取值范围为1~300,单位为秒。缺省情况下,接口环回检测报文发送周期为5秒。 |
NA |
/hw-loopback-detect:loopback-detect/hw-loopback-detect:untagged-packet-mac-address |
Loopback Detection untagged检测报文的目的MAC。 |
格式为HH:HH:HH:HH:HH:HH,其中H为1位十六进制数。 缺省情况下,Loopback Detection untagged检测报文的目的MAC为0180-C200-000A。 |
只能配置为组播MAC地址或者广播MAC地址。 |
/if:interfaces/if:interface/hw-loopback-detect:augment/hw-loopback-detect:loopback-detect/hw-loopback-detect:enabled |
接口环回检测功能的使能状态。 |
布尔型:
|
NA |
/if:interfaces/if:interface/hw-loopback-detect:augment/hw-loopback-detect:loopback-detect/hw-loopback-detect:action |
接口的环回检测处理动作。 |
布尔型:
|
仅当//if:interfaces/if:interface/hw-loopback-detect:augment/hw-loopback-detect:loopback-detect/hw-loopback-detect:enabled节点配置为true时,才可配置此节点。 |
/if:interfaces/if:interface/hw-loopback-detect:augment/hw-loopback-detect:loopback-detect/hw-loopback-detect:detect-vlans/hw-loopback-detect:vlan-id |
进行环回检测的VLAN编号。 |
整数形式,取值范围是1~4094。 |
每个接口下最多可配置对8个VLAN进行环回检测。 |
/if:interfaces/if:interface/hw-loopback-detect:augment/hw-loopback-detect:loopback-detect/hw-loopback-detect:recovery-time |
检测到环回后接口自动恢复成正常状态的时间。 |
整数形式,取值范围为1~1000,单位为秒。缺省情况下,检测到环回后接口的恢复时间为检测周期的三倍。 |
NA |
配置Loopback Detection
本章节主要介绍通过edit-config方法配置Loopback Detection。
操作 |
XPATH |
---|---|
edit-config |
/huawei-loopback-detect:loopback-detect /ietf:interfaces/ietf:interface/huawei-loopback-detect:loopback-detect |
数据需求
项目 |
数据 |
描述 |
---|---|---|
LBDT自动检测环路功能的使能状态 |
false |
去使能LBDT自动检测环路功能。 |
MAC漂移触发LBDT自动环路检测功能检测到漂移VLAN中存在环路的处理动作 |
quitvlan |
接口检测到漂移VLAN中存在环路时退VLAN。 |
接口环回检测报文发送周期 |
300 |
接口环回检测报文发送周期为300秒。 |
Loopback Detection untagged检测报文的目的MAC |
ff:ff:ff:ff:ff:ff |
Loopback Detection untagged检测报文的目的MAC为ff:ff:ff:ff:ff:ff。 |
接口环回检测功能的使能状态 |
true |
使能接口环回检测功能。 |
接口的环回检测处理动作 |
nolearn |
接口检测到环路时禁止接口进行MAC地址学习。 |
进行环回检测的VLAN编号 |
5 |
进行环回检测的VLAN编号为5。 |
检测到环回后接口自动恢复成正常状态的时间 |
1000 |
检测到环回后接口自动恢复成正常状态的时间为1000秒。 |
请求示例
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <edit-config> <target> <running/> </target> <config> <hw-loopback-detect:loopback-detect nc:operation="merge" xmlns:hw-loopback-detect="urn:huawei:yang:huawei-loopback-detect" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <hw-loopback-detect:transmit-interval-time>300</hw-loopback-detect:transmit-interval-time> <hw-loopback-detect:untagged-packet-mac-address>ff:ff:ff:ff:ff:ff</hw-loopback-detect:untagged-packet-mac-address> <hw-loopback-detect:auto-detection> <hw-loopback-detect:enabled>false</hw-loopback-detect:enabled> <hw-loopback-detect:action>quitvlan</hw-loopback-detect:action> </hw-loopback-detect:auto-detection> </hw-loopback-detect:loopback-detect> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" nc:operation="merge" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <if:interface nc:operation="merge"> <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> <hw-loopback-detect:loopback-detect nc:operation="merge" xmlns:hw-loopback-detect="urn:huawei:yang:huawei-loopback-detect"> <hw-loopback-detect:enabled nc:operation="merge">true</hw-loopback-detect:enabled> <hw-loopback-detect:action nc:operation="merge">nolearn</hw-loopback-detect:action> <hw-loopback-detect:recovery-time>1000</hw-loopback-detect:recovery-time> <hw-loopback-detect:detect-vlans> <hw-loopback-detect:vlan-id>5</hw-loopback-detect:vlan-id> </hw-loopback-detect:detect-vlans> </hw-loopback-detect:loopback-detect> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
删除示例
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <edit-config> <target> <running/> </target> <config> <hw-loopback-detect:loopback-detect nc:operation="remove" xmlns:hw-loopback-detect="urn:huawei:yang:huawei-loopback-detect" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <hw-loopback-detect:transmit-interval-time>300</hw-loopback-detect:transmit-interval-time> <hw-loopback-detect:untagged-packet-mac-address>ff:ff:ff:ff:ff:ff</hw-loopback-detect:untagged-packet-mac-address> <hw-loopback-detect:auto-detection> <hw-loopback-detect:enabled>false</hw-loopback-detect:enabled> <hw-loopback-detect:action>quitvlan</hw-loopback-detect:action> </hw-loopback-detect:auto-detection> </hw-loopback-detect:loopback-detect> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" nc:operation="merge" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <if:interface nc:operation="remove"> <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> <hw-loopback-detect:loopback-detect nc:operation="merge" xmlns:hw-loopback-detect="urn:huawei:yang:huawei-loopback-detect"> <hw-loopback-detect:enabled nc:operation="merge">true</hw-loopback-detect:enabled> <hw-loopback-detect:action nc:operation="merge">nolearn</hw-loopback-detect:action> <hw-loopback-detect:recovery-time>1000</hw-loopback-detect:recovery-time> <hw-loopback-detect:detect-vlans> <hw-loopback-detect:vlan-id>5</hw-loopback-detect:vlan-id> </hw-loopback-detect:detect-vlans> </hw-loopback-detect:loopback-detect> </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="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="1"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>VLAN list is full.</error-message> <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Eth-Trunk1"]/huawei-loopback-detect:loopback-detect/detect-vlans</error-info> </rpc-error> </rpc-reply>