---
title: L2PT
slug: enterprise-v6p1/FGZh-l2pt
createdAt: 2025-12-18T08:23:46.693Z
---

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

This chapter provides examples on how to use Netconf to manage Layer 2 Protocol Tunnel (L2PT) configurations on AsterNOS devices.

## <font color="#1d50a2">Create L2PT entry for Interface</font>

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

```xml
<config><top>
  <l2pts>
    <l2pt operation="create">
      <ifname>Ethernet1</ifname>
      <protocol-type>stp</protocol-type>
      <enable>true</enable>
    </l2pt>
  </l2pts>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:036830c9-afc0-4904-9d11-b02ebd51c138">
  <ok/>
</rpc-reply>
```

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

Request example to modify L2PT entry for interface via **edit-config**.

```xml
<config><top>
  <l2pts>
    <l2pt operation="merge">
      <ifname>Ethernet1</ifname>
      <protocol-type>stp</protocol-type>
      <enable>false</enable>
    </l2pt>
  </l2pts>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:42a9d7c5-0e19-491d-99a1-7c94369cd558">
  <ok/>
</rpc-reply>
```

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

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

```xml
<filter type="subtree">
  <top>
    <l2pts>
      <l2pt>
        <ifname>Ethernet1</ifname>
      </l2pt>
    </l2pts>
  </top>
</filter>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:797de41f-d313-4f94-8268-dd5990123f1d">
  <data>
    <top>
      <l2pts xmlns="http://asterfusion.com/ns/yang/asternos-l2pt">
        <l2pt>
          <ifname>Ethernet1</ifname>
          <protocol-type>stp</protocol-type>
          <enable>false</enable>
        </l2pt>
      </l2pts>
    </top>
  </data>
</rpc-reply>
```

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

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

```xml
<config><top>
  <l2pts>
    <l2pt operation="delete">
      <ifname>Ethernet1</ifname>
    </l2pt>
  </l2pts>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:09755838-8d10-4c48-be5e-c3888006b665">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Create L2 Protocol Packet Entry</font>

:::hint{type="warning"}
**NOTE:**
Manage the actions of Layer 2 protocol Packet.
:::

Request example to create L2 Protocol Packet entry via **edit-config**.

```xml
<config><top><interfaces>
<interface>
  <name>Ethernet1</name>
  <l2-protocol-control operation="create">
    <l2-protocol>
      <protocol-type>stp</protocol-type>
      <disable>true</disable>
    </l2-protocol>
    <l2-protocol>
      <protocol-type>lacp</protocol-type>
      <disable>true</disable>
    </l2-protocol>
  </l2-protocol-control>
</interface>
</interfaces></top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f0a6ff2a-686a-466d-8fe6-7285b5c3ee46">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify L2 Protocol Packet Entry</font>

Request example to modify specific L2 Protocol Packet entry via **edit-config** with merge operation.

```xml
<config><top><interfaces>
<interface>
  <name>Ethernet1</name>
  <l2-protocol-control operation="merge">
    <l2-protocol>
      <protocol-type>stp</protocol-type>
      <disable>false</disable>
    </l2-protocol>
  </l2-protocol-control>
</interface>
</interfaces></top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:fb358c67-c37f-4201-893f-f6acea6cc05b">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete L2 Protocol Packet Entry</font>

Request example to delete specific L2 Protocol Packet entry via **edit-config** with delete operation.

```xml
<config><top><interfaces>
<interface>
  <name>Ethernet1</name>
  <l2-protocol-control operation="delete">
  </l2-protocol-control>
</interface>
</interfaces></top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b728bb87-93df-4df5-bd5b-1f31542e8596">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get L2 Protocol Packet Entry</font>

Request example to get L2 Protocol Packet entry via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <interfaces>
      <interface>
        <name>Ethernet1</name>
        <l2-protocol-control>
        </l2-protocol-control>
      </interface>
    </interfaces>
  </top>
</filter>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:6222211c-8ba4-4d8c-a2d2-e3429a770be9">
  <data>
    <top>
      <interfaces xmlns="http://asterfusion.com/ns/yang/asternos-interfaces">
        <interface>
          <name>Ethernet1</name>
          <l2-protocol-control xmlns="http://asterfusion.com/ns/yang/asternos-ports">
            <l2-protocol>
              <protocol-type>stp</protocol-type>
              <disable>false</disable>
            </l2-protocol>
          </l2-protocol-control>
        </interface>
      </interfaces>
    </top>
  </data>
</rpc-reply>
```

