Dhcp-Snooping-Netconf
此内容尚不支持你的语言。
Dhcp Snooping
Section titled “Dhcp Snooping”Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /clear-dhcp-snooping-table | — | — | Y |
| /dhcp-snooping | Y | merge, replace, create, delete | — |
| /dhcp-snooping/global | Y | merge, replace, create, delete | — |
| /dhcp-snooping/interfaces/{name} | Y | merge, replace, create, delete | — |
| /dhcp-snooping/snp-sync | Y | merge, replace, create, delete | — |
| /show-dhcp-snooping-count | — | — | Y |
| /show-dhcp-snooping-table | — | — | Y |
| /sync-dhcp-snooping-table | — | — | Y |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage DHCP Snooping configurations on AsterNOS devices.
Get Current DHCP Snooping Configurations
Section titled “Get Current DHCP Snooping Configurations”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>Set DHCP Snooping Configurations
Section titled “Set DHCP Snooping Configurations”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>Delete DHCP Snooping Configuration
Section titled “Delete DHCP Snooping Configuration”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>Set DHCP Snooping Sync Configurations
Section titled “Set DHCP Snooping Sync Configurations”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>Show Dhcp Snooping Table
Section titled “Show Dhcp Snooping Table”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>Show Dhcp-Snooping Count
Section titled “Show Dhcp-Snooping Count”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 Dhcp-Snooping Table
Section titled “Clear Dhcp-Snooping Table”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>Sync Dhcp-Snooping Table
Section titled “Sync Dhcp-Snooping Table”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>Properties Descriptions
Section titled “Properties Descriptions”dhcp snooping configuration
Section titled “dhcp snooping configuration”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-zoneTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| dhcp-snooping | M | Path-only node, has no configurable value. dhcp snooping configuration. | |
| global | M | Path-only node, has no configurable value. dhcp snooping global configuration. | |
| dhcp4-enabled | O | ”true" "false” | enable dhcp snooping. |
| dhcp6-enabled | O | ”true" "false” | enable dhcpv6 snooping. |
| autosave | O | ”true" "false” | enable dhcp snooping autosave. |
| interfaces | M | Path-only node, has no configurable value. dhcp snooping interface configuration. | |
| interface | M | Path-only node, has no configurable value. dhcp snooping interface. | |
| name | O | Ethernet name | interface name. |
| enabled | O | ”true" "false” | enable dhcp snooping. |
| trusted | O | ”true" "false” | trusted interface dhcp snooping. |
| snp-sync | M | Path-only node, has no configurable value. dhcp snooping sync configuration. | |
| enabled | O | ”true" "false” | enable dhcp snooping sync. |
| mode | O | ”client" "server” | dhcp snooping sync mode. |
| switch-id | O | inet:ip-address-no-zone | dhcp snooping sync switch-id. |
| source-ip | O | inet:ip-address-no-zone | dhcp snooping sync source ip. |
| neighbors | O | inet:ip-address-no-zone | dhcp snooping sync neighbor ip. |
| peers | O | inet:ip-address-no-zone | dhcp snooping sync ip. |
dhcp snooping global configuration
Section titled “dhcp snooping global configuration”Tree Diagram
module: asternos-dhcp-snooping +--rw dhcp-snooping +--rw global +--rw dhcp4-enabled? boolean +--rw dhcp6-enabled? boolean +--rw autosave? booleanTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| global | M | Path-only node, has no configurable value. dhcp snooping global configuration. | |
| dhcp4-enabled | O | ”true" "false” | enable dhcp snooping. |
| dhcp6-enabled | O | ”true" "false” | enable dhcpv6 snooping. |
| autosave | O | ”true" "false” | enable dhcp snooping autosave. |
dhcp snooping interface configuration
Section titled “dhcp snooping interface configuration”Tree Diagram
module: asternos-dhcp-snooping +--rw dhcp-snooping +--rw interfaces +--rw interface* [name] +--rw name union +--rw enabled? boolean +--rw trusted? booleanTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| interfaces | M | Path-only node, has no configurable value. dhcp snooping interface configuration. | |
| interface | M | Path-only node, has no configurable value. dhcp snooping interface. | |
| name | O | Ethernet name | interface name. |
| enabled | O | ”true" "false” | enable dhcp snooping. |
| trusted | O | ”true" "false” | trusted interface dhcp snooping. |
dhcp snooping sync configuration
Section titled “dhcp snooping sync configuration”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-zoneTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| snp-sync | M | Path-only node, has no configurable value. dhcp snooping sync configuration. | |
| enabled | O | ”true" "false” | enable dhcp snooping sync. |
| mode | O | ”client" "server” | dhcp snooping sync mode. |
| switch-id | O | inet:ip-address-no-zone | dhcp snooping sync switch-id. |
| source-ip | O | inet:ip-address-no-zone | dhcp snooping sync source ip. |
| neighbors | O | inet:ip-address-no-zone | dhcp snooping sync neighbor ip. |
| peers | O | inet:ip-address-no-zone | dhcp snooping sync ip. |
Clear Dhcp Snooping Table
Section titled “Clear Dhcp Snooping Table”Tree Diagram
module: asternos-dhcp-snooping
rpcs: +---x clear-dhcp-snooping-table +--ro output +--ro data? stringTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| clear-dhcp-snooping-table | O | ||
| data | O | string | error message. |
Show Dhcp Snooping Count
Section titled “Show Dhcp Snooping Count”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? uint64Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-dhcp-snooping-count | O | ||
| data | M | Path-only node, has no configurable value. | |
| total-v4-count | O | integer | total v4 count. |
| total-v6-count | O | integer | total v6 count. |
| local-v4-count | O | integer | local v4 count. |
| local-v6-count | O | integer | local v4 count. |
| remote-v4-count | O | integer | remote v4 count. |
| remote-v6-count | O | integer | remote v6 count. |
Show Dhcp Snooping Table
Section titled “Show Dhcp Snooping Table”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? enumerationTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-dhcp-snooping-table | O | ||
| data | M | Path-only node, has no configurable value. dhcp snooping table. | |
| entries | M | Path-only node, has no configurable value. | |
| vlan | O | cmn:vlan-name | vlan id. |
| smac | O | yang:mac-address | source mac address. |
| sip | O | inet:ip-address-no-zone | source ip address. |
| lease-time | O | integer | lease time. |
| interface | O | string | interface name. |
| timestamp | O | integer | timestamp. |
| switch-id | O | string | switch id. |
| flag | O | ”local" "remote” | flag. |
Sync Dhcp Snooping Table
Section titled “Sync Dhcp Snooping Table”Tree Diagram
module: asternos-dhcp-snooping
rpcs: +---x sync-dhcp-snooping-table +--ro output +--ro data? stringTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| sync-dhcp-snooping-table | O | ||
| data | O | string | error message. |