LLDP-Netconf
Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /lldp-global | Y | merge, replace, create, delete | — |
| /lldp-ports/{ifname} | Y | merge, replace, create, delete | — |
| /show-lldp-neighbor | — | — | Y |
| /show-lldp-ports-med-policy | — | — | Y |
| /show-lldp-table | — | — | Y |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage LLDP configurations on AsterNOS devices.
Enable LLDP Feature
Section titled “Enable LLDP Feature”Request example to enable LLDP feature via edit-config.
<config> <top> <features-control> <feature> <name>lldp</name> <admin-state>enable</admin-state> </feature> </features-control> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:896cbad2-1c10-4f65-9322-c0fbb476862f"> <ok/></rpc-reply>Disable LLDP Feature
Section titled “Disable LLDP Feature”Request example to disable LLDP feature via edit-config.
<config> <top> <features-control> <feature> <name>lldp</name> <admin-state>disable</admin-state> </feature> </features-control> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:11fca4cd-e30e-48b8-8e6d-074eacd4c627"> <ok/></rpc-reply>Edit Lldp Global Config
Section titled “Edit Lldp Global Config”Request example to edit LLDP global configuration via edit-config.
<config> <top> <lldp-global operation="merge"> <global-portid-subtype>macaddress</global-portid-subtype> <management-address>1.1.1.1</management-address> <dot3-power>true</dot3-power> <med-power>true</med-power> </lldp-global> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0271eb61-d524-452d-a17f-e534ce223b3e"> <ok/></rpc-reply>Replace Lldp Global Config
Section titled “Replace Lldp Global Config”Request example to replace LLDP global configuration via edit-config.
<config> <top> <lldp-global operation="replace"> <global-portid-subtype>ifname</global-portid-subtype> </lldp-global> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c90cb00b-27e6-4ba3-9c8a-011b83feff44"> <ok/></rpc-reply>Get LLDP Global Config
Section titled “Get LLDP Global Config”Request example to get LLDP global configuration via get-config with subtree filter.
<filter type="subtree"> <top> <lldp-global/> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a7600ade-aa6e-4ccd-9fd5-0b2d7ba95d27"> <data> <top> <lldp-global xmlns="http://asterfusion.com/ns/yang/asternos-lldp"> <global-portid-subtype>macaddress</global-portid-subtype> <management-address>1.1.1.1</management-address> <dot3-power>true</dot3-power> <med-power>true</med-power> </lldp-global> </top> </data></rpc-reply>Delete LLDP Global Config
Section titled “Delete LLDP Global Config”Request example to delete LLDP global configuration via edit-config.
<config> <top> <lldp-global operation="delete"/> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e1396839-b3f9-4dcf-bd34-7231175454f4"> <ok/></rpc-reply>Create LLDP Entry for Interface
Section titled “Create LLDP Entry for Interface”Request example to create LLDP entry for interface via edit-config.
<config> <top> <lldp-ports> <lldp-port operation="create"> <ifname>Ethernet1</ifname> <priority>5</priority> <dscp>20</dscp> <vid>20</vid> <vlan-type>untagged</vlan-type> <status>rx-only</status> </lldp-port> </lldp-ports> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:2b57f3ed-1e8d-498c-8eb8-733b42539ef7"> <ok/></rpc-reply>Modify LLDP Entry for Interface
Section titled “Modify LLDP Entry for Interface”Request example to modify specific LLDP entry for interface via edit-config with merge operation.
<config> <top> <lldp-ports> <lldp-port operation="merge"> <ifname>Ethernet1</ifname> <priority>3</priority> <dscp>30</dscp> <vid>30</vid> <vlan-type>tagged</vlan-type> <status>rx-and-tx</status> </lldp-port> </lldp-ports> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0124f8c1-f4ad-4036-8f2c-9ef607245e2d"> <ok/></rpc-reply>Get LLDP Entry for Interface
Section titled “Get LLDP Entry for Interface”Request example to get specific LLDP entry for interface via get-config with subtree filter.
<filter type="subtree"> <top> <lldp-ports> <lldp-port> <ifname>Ethernet1</ifname> </lldp-port> </lldp-ports> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:2fc01cdd-9881-4c07-8e4c-56cec7e55f39"> <data> <top> <lldp-ports xmlns="http://asterfusion.com/ns/yang/asternos-lldp"> <lldp-port> <ifname>Ethernet1</ifname> <status>rx-and-tx</status> <vid>30</vid> <vlan-type>tagged</vlan-type> <priority>3</priority> <dscp>30</dscp> </lldp-port> </lldp-ports> </top> </data></rpc-reply>Get LLDP Status for Interface
Section titled “Get LLDP Status for Interface”Request example to get specific LLDP entry for interface via get with subtree filter.
<filter type="subtree"> <top> <lldp-ports> <lldp-port> <ifname>Ethernet1</ifname> </lldp-port> </lldp-ports> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:cc5c1355-0d27-411c-aab1-48c732af1294"> <data> <top> <lldp-ports xmlns="http://asterfusion.com/ns/yang/asternos-lldp"> <lldp-port> <ifname>Ethernet1</ifname> <status>rx-and-tx</status> <vid>30</vid> <vlan-type>tagged</vlan-type> <priority>3</priority> <dscp>30</dscp> <port-status>rx-and-tx</port-status> </lldp-port> </lldp-ports> </top> </data></rpc-reply>Delete LLDP Entry for Interface
Section titled “Delete LLDP Entry for Interface”Request example to delete specific LLDP entry for interface via edit-config.
<config> <top> <lldp-ports> <lldp-port operation="delete"> <ifname>Ethernet1</ifname> </lldp-port> </lldp-ports> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:8d6f4e2c-1a2b-3c4d-5e6f-7a8b9c0d1e2f"> <ok/></rpc-reply>Show LLDP Table
Section titled “Show LLDP Table”Request example to show LLDP table via rpc show-lldp-table.
<show-lldp-table/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:680ce60c-a289-4344-a8a1-61e1753174b5"> <data xmlns="http://asterfusion.com/ns/yang/asternos-lldp"> Capability codes: (R) Router, (B) Bridge, (O) Other LocalPort RemoteDevice RemotePortID Capability RemotePortDescr ----------- -------------- -------------- ------------ ----------------- Ethernet29 sonic Ethernet37 BR Y37 eth0 Dev-Leaf-4 Ethernet27 BR Ethernet27 -------------------------------------------------- Total entries displayed: 2 </data></rpc-reply>Show LLDP Neighbors
Section titled “Show LLDP Neighbors”Request example to show LLDP neighbors via rpc show-lldp-neighbors.
<show-lldp-neighbor/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:cbde15fb-9bcb-4a90-8253-4c0e8cc0773f"> <data xmlns="http://asterfusion.com/ns/yang/asternos-lldp"> ------------------------------------------------------------------------------- LLDP neighbors: ------------------------------------------------------------------------------- Interface: eth0, via: LLDP, RID: 1, Time: 0 day, 02:33:41 Chassis: ChassisID: local 60:eb:5a:01:02:a4 SysName: Dev-Leaf-4 SysDescr: db98dx3530_52cd Debian GNU/Linux 9 (stretch) 5.10.34-103 aarch64 MgmtIP: 172.18.0.1 MgmtIface: 10 MgmtIP: fc00::62eb:ffc:ac10:10b MgmtIface: 15 Capability: Bridge, on Capability: Router, on Port: PortID: ifname Ethernet27 PortDescr: Ethernet27 TTL: 8 MFS: 9216 PMD autoneg: supported: no, enabled: no MAU oper type: 10BaseTFD - UTP MAU, full duplex mode VLAN: 802, pvid: yes vlan802 VLAN: 4094, pvid: no vlan4094 ------------------------------------------------------------------------------- Interface: Ethernet29, via: LLDP, RID: 2, Time: 0 day, 02:33:41 Chassis: ChassisID: local 60:eb:5a:01:12:f2 SysName: sonic SysDescr: SONiC Software Version: SONiC.V6.1R004T006 - HwSku: CX308P-48Y-M - Distribution: Debian 12.12 - Kernel: 6.1.0-22-2-amd64 MgmtIP: 192.168.15.167 MgmtIface: 2 Capability: Bridge, on Capability: Router, on Capability: Wlan, off Capability: Station, off Port: PortID: ifname Ethernet37 PortDescr: Y37 TTL: 8 PMD autoneg: supported: no, enabled: no MAU oper type: 10BaseTFD - UTP MAU, full duplex mode ------------------------------------------------------------------------------- </data></rpc-reply>Show LLDP Ports Med Policy
Section titled “Show LLDP Ports Med Policy”Request example to show LLDP ports med policy via rpc show-lldp-ports-med-policy.
<show-lldp-ports-med-policy/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:19401514-72f0-4834-a666-4eef10cd7ff0"> <data xmlns="http://asterfusion.com/ns/yang/asternos-lldp"> +-----------+---------------+--------+----------+------------+--------+ | Ports | application | vlan | tagged | priority | dscp | +===========+===============+========+==========+============+========+ | Ethernet1 | voice | 30 | tagged | 3 | 30 | +-----------+---------------+--------+----------+------------+--------+ </data></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”LLDP global parameters
Section titled “LLDP global parameters”Tree Diagram
module: asternos-lldp +--rw lldp-global +--rw global-portid-subtype? enumeration +--rw management-address? management-ip +--rw dot3-power? boolean +--rw med-power? booleanTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| lldp-global | M | Path-only node, has no configurable value. LLDP global parameters. | |
| global-portid-subtype | O | ”ifname" "macaddress” | Type of portid. Default value: macaddress |
| management-address | O | The ipv4-address type represents an IPv4 address in dotted-quad notation. The IPv4 address may include a zone index, separated by a % sign. If a system uses zone names that are not represented in UTF-8, then an implementation needs to use some mechanism to transform the local name into UTF-8. The definition of such a mechanism is outside the scope of this document. The zone index is used to disambiguate identical address values. For link-local addresses, the zone index will typically be the interface index number or the name of an interface. If the zone index is not present, the default zone of the device will be used. The canonical format for the zone index is the numerical format The ipv6-address type represents an IPv6 address in full, mixed, shortened, and shortened-mixed notation. The IPv6 address may include a zone index, separated by a % sign. If a system uses zone names that are not represented in UTF-8, then an implementation needs to use some mechanism to transform the local name into UTF-8. The definition of such a mechanism is outside the scope of this document. The zone index is used to disambiguate identical address values. For link-local addresses, the zone index will typically be the interface index number or the name of an interface. If the zone index is not present, the default zone of the device will be used. The canonical format of IPv6 addresses uses the textual representation defined in Section 4 of RFC 5952. The canonical format for the zone index is the numerical format as described in Section 11.2 of RFC 4007. | LLDP management address configuration. |
| dot3-power | O | ”true" "false” | lldp management dot3 power configuration. Default value: False |
| med-power | O | ”true" "false” | lldp management med power configuration. Default value: False |
LLDP port MED policy configuration
Section titled “LLDP port MED policy configuration”Tree Diagram
module: asternos-lldp +--rw lldp-ports +--rw lldp-port* [ifname] +--rw ifname cmn:ethernet-port-name +--rw status? enumeration +--rw vid? uint32 +--rw vlan-type? enumeration +--rw priority? uint32 +--rw dscp? uint32 +--ro port-status? enumerationTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| lldp-ports | M | Path-only node, has no configurable value. LLDP port MED policy configuration. | |
| lldp-port | M | Path-only node, has no configurable value. The list of port on the device. | |
| ifname | O | cmn:ethernet-port-name | Port name of current port. |
| status | O | ”tx-only" "rx-only" "rx-and-tx" "disabled” | Administrative status of the local LLDP agent. Default value: rx-and-tx |
| vid | O | 1..4094 | VLAN ID to advertise. |
| vlan-type | O | ”tagged" "untagged” | Set tagged/untagged flag. Default value: untagged |
| priority | O | 0..7 | MED policy priority. Default value: 0 |
| dscp | O | 0..63 | DSCP value to advertise. Default value: 0 |
| port-status | RO | ”tx-only" "rx-only" "rx-and-tx" "disabled” | Administrative status of the local LLDP agent. Default value: rx-and-tx |
Show Lldp Neighbor
Section titled “Show Lldp Neighbor”Tree Diagram
module: asternos-lldp
rpcs: +---x show-lldp-neighbor +---w input | +---w port? cmn:ethernet-port-name +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-neighbor | O | ||
| port | O | cmn:ethernet-port-name | The name of the port. |
| data | O | Show LLDP neighbor summary or specified port information. |
Show Lldp Ports Med Policy
Section titled “Show Lldp Ports Med Policy”Tree Diagram
module: asternos-lldp
rpcs: +---x show-lldp-ports-med-policy +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-ports-med-policy | O | ||
| data | O | Show LLDP ports med pollicy configuration. |
Show Lldp Table
Section titled “Show Lldp Table”Tree Diagram
module: asternos-lldp
rpcs: +---x show-lldp-table +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-table | O | ||
| data | O | Show LLDP neighbors in tabular format. |