跳转到内容
Ask AI

Dhcp-Snooping-Netconf

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

YANG Pathget/get-configedit-configrpc
/clear-dhcp-snooping-table——Y
/dhcp-snoopingYmerge, replace, create, delete—
/dhcp-snooping/globalYmerge, replace, create, delete—
/dhcp-snooping/interfaces/{name}Ymerge, replace, create, delete—
/dhcp-snooping/snp-syncYmerge, replace, create, delete—
/show-dhcp-snooping-count——Y
/show-dhcp-snooping-table——Y
/sync-dhcp-snooping-table——Y

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>

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

<config>
<top>
<dhcp-snooping>
<snp-sync operation="merge">
<enabled>true</enabled>
<mode>server</mode>
<switch-id>10.1.0.1</switch-id>
<source-ip>10.1.0.1</source-ip>
<neighbors>11.1.1.11</neighbors>
<neighbors>11.1.1.12</neighbors>
<peers>12.2.2.11</peers>
<peers>12.2.2.12</peers>
</snp-sync>
</dhcp-snooping>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3f30f5dc-23c3-43a1-b4ee-728a789f905c">
<ok/>
</rpc-reply>

Snooping table include DHCP snooping and ND snooping.

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

<show-dhcp-snooping-table/>

Response example

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

Snooping count include DHCP snooping and ND snooping.

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

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

Clear count include DHCP snooping and ND snooping.

Request example to clear DHCP snooping table via rpc clear-dhcp-snooping-table.

<clear-dhcp-snooping-table/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:cd0c4f7a-8568-45d9-8edd-ecdec9a5f1a4">
<ok/>
</rpc-reply>

Synchronize DHCP snooping and ND snooping for all snp nodes.

Request example to sync DHCP snooping table via rpc sync-dhcp-snooping-table.

<sync-dhcp-snooping-table/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5ad2f698-4330-4045-90f5-1cc322958703">
<ok/>
</rpc-reply>

Tree Diagram

module: asternos-dhcp-snooping
+--rw dhcp-snooping
+--rw global
| +--rw dhcp4-enabled? boolean
| +--rw dhcp6-enabled? boolean
| +--rw autosave? boolean
+--rw interfaces
| +--rw interface* [name]
| +--rw name union
| +--rw enabled? boolean
| +--rw trusted? boolean
+--rw snp-sync
+--rw enabled? boolean
+--rw mode? enumeration
+--rw switch-id? inet:ip-address-no-zone
+--rw source-ip? inet:ip-address-no-zone
+--rw neighbors* inet:ip-address-no-zone
+--rw peers* inet:ip-address-no-zone

Table of Properties

NameRequiredType/RangeDescription
dhcp-snoopingMPath-only node, has no configurable value.
dhcp snooping configuration.
globalMPath-only node, has no configurable value.
dhcp snooping global configuration.
dhcp4-enabledO”true"
"false”
enable dhcp snooping.
dhcp6-enabledO”true"
"false”
enable dhcpv6 snooping.
autosaveO”true"
"false”
enable dhcp snooping autosave.
interfacesMPath-only node, has no configurable value.
dhcp snooping interface configuration.
interfaceMPath-only node, has no configurable value.
dhcp snooping interface.
nameOEthernet nameinterface name.
enabledO”true"
"false”
enable dhcp snooping.
trustedO”true"
"false”
trusted interface dhcp snooping.
snp-syncMPath-only node, has no configurable value.
dhcp snooping sync configuration.
enabledO”true"
"false”
enable dhcp snooping sync.
modeO”client"
"server”
dhcp snooping sync mode.
switch-idOinet:ip-address-no-zonedhcp snooping sync switch-id.
source-ipOinet:ip-address-no-zonedhcp snooping sync source ip.
neighborsOinet:ip-address-no-zonedhcp snooping sync neighbor ip.
peersOinet:ip-address-no-zonedhcp snooping sync ip.

Tree Diagram

module: asternos-dhcp-snooping
+--rw dhcp-snooping
+--rw global
+--rw dhcp4-enabled? boolean
+--rw dhcp6-enabled? boolean
+--rw autosave? boolean

Table of Properties

NameRequiredType/RangeDescription
globalMPath-only node, has no configurable value.
dhcp snooping global configuration.
dhcp4-enabledO”true"
"false”
enable dhcp snooping.
dhcp6-enabledO”true"
"false”
enable dhcpv6 snooping.
autosaveO”true"
"false”
enable dhcp snooping autosave.

Tree Diagram

module: asternos-dhcp-snooping
+--rw dhcp-snooping
+--rw interfaces
+--rw interface* [name]
+--rw name union
+--rw enabled? boolean
+--rw trusted? boolean

Table of Properties

NameRequiredType/RangeDescription
interfacesMPath-only node, has no configurable value.
dhcp snooping interface configuration.
interfaceMPath-only node, has no configurable value.
dhcp snooping interface.
nameOEthernet nameinterface name.
enabledO”true"
"false”
enable dhcp snooping.
trustedO”true"
"false”
trusted interface dhcp snooping.

Tree Diagram

module: asternos-dhcp-snooping
+--rw dhcp-snooping
+--rw snp-sync
+--rw enabled? boolean
+--rw mode? enumeration
+--rw switch-id? inet:ip-address-no-zone
+--rw source-ip? inet:ip-address-no-zone
+--rw neighbors* inet:ip-address-no-zone
+--rw peers* inet:ip-address-no-zone

Table of Properties

NameRequiredType/RangeDescription
snp-syncMPath-only node, has no configurable value.
dhcp snooping sync configuration.
enabledO”true"
"false”
enable dhcp snooping sync.
modeO”client"
"server”
dhcp snooping sync mode.
switch-idOinet:ip-address-no-zonedhcp snooping sync switch-id.
source-ipOinet:ip-address-no-zonedhcp snooping sync source ip.
neighborsOinet:ip-address-no-zonedhcp snooping sync neighbor ip.
peersOinet:ip-address-no-zonedhcp snooping sync ip.

Tree Diagram

module: asternos-dhcp-snooping
rpcs:
+---x clear-dhcp-snooping-table
+--ro output
+--ro data? string

Table of Properties

NameRequiredType/RangeDescription
clear-dhcp-snooping-tableO
dataOstringerror message.

Tree Diagram

module: asternos-dhcp-snooping
rpcs:
+---x show-dhcp-snooping-count
+--ro output
+--ro data
+--ro total-v4-count? uint64
+--ro total-v6-count? uint64
+--ro local-v4-count? uint64
+--ro local-v6-count? uint64
+--ro remote-v4-count? uint64
+--ro remote-v6-count? uint64

Table of Properties

NameRequiredType/RangeDescription
show-dhcp-snooping-countO
dataMPath-only node, has no configurable value.
total-v4-countOintegertotal v4 count.
total-v6-countOintegertotal v6 count.
local-v4-countOintegerlocal v4 count.
local-v6-countOintegerlocal v4 count.
remote-v4-countOintegerremote v4 count.
remote-v6-countOintegerremote v6 count.

Tree Diagram

module: asternos-dhcp-snooping
rpcs:
+---x show-dhcp-snooping-table
+--ro output
+--ro data
+--ro entries* [vlan smac sip]
+--ro vlan cmn:vlan-name
+--ro smac yang:mac-address
+--ro sip inet:ip-address-no-zone
+--ro lease-time? uint32
+--ro interface? string
+--ro timestamp? uint64
+--ro switch-id? string
+--ro flag? enumeration

Table of Properties

NameRequiredType/RangeDescription
show-dhcp-snooping-tableO
dataMPath-only node, has no configurable value.
dhcp snooping table.
entriesMPath-only node, has no configurable value.
vlanOcmn:vlan-namevlan id.
smacOyang:mac-addresssource mac address.
sipOinet:ip-address-no-zonesource ip address.
lease-timeOintegerlease time.
interfaceOstringinterface name.
timestampOintegertimestamp.
switch-idOstringswitch id.
flagO”local"
"remote”
flag.

Tree Diagram

module: asternos-dhcp-snooping
rpcs:
+---x sync-dhcp-snooping-table
+--ro output
+--ro data? string

Table of Properties

NameRequiredType/RangeDescription
sync-dhcp-snooping-tableO
dataOstringerror message.