---
title: DHCP‑Snooping
slug: enterprise-v6p1/dhcpsnooping
createdAt: 2025-12-18T08:51:05.920Z
---

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

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

## <font color="#1d50a2">Get Current DHCP Snooping Configurations</font>

Request example to get all DHCP Snooping configurations via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <dhcp-snooping/>
  </top>
</filter>
```

Response example

```xml
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <top>
    <dhcp-snooping xmlns="http://asterfusion.com/ns/yang/asternos-dhcp-snooping">
      <global>
        <dhcp4-enabled>true</dhcp4-enabled>
        <dhcp6-enabled>true</dhcp6-enabled>
        <autosave>false</autosave>
      </global>
      <interfaces>
        <interface>
          <name>Ethernet1</name>
          <enabled>true</enabled>
          <trusted>true</trusted>
        </interface>
        <interface>
          <name>Vlan100</name>
          <enabled>true</enabled>
          <trusted>true</trusted>
        </interface>
      </interfaces>
    </dhcp-snooping>
  </top>
</data>
```

## <font color="#1d50a2">Set DHCP Snooping Configurations</font>

Request example to set DHCP Snooping configuration via **edit-config**.

```xml
<config>
  <top>
    <dhcp-snooping>
      <global operation="merge">
        <dhcp4-enabled>true</dhcp4-enabled>
        <dhcp6-enabled>true</dhcp6-enabled>
        <autosave>false</autosave>
      </global>
      <interfaces>
        <interface>
          <name>Ethernet1</name>
          <enabled>true</enabled>
          <trusted>true</trusted>
        </interface>
        <interface>
          <name>Vlan100</name>
          <enabled>true</enabled>
          <trusted>true</trusted>
        </interface>
      </interfaces>
    </dhcp-snooping>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:06239f01-5869-41af-84dd-0e4f1e1e774d">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete DHCP Snooping Configuration</font>

Request example to delete DHCP Snooping configurations of interface via **edit-config**.

```xml
<config>
  <top>
    <dhcp-snooping>
      <interfaces>
        <interface operation="delete">
          <name>Vlan100</name>
        </interface>
      </interfaces>
    </dhcp-snooping>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:6845257e-fb87-4b08-80c5-2a8b1b1dc264">
  <ok/>
</rpc-reply>
```

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

:::hint{type="warning"}
**NOTE:**
Snooping table include DHCP snooping and ND snooping.
:::

Request example to show DHCP snooping table via rpc **show-snooping-table**.

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

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:79163e9c-c7a9-44b7-936f-56dab72436c2">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-dhcp-snooping"/>
    <entries>
      <vlan>Vlan100</vlan>
      <smac>0c:13:d3:82:00:03</smac>
      <sip>10.8.8.100</sip>
      <lease-time>300</lease-time>
      <interface>Ethernet3</interface>
      <timestamp>318657056529</timestamp>
      <switch-id>10.1.0.1</switch-id>
      <flag>local</flag>
    </entries>
    <entries>
      <vlan>Vlan100</vlan>
      <smac>0c:13:d3:82:52:03</smac>
      <sip>2001::db8:101</sip>
      <lease-time>300</lease-time>
      <interface>Ethernet3</interface>
      <timestamp>41857052629</timestamp>
      <switch-id>10.1.0.1</switch-id>
      <flag>local</flag>
    </entries>
  </data>
</rpc-reply>
```

## <font color="#1d50a2">Show Snooping Count</font>

:::hint{type="warning"}
**NOTE:**
Snooping count include DHCP snooping and ND snooping.
:::

Request example to show DHCP snooping table via rpc **show-snooping-count**.

```xml
<show-snooping-count/>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:ba1ff87c-59dd-4a3f-a7eb-193373a293a7">
  <data xmlns="http://asterfusion.com/ns/yang/asternos-dhcp-snooping"/>
    <total-v4-count>1</total-v4-count>
    <total-v6-count>1</total-v6-count>
    <local-v4-count>1</local-v4-count>
    <local-v6-count>1</local-v6-count>
    <remote-v4-count>0</remote-v4-count>
    <remote-v6-count>0</remote-v6-count>
  </data>
</rpc-reply>
```

