---
title: VLAN
slug: enterprise-v6p1/ybiV-vlan
createdAt: 2025-12-18T08:23:36.642Z
---

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

:::hint{type="warning"}
**NOTE:**
For VLANIF(SVI) related example, please refer to Module AsterNOS-Interface.
:::

## <font color="#1d50a2">Create Vlan</font>

Request example to create vlan via **edit-config**.

```xml
<config><top>
  <vlans>
    <vlan operation="create">
      <vlanid>300</vlanid>
    </vlan>
  </vlans>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f20f182e-f568-49d0-ad82-aaac24244f74">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Vlan</font>

Request example to delete vlan via **edit-config**.

:::hint{type="warning"}
**NOTE:**
When user delete vlan, all members under this vlan will be deleted.
:::

```xml
<config><top>
  <vlans>
    <vlan operation="delete">
      <vlanid>100</vlanid>
    </vlan>
  </vlans>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f20f182e-f568-49d0-ad82-aaac24244f74">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Create Vlan Member</font>

Request example to create vlan member via **edit-config**.

```xml
<config><top>
  <interfaces>
    <interface>
      <name>Ethernet1</name>
      <vlan-config operation="create">
        <vlan>
          <vlan-id>1000</vlan-id>
          <tagging-mode>untagged</tagging-mode>
        </vlan>
      </vlan-config>
    </interface>
  </interfaces>
  <interfaces>
    <interface>
      <name>Ethernet2</name>
      <vlan-config operation="create">
        <vlan>
          <vlan-id>1000</vlan-id>
          <tagging-mode>untagged</tagging-mode>
        </vlan>
      </vlan-config>
    </interface>
  </interfaces>
  <interfaces>
    <interface>
      <name>PortChannel0001</name>
      <vlan-config operation="create">
        <vlan>
          <vlan-id>1000</vlan-id>
          <tagging-mode>tagged</tagging-mode>
        </vlan>
      </vlan-config>
    </interface>
  </interfaces>
</top></config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f20f182e-f568-49d0-ad82-aaac24244f74">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Vlan Member</font>

Request example to delete vlan member via **edit-config**.

```xml
<config><top>
  <interfaces>
    <interface>
      <name>Ethernet1</name>
      <vlan-config operation="delete">
        <vlan>
          <vlan-id>1000</vlan-id>
        </vlan>
      </vlan-config>
    </interface>
  </interfaces>
</top></config>
```

## <font color="#1d50a2">Get Vlan on Device</font>

Request example to get vlan via **get-config**.

```xml
<filter type="subtree">
  <top>
    <vlans>
      <vlan>
        <vlanid>100</vlanid>
      </vlan>
    </vlans>
  </filter>
```

Response example

```xml
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <top>
    <vlans>
      <vlan>
        <vlanid>100</vlanid>
        <mac-limit>10000</mac-limit>
        <description>this is a test1</description>
        <broadcast-action>flood</broadcast-action>
        <unknown-unicast-action>flood</unknown-unicast-action>
        <unknown-multicast-action>drop</unknown-multicast-action>
      </vlan>
    </vlans>
  </top>
</data>
```

## <font color="#1d50a2">Create Vlan Group</font>

Request example to create vlan group via rpc **config-vlan-group**.

:::hint{type="warning"}
**NOTE:**
Use rpc to create or merge vlan group.
:::

```xml
<config-vlan-group xmlns="http://asterfusion.com/ns/yang/asternos-vlan">
  <vlan-ranges>400-410</vlan-ranges>
  <description>batch by netconf rpc</description>
  <mac-limit>99</mac-limit>
  <mac-learning>true</mac-learning>
  <flapping-detect>true</flapping-detect>
  <flapping-action>error-down</flapping-action>
  <flapping-aging>1000</flapping-aging>
  <flapping-level>99</flapping-level>
  <unknown-unicast-action>drop</unknown-unicast-action>
  <unknown-multicast-action>flood</unknown-multicast-action>
  <broadcast-action>drop</broadcast-action>
  <stp-ignored>false</stp-ignored>
</config-vlan-group>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f20f182e-f568-49d0-ad82-aaac24244f74">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Vlan Group</font>

Request example to delete vlan group via rpc **delete-vlan-group**.

:::hint{type="warning"}
**NOTE:**
Use rpc to delete vlan group.
:::

```xml
<delete-vlan-group xmlns="http://asterfusion.com/ns/yang/asternos-vlan">
  <vlan-ranges>400-410</vlan-ranges>
</delete-vlan-group>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f20f182e-f568-49d0-ad82-aaac24244f74">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Switchports by Vlan Group</font>

Request example to delete switchports in vlan group via rpc **delete-vlan-group-switchports**.

:::hint{type="warning"}
**NOTE:**
Use rpc to delete switchports by vlan group.
:::

```xml
<delete-vlan-group-switchports xmlns="http://asterfusion.com/ns/yang/asternos-vlan">
  <vlan-ranges>400-410</vlan-ranges>
  <switchports>Ethernet1</switchports>
</delete-vlan-group-switchports>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f20f182e-f568-49d0-ad82-aaac24244f74">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Show Vlan Summary</font>

Request example to show vlan summary via rpc **show-vlan-summary**.

:::hint{type="warning"}
**NOTE:**
Use rpc to show Vlan summary of configuration and status.
:::

```xml
<show-vlan-summary/>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:43f30268-f755-4ea1-a9fc-cbf379960a6e">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-vlan">
+-----------+--------------+-----------+----------------+-------------+---------------+-----------------------+
|   VLAN ID | IP Address   | Ports     | Port Tagging   | Proxy ARP   | Description   | DHCP Helper Address   |
+===========+==============+===========+================+=============+===============+=======================+
|       100 |              | Ethernet1 | tagged         | disable     |               |                       |
|           |              | Ethernet2 | tagged         |             |               |                       |
+-----------+--------------+-----------+----------------+-------------+---------------+-----------------------+
|       102 |              |           |                | disable     |               |                       |
+-----------+--------------+-----------+----------------+-------------+---------------+-----------------------+
|       105 |              |           |                | disable     |               |                       |
+-----------+--------------+-----------+----------------+-------------+---------------+-----------------------+
|       123 |              |           |                | disable     |               |                       |
+-----------+--------------+-----------+----------------+-------------+---------------+-----------------------+
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Show Vlan Detail</font>

Request example to show vlan detail via rpc **show-vlan-detail**.

:::hint{type="warning"}
**NOTE:**
Use rpc to show vlan detail of the specified vlan id or all.
:::

```xml
<show-vlan-detail/>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:d1a23528-bd0e-4eca-af2f-5e8f019833c6">
  <data>
    VLAN ID: 100
    Router interface:
    Name: Vlan100
    Tagged ports: Ethernet1 Ethernet2
    Untagged ports:
    MAC-learning: enable
  </data>
  <data>VLAN ID: 102
    Router interface:
    Name: Vlan102
    Tagged ports:
    Untagged ports:
    MAC-learning: enable
  </data>
  <data>
    VLAN ID: 105
    Router interface:
    Name: Vlan105
    Tagged ports:
    Untagged ports:
    MAC-learning: enable
  </data>
  <data>
    VLAN ID: 123
    Router interface:
    Name: Vlan123
    Tagged ports:
    Untagged ports:
    MAC-learning: enable
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Show MAC Flapping Configuration</font>

Request example to show mac flapping configuration via rpc **show-mac-flapping-config**.

:::hint{type="warning"}
**NOTE:**
Use rpc to show MAC flapping configuration of the specified vlan or all.
:::

```xml
<show-mac-flapping-config/>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:838acb6c-ba6c-4f4e-80ff-ae995710cde2">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-vlan">
    <mac-flapping-config>
      <vlan-id>100</vlan-id>
      <flapping-detect>false</flapping-detect>
    </mac-flapping-config>
    <mac-flapping-config>
      <vlan-id>102</vlan-id>
      <flapping-detect>false</flapping-detect>
    </mac-flapping-config>
    <mac-flapping-config>
      <vlan-id>105</vlan-id>
      <flapping-detect>false</flapping-detect>
    </mac-flapping-config>
    <mac-flapping-config>
      <vlan-id>123</vlan-id>
      <flapping-detect>true</flapping-detect>
      <flapping-action>error-down</flapping-action>
      <flapping-aging>100</flapping-aging>
      <flapping-level>50</flapping-level>
    </mac-flapping-config>
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Show MAC Flapping Status</font>

Request example to show mac flapping status via rpc **show-mac-flapping-status**.

:::hint{type="warning"}
**NOTE:**
Use rpc to show MAC flapping status of the specified vlan or all.
:::

```xml
<show-mac-flapping-status>
  <vlan-id>999</vlan-id>
</show-mac-flapping-status>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:6f45e7e1-10aa-4aa6-a8a2-aa7beebebec6">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-vlan">
    <mac-flapping-status>
      <vlan-id>999</vlan-id>
      <mac-address>00:00:01:01:02:01</mac-address>
      <flapping-times>3</flapping-times>
      <last-update>Thu Jul 10 08:37:50 2025</last-update>
      <interface-status>No</interface-status>
    </mac-flapping-status>
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Clear MAC Flapping Status</font>

Request example to clear mac flapping status via rpc **clear-mac-flapping-status**.

:::hint{type="warning"}
**NOTE:**
Use rpc to Clear MAC flapping statistics of the specified vlan or all.
:::

###

```xml
<clear-mac-flapping-status/>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:08971595-f0fc-4452-997f-f148f01eaf4d">
  <result xmlns="http://asterfusion.com/ns/yang/asternos-vlan"/>
</rpc-reply>
```

