---
title: LLDP
slug: enterprise-v6p1/lldp
createdAt: 2025-12-18T08:23:45.309Z
---

# <font color="#1d50a2">AsterNOS-LLDP</font>

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

## <font color="#1d50a2">Enable LLDP Feature</font>

Request example to enable LLDP feature via **edit-config**.

```xml
<config><top>
  <lldp-global operation="create">
    <admin-status>true</admin-status>
  </lldp-global>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:088fc1fb-b534-42aa-b7d3-1ab408d6ffe6">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Disable LLDP Feature</font>

Request example to disable LLDP feature via **edit-config**.

```xml
<config><top>
  <lldp-global operation="merge">
    <admin-status>false</admin-status>
  </lldp-global>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:caf95cdc-e6fc-43ed-9682-5c5a6c50cd6c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Edit Lldp Global Config</font>

Request example to edit LLDP global configuration via **edit-config**.

```xml
<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>
      <admin-status>true</admin-status>
    </lldp-global>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:7f3e2f3a-2f4e-4d1b-8e2e-3c3f0b6e5f4a">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Replace Lldp Global Config</font>

Request example to replace LLDP global configuration via **edit-config**.

```xml
<config>
  <top>
    <lldp-global operation="replace">
      <global-portid-subtype>ifname</global-portid-subtype>
      <admin-status>true</admin-status>
    </lldp-global>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f8b9af10-0da7-4634-baad-ac27cd353c4a">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get LLDP Global Config</font>

Request example to get LLDP global configuration via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <lldp-global/>
  </top>
</filter>
```

Response example

```xml
<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>
        <admin-status>true</admin-status>
      </lldp-global>
    </top>
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Delete LLDP Global Config</font>

Request example to delete LLDP global configuration via **edit-config**.

```xml
<config>
  <top>
    <lldp-global operation="delete"/>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e1396839-b3f9-4dcf-bd34-7231175454f4">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Create LLDP Entry for Interface</font>

Request example to create LLDP entry for interface via **edit-config**.

```xml
<config>
  <top>
    <lldp-ports>
      <lldp-port operation="merge">
        <ifname>Ethernet1</ifname>
        <priority>5</priority>
        <dscp>20</dscp>
        <vid>20</vid>
        <vlan-type>untagged</vlan-type>
      </lldp-port>
    </lldp-ports>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f5c6e2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify LLDP Entry for Interface</font>

Request example to modify specific LLDP entry for interface via **edit-config** with merge operation.

```xml
<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>
      </lldp-port>
    </lldp-ports>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:59274d9a-6e2f-4b55-b27c-242d44aa231d">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get LLDP Entry for Interface</font>

Request example to get specific LLDP entry for interface via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <lldp-ports>
      <lldp-port>
        <ifname>Ethernet1</ifname>
      </lldp-port>
    </lldp-ports>
  </top>
</filter>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5fb8022a-e506-4357-9b2a-7a0a0712cbab">
  <data>
    <top>
      <lldp-ports xmlns="http://asterfusion.com/ns/yang/asternos-lldp">
        <lldp-port>
          <ifname>Ethernet1</ifname>
          <vid>30</vid>
          <vlan-type>tagged</vlan-type>
          <priority>3</priority>
          <dscp>30</dscp>
        </lldp-port>
      </lldp-ports>
    </top>
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Delete LLDP Entry for Interface</font>

Request example to delete specific LLDP entry for interface via **edit-config**.

```xml
<config>
  <top>
    <lldp-ports>
      <lldp-port operation="delete">
        <ifname>Ethernet1</ifname>
      </lldp-port>
    </lldp-ports>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:8d6f4e2c-1a2b-3c4d-5e6f-7a8b9c0d1e2f">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Show LLDP Table</font>

Request example to show LLDP table via rpc **show-lldp-table**.

```xml
<show-lldp-table/>
```

Response example

```xml
<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>
```

## <font color="#1d50a2">Show LLDP Neighbors</font>

Request example to show LLDP neighbors via rpc **show-lldp-neighbors**.

```xml
<show-lldp-neighbor/>
```

Response example

```xml
<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>
```

## <font color="#1d50a2">Show LLDP Ports Med Policy</font>

Request example to show LLDP ports med policy via rpc **show-lldp-ports-med-policy**.

```xml
<show-lldp-ports-med-policy/>
```

Response example

```xml
<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>
```

