跳转到内容
Ask AI

Dhcp-Relay-Netconf

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

YANG Pathget/get-configedit-configrpc
/dhcp-relayYmerge, replace, create, delete—
/dhcp-relay/dhcp-relay-agent/{name}/{ip-type}Ymerge, replace, create, delete—
/dhcp-relay/interfaces/{name}Ymerge, replace, create, delete—

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

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

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

Response example

<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<top>
<dhcp-relay xmlns="http://asterfusion.com/ns/yang/asternos-dhcp-relay">
<dhcp-relay-agent>
<name>test</name>
<ip-type>v4</ip-type>
<downlink-interfaces>Vlan100</downlink-interfaces>
<uplink-interfaces>Ethernet1</uplink-interfaces>
<loopback-interface>Loopback1</loopback-interface>
<server-ips>10.1.1.1</server-ips>
<server-ips>10.1.1.11</server-ips>
<source-ip>10.2.2.2</source-ip>
</dhcp-relay-agent>
<interfaces>
<name>Vlan100</name>
<option82-remote-id>sonic</option82-remote-id>
<dhcp-agent-ip>10.1.1.12</dhcp-agent-ip>
</interfaces>
</dhcp-relay>
</top>
</data>

The up link, down link, loopback interface must be router interface and configured ip address.

Request example to set a DHCP Relay configuration via edit-config.

<config>
<top>
<dhcp-relay>
<dhcp-relay-agent>
<name>test</name>
<ip-type>v4</ip-type>
<downlink-interfaces>Vlan100</downlink-interfaces>
<uplink-interfaces>Ethernet1</uplink-interfaces>
<loopback-interface>Loopback1</loopback-interface>
<server-ips>10.1.1.1</server-ips>
<server-ips>10.1.1.11</server-ips>
<source-ip>10.2.2.2</source-ip>
</dhcp-relay-agent>
</dhcp-relay>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:487ac1eb-4a86-4f44-bd6f-87a16ad92815">
<ok/>
</rpc-reply>

Request example to set a DHCP Relay Agent IP for down link interface via edit-config.

<config>
<top>
<dhcp-relay>
<interfaces>
<name>Vlan100</name>
<dhcp-agent-ip>10.1.1.12</dhcp-agent-ip>
</interfaces>
</dhcp-relay>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:be7fefd9-98af-4153-9a86-cf82410e4676">
<ok/>
</rpc-reply>
Section titled “Set DHCP Relay Option82 for down link interface”

Request example to set a DHCP Relay Option82 for down link interface via edit-config.

<config>
<top>
<dhcp-relay>
<interfaces>
<name>Vlan100</name>
<option82-remote-id>sonic</option82-remote-id>
</interfaces>
</dhcp-relay>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a6096761-9460-480d-bac2-0d7727ddef90">
<ok/>
</rpc-reply>

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

<config>
<top>
<dhcp-relay>
<dhcp-relay-agent operation="delete">
<name>test</name>
<ip-type>v4</ip-type>
</dhcp-relay-agent>
</dhcp-relay>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:81c62129-0eed-4041-93a9-dd748f2c9dcf">
<ok/>
</rpc-reply>

Tree Diagram

module: asternos-dhcp-relay
+--rw dhcp-relay
+--rw dhcp-relay-agent* [name ip-type]
| +--rw name string
| +--rw ip-type enumeration
| +--rw downlink-interfaces* cmn:vlan-name
| +--rw uplink-interfaces* union
| +--rw loopback-interface? cmn:loopback-interface-name
| +--rw option82-disabled? boolean
| +--rw server-ips* inet:ip-address-no-zone
| +--rw source-ip? inet:ipv4-address-no-zone
+--rw interfaces* [name]
+--rw name cmn:vlan-name
+--rw option82-remote-id? string
+--rw dhcp-agent-ip? inet:ipv4-address-no-zone

Table of Properties

NameRequiredType/RangeDescription
dhcp-relayMPath-only node, has no configurable value.
DHCP relay.
dhcp-relay-agentMPath-only node, has no configurable value.
The list of dhcp relay agent.
nameONoneDHCP relay name.
ip-typeO”v4"
"v6”
DHCP relay IP family type.
downlink-interfacesOcmn:vlan-nameDownlink vlan interface
uplink-interfacesOEthernet nameUplink interface
loopback-interfaceOcmn:loopback-interface-nameSet loopback interface as DHCP relay gateway.
option82-disabledO”true"
"false”
Set DHCP Option82 enabled or disabled.
server-ipsOinet:ip-address-no-zoneThe IP address of DHCP server.
source-ipOinet:ipv4-address-no-zoneThe IP address of DHCP relay agent.
interfacesMPath-only node, has no configurable value.
List of Vlan interfaces configuration to the DHCP relay agent
nameOcmn:vlan-nameThe VLAN interface name
option82-remote-idOstringThe remote-id value of DHCP Option82 for DHCP relay agent.
dhcp-agent-ipOinet:ipv4-address-no-zoneThe IP address of DHCP relay agent.

Tree Diagram

module: asternos-dhcp-relay
+--rw dhcp-relay
+--rw dhcp-relay-agent* [name ip-type]
+--rw name string
+--rw ip-type enumeration
+--rw downlink-interfaces* cmn:vlan-name
+--rw uplink-interfaces* union
+--rw loopback-interface? cmn:loopback-interface-name
+--rw option82-disabled? boolean
+--rw server-ips* inet:ip-address-no-zone
+--rw source-ip? inet:ipv4-address-no-zone

Table of Properties

NameRequiredType/RangeDescription
dhcp-relay-agentMPath-only node, has no configurable value.
The list of dhcp relay agent.
nameONoneDHCP relay name.
ip-typeO”v4"
"v6”
DHCP relay IP family type.
downlink-interfacesOcmn:vlan-nameDownlink vlan interface
uplink-interfacesOEthernet nameUplink interface
loopback-interfaceOcmn:loopback-interface-nameSet loopback interface as DHCP relay gateway.
option82-disabledO”true"
"false”
Set DHCP Option82 enabled or disabled.
server-ipsOinet:ip-address-no-zoneThe IP address of DHCP server.
source-ipOinet:ipv4-address-no-zoneThe IP address of DHCP relay agent.

Tree Diagram

module: asternos-dhcp-relay
+--rw dhcp-relay
+--rw interfaces* [name]
+--rw name cmn:vlan-name
+--rw option82-remote-id? string
+--rw dhcp-agent-ip? inet:ipv4-address-no-zone

Table of Properties

NameRequiredType/RangeDescription
interfacesMPath-only node, has no configurable value.
List of Vlan interfaces configuration to the DHCP relay agent
nameOcmn:vlan-nameThe VLAN interface name
option82-remote-idOstringThe remote-id value of DHCP Option82 for DHCP relay agent.
dhcp-agent-ipOinet:ipv4-address-no-zoneThe IP address of DHCP relay agent.