跳转到内容

DHCP‑Snooping

此内容尚不支持你的语言。

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

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

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

Response example

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

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

<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

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

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

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

Response example

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

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

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

<show-snooping-count/>

Response example

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