DLDP管理
数据模型
DLDP的对应配置模型文件名为huawei-dldp.yang。
节点 |
说明 |
取值范围 |
备注 |
---|---|---|---|
/huawei-dldp:dldp/dldpSys/dldpEnable |
全局使能DLDP功能。 |
布尔型,具体取值如下:
缺省为:false。 |
NA |
/huawei-dldp:dldp/dldpSys/dldpAuthMode |
指定配置DLDP认证方式。 |
枚举值类型,取值如下:
|
此节点不支持枚举类型为dldpAuthHMAC-SHA256。 |
/huawei-dldp:dldp/dldpSys/dldpPasswords |
指定DLDP认证方式的密码。 |
字符串形式,取值范围是6~16个明文字符串(除问号和空格以外),区分大小写。密码至少包含小写字母、大写字母、数字、特殊字符这四种形式中的两种。 |
dldpAuthMode节点不为dldpAuthNone时可配置。 |
/huawei-dldp:dldp/dldpInterfaces/dldpInterface/ifName |
指定接口的类型和编号。 |
字符串形式,包括接口类型和接口号。 |
仅支持配置为二层物理接口。 |
/huawei-dldp:dldp/dldpInterfaces/dldpInterface/dldpEnable |
接口使能DLDP功能。 |
布尔型,具体取值如下:
|
NA |
配置DLDP
本章节主要介绍通过edit-config方法对DLDP进行配置。
操作 |
XPATH |
---|---|
edit-config |
/huawei-dldp:dldp |
数据需求
项目 |
数据 |
描述 |
---|---|---|
DLDP功能 |
true |
全局使能DLDP功能。 |
DLDP认证方式 |
dldpAuthMD5 |
DLDP认证方式为dldpAuthMD5。 |
DLDP认证方式密码 |
huawei@123 |
DLDP认证方式的密码为huawei@123。 |
接口名称和编号 |
GigabitEthernet0/0/1 |
创建GE0/0/1接口。 |
接口使能DLDP功能 |
true |
接口使能DLDP功能。 |
接口类型 |
iana-if-type:ethernetCsmacd |
配置接口类型。 |
请求示例
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <edit-config> <target> <running/> </target> <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <dldp:dldp xmlns:dldp="http://www.huawei.com/netconf/vrp/huawei-dldp"> <dldp:dldpSys nc:operation="merge"> <dldp:dldpEnable>true</dldp:dldpEnable> <dldp:dldpAuthMode>dldpAuthMD5</dldp:dldpAuthMode> <dldp:dldpPasswords>huawei@123</dldp:dldpPasswords> </dldp:dldpSys> <dldp:dldpInterfaces> <dldp:dldpInterface> <dldp:ifName>GigabitEthernet0/0/1</dldp:ifName> <dldp:dldpEnable>true</dldp:dldpEnable> </dldp:dldpInterface> </dldp:dldpInterfaces> </dldp:dldp> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface nc:operation="merge"> <if:name>GigabitEthernet0/0/1</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> </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="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="183"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>This interface does not support.</error-message> <error-info>Error on node /huawei-dldp:dldp/dldpInterfaces/dldpInterface[ifName="Eth-Trunk3"]</error-info> </rpc-error> </rpc-reply>