跳转到内容
Ask AI

LLDP-Netconf

此内容尚不支持你的语言。

YANG Pathget/get-configedit-configrpc
/lldp-globalYmerge, replace, create, delete—
/lldp-ports/{ifname}Ymerge, replace, create, delete—
/show-lldp-neighbor——Y
/show-lldp-ports-med-policy——Y
/show-lldp-table——Y

This chapter provides examples on how to use Netconf to manage LLDP configurations on AsterNOS devices.

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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? boolean

Table of Properties

NameRequiredType/RangeDescription
lldp-globalMPath-only node, has no configurable value.
LLDP global parameters.
global-portid-subtypeO”ifname"
"macaddress”
Type of portid.
Default value: macaddress
management-addressOThe 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-powerO”true"
"false”
lldp management dot3 power configuration.
Default value: False
med-powerO”true"
"false”
lldp management med power configuration.
Default value: False

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? enumeration

Table of Properties

NameRequiredType/RangeDescription
lldp-portsMPath-only node, has no configurable value.
LLDP port MED policy configuration.
lldp-portMPath-only node, has no configurable value.
The list of port on the device.
ifnameOcmn:ethernet-port-namePort name of current port.
statusO”tx-only"
"rx-only"
"rx-and-tx"
"disabled”
Administrative status of the local LLDP agent.
Default value: rx-and-tx
vidO1..4094VLAN ID to advertise.
vlan-typeO”tagged"
"untagged”
Set tagged/untagged flag.
Default value: untagged
priorityO0..7MED policy priority.
Default value: 0
dscpO0..63DSCP value to advertise.
Default value: 0
port-statusRO”tx-only"
"rx-only"
"rx-and-tx"
"disabled”
Administrative status of the local LLDP agent.
Default value: rx-and-tx

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

NameRequiredType/RangeDescription
show-lldp-neighborO
portOcmn:ethernet-port-nameThe name of the port.
dataOShow LLDP neighbor summary or specified port information.

Tree Diagram

module: asternos-lldp
rpcs:
+---x show-lldp-ports-med-policy
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-lldp-ports-med-policyO
dataOShow LLDP ports med pollicy configuration.

Tree Diagram

module: asternos-lldp
rpcs:
+---x show-lldp-table
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-lldp-tableO
dataOShow LLDP neighbors in tabular format.