---
title: Fdb
slug: enterprise-v6p1/fdb
createdAt: 2025-12-18T08:23:51.193Z
---

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

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

## <font color="#1d50a2">Get All Static FDB Entries</font>

:::hint{type="warning"}
**NOTE:**
Dynamic learned FDB entries cannot be retrieved via **get-config**.
To get dynamic learned FDB entries, please refer to rpc **show-mac-address**.
aging-time is 1800 seconds by default.
:::

Request example to get all static FDB entries via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <fdb/>
  </top>
</filter>
```

Response example

```xml
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <top>
    <fdb xmlns="http://asterfusion.com/ns/yang/asternos-fdb">
      <aging-time>300</aging-time>
      <fdb-entries>
        <fdb-entry>
          <mac-address>12:34:56:78:9a:bc</mac-address>
          <vlan-id>1000</vlan-id>
          <type>static</type>
          <port>Ethernet1</port>
        </fdb-entry>
        <fdb-entry>
          <mac-address>ee:ee:ee:ee:ee:ee</mac-address>
          <vlan-id>1001</vlan-id>
          <type>static</type>
          <blackhole>true</blackhole>
        </fdb-entry>
        <fdb-entry>
          <mac-address>cc:cc:cc:cc:cc:cc</mac-address>
          <vlan-id>1002</vlan-id>
          <type>static</type>
          <port>PortChannel0002</port>
        </fdb-entry>
      </fdb-entries>
    </fdb>
  </top>
</data>
```

## <font color="#1d50a2">Get All FDB Entries on device</font>

:::hint{type="warning"}
**NOTE:**
Both static and dynamic learned FDB entries will be retrieved.
:::

Request example to get all FDB entries via rpc **show-mac-address**

```xml
<show-mac-address>
  <interface-type>all</interface-type>
</show-mac-address>
```

Response example

```xml
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <fdb-entries>
    <fdb-entry>
      <mac-address>00:11:22:33:44:55</mac-address>
      <vlan-id>1000</vlan-id>
      <type>dynamic</type>
      <port>Ethernet1</port>
    </fdb-entry>
    <fdb-entry>
      <mac-address>66:77:88:99:aa:bb</mac-address>
      <vlan-id>1001</vlan-id>
      <type>dynamic</type>
      <port>Ethernet2</port>
    </fdb-entry>
    <fdb-entry>
      <mac-address>dd:dd:dd:dd:dd:dd</mac-address>
      <vlan-id>1002</vlan-id>
      <type>dynamic</type>
      <port>PortChannel0001</port>
    </fdb-entry>
  </fdb-entries>
</data>
```

## <font color="#1d50a2">Clear All FDB Entries on device</font>

Request example to clear all FDB via rpc **clear-mac-address**.

```xml
<rpc>
  <clear-mac-address/>
</rpc>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0435992a-fec6-45d5-ae5b-56f8d584d952">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-fdb">FDB entries are cleared.
</data>
</rpc-reply>
```

## <font color="#1d50a2">Show MAC Learning Information</font>

Request example to show mac learning info via rpc **show-mac-learning**.

```xml
<rpc>
  <show-mac-learning/>
</rpc>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c9c752c1-1331-4fc1-9567-a37c596ef20c">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-fdb">
    Interface    Mac-learning
    -----------  --------------
    Ethernet1    enable
    Ethernet2    enable
    Ethernet3    enable
    Ethernet4    enable
    Ethernet5    enable
    Ethernet6    enable
    Ethernet7    enable
    Ethernet8    enable
    Ethernet9    enable
    Ethernet10   enable
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Create Static/Blackhole MAC in FDB</font>

Request example to create static MAC or blackhole MAC via **edit-config**.

:::hint{type="warning"}
**NOTE:**
The VLAN must be created before port switch to L2.
:::

```xml
<config>
  <top>
    <fdb xmlns="http://asterfusion.com/ns/yang/asternos-fdb">
      <aging-time>4000</aging-time>
      <fdb-entry>
        <mac-address>12:34:56:78:9a:bc</mac-address>
        <vlan-id>100</vlan-id>
        <type>static</type>
        <port>Ethernet1</port>
      </fdb-entry>
      <fdb-entry>
        <mac-address>ee:ee:ee:ee:ee:ee</mac-address>
        <vlan-id>123</vlan-id>
        <type>static</type>
        <blackhole>true</blackhole>
      </fdb-entry>
      <fdb-entry>
        <mac-address>cc:cc:cc:cc:cc:cc</mac-address>
        <vlan-id>102</vlan-id>
        <type>static</type>
        <port>PortChannel0001</port>
      </fdb-entry>
    </fdb>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c6c88e9e-79fe-4633-9249-cedcfe32aea7">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Static/Blackhole MAC in FDB</font>

Request example to delete static MAC or blackhole MAC via **edit-config**.

```xml
<config>
  <top>
    <fdb xmlns="http://asterfusion.com/ns/yang/asternos-fdb">
      <fdb-entry operation="delete">
        <mac-address>12:34:56:78:9a:bc</mac-address>
        <vlan-id>100</vlan-id>
      </fdb-entry>
      <fdb-entry operation="delete">
        <mac-address>ee:ee:ee:ee:ee:ee</mac-address>
        <vlan-id>123</vlan-id>
      </fdb-entry>
    </fdb>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c6c88e9e-79fe-4633-9249-cedcfe32aea7">
  <ok/>
</rpc-reply>
```

