No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
DHCP Snooping Management

DHCP Snooping Management

Data Model

The data model file matching DHCP snooping is huawei-savi.yang.

Table 2-226  DHCP snooping

Object

Description

Value Range Remarks

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp/enable

Indicates whether to enable the DHCP function.

The value is of the Boolean type:
  • true: The DHCP function is enabled.
  • false: The DHCP function is disabled.
The default value is false.

N/A

/huawei-savi/savi/dhcp-snooping/snooping-global-enable/ipv4-enable

Indicates whether to enable DHCP snooping globally.

The value is of the Boolean type:
  • true: DHCP snooping is enabled globally.
  • false: DHCP snooping is disabled globally.
The default value is false.

N/A

/huawei-savi/savi/dhcp-snooping/snooping/interface/snooping-enable

Indicates whether to enable DHCP snooping on an interface.

The value is of the Boolean type:
  • true: DHCP snooping is enabled on the interface.
  • false: DHCP snooping is disabled on the interface.
The default value is false.

N/A

/huawei-savi/savi/dhcp-snooping/snooping/interface/snooping-trust-enable

Indicates whether an interface is trusted.

The value is of the Boolean type:
  • true: The interface is a trusted interface.
  • false: The interface is an untrusted interface.
The default value is false.

N/A

/huawei-savi/savi/dhcp-snooping/snooping/vlan Indicates whether to enable DHCP snooping in a VLAN. The object includes:
  • start-vlan-id: Specifies the start VLAN ID.
  • end-vlan-id: Specifies the end VLAN ID.
  • snooping-enable: Indicates whether to enable DHCP snooping.
  • start-vlan-id: The value must be the ID of an existing VLAN.
  • end-vlan-id: The value must be the ID of an existing VLAN.
  • snooping-enable: The value is of the Boolean type:
    • true: DHCP snooping is enabled.
    • false: DHCP snooping is disabled.
    The default value is false.
N/A
/huawei-savi/savi/dhcp-snooping/snooping/vlan-and-interface Indicates whether an interface in the VLAN is a trusted interface. The object includes:
  • vlan-id: Specifies the VLAN ID.
  • interface-name: Specifies the interface number.
  • snooping-trust-enable: Indicates whether an interface is a trusted interface.
  • vlan-id: The value must be the ID of an existing VLAN.
  • interface-name: The value must be the type and number of an interface added into the VLAN.
  • snooping-trust-enable: The value is of the Boolean type:
    • true: The interface is a trusted interface.
    • false: The interface is an untrusted interface.
    The default value is false.
N/A

Configuring DHCP Snooping

This section provides a sample of configuring DHCP snooping using the rpc method.

Table 2-227  Configuring DHCP snooping

Operation

XPATH

rpc

/huawei-savi/savi/dhcp-snooping

Data Requirements

Item

Data

Description

Whether DHCP is enabled

true

Enable the DHCP function.

Whether DHCP snooping is enabled globally

true

Enable the DHCP snooping function globally.

Whether DHCP snooping is enabled on GE0/0/1 connecting to users

true

Enable DHCP snooping on GE0/0/1 connecting to users.

Whether DHCP snooping is enabled in VLAN10 and VLAN11 to which users belong true Enable DHCP snooping in VLAN10 and VLAN11 to which users belong.
NOTE:
Ensure that VLAN10 and VLAN11 have been created.
Request example
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <interface>
          <name>GigabitEthernet0/0/1</name>
          <description>savi</description>
          <type>ethernetCsmacd</type>
          <enabled>true</enabled>
        </interface>
      </interfaces>
      <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
        <dhcpv4-config>
          <enable>true</enable>
        </dhcpv4-config>
      </dhcp-config>
      <savi xmlns="urn:huawei:params:xml:ns:yang:huawei-savi">
        <dhcp-snooping>
          <snooping-global-enable>
              <ipv4-enable>true</ipv4-enable>
          </snooping-global-enable>
          <snooping>
            <interface>
              <interface-name>GigabitEthernet0/0/1</interface-name>
              <snooping-enable>true</snooping-enable>
           </interface>
           <vlan>
              <start-vlan-id>10</start-vlan-id>
              <end-vlan-id>11</end-vlan-id>
              <snooping-enable>true</snooping-enable>
           </vlan>
         </snooping>
        </dhcp-snooping>
      </savi>
    </config>
  </edit-config>
</rpc>
Response example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
  <ok/>
</rpc-reply>

Sample of failed response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message> Service process failed.</error-message>
    <error-info>Error on node /huawei-savi/savi/dhcp-snooping/snooping/interface[interface-name="GigabitEthernet0/0/1"]/snooping-enable</error-info>
  </rpc-error>
</rpc-reply>

Configuring an Interface as the Trusted Interface

This section provides a sample of configuring interface as the trusted interface using the merge method.

Table 2-228  Configuring an Interface as the Trusted Interface

Operation

XPATH

rpc

/huawei-savi/savi/dhcp-snooping

Data Requirements

Item

Data

Description

Whether DHCP is enabled

true

Enable the DHCP function.

Whether DHCP snooping is enabled globally

true

Enable the DHCP snooping function globally.

Trusted status of GE0/0/2 connecting to servers

true

Configure GE0/0/2 connecting to servers as the trusted interface.

Trusted status of GE0/0/3 connecting to servers and added in VLAN13

true

Configure GE0/0/3 connecting to servers as the trusted interface.

Request example
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>GigabitEthernet0/0/2</if:name>
          <if:type>ethernetCsmacd</if:type>
          <if:enabled>true</if:enabled>
        </if:interface>
      </if:interfaces>
      <hw-dhcp:dhcp-config xmlns:hw-dhcp="urn:huawei:params:xml:ns:yang:huawei-dhcp">
        <hw-dhcp:dhcpv4-config>
          <hw-dhcp:enable>true</hw-dhcp:enable>
        </hw-dhcp:dhcpv4-config>
      </hw-dhcp:dhcp-config>
      <hw-savi:savi xmlns:hw-savi="urn:huawei:params:xml:ns:yang:huawei-savi">
        <hw-savi:dhcp-snooping>
          <hw-savi:snooping-global-enable>
            <hw-savi:ipv4-enable>true</hw-savi:ipv4-enable>
          </hw-savi:snooping-global-enable>
          <hw-savi:snooping>
            <hw-savi:interface>
              <hw-savi:interface-name>GigabitEthernet0/0/2</hw-savi:interface-name>
              <hw-savi:snooping-trust-enable>true</hw-savi:snooping-trust-enable>
            </hw-savi:interface>
            <hw-savi:vlan-and-interface>
              <hw-savi:vlan-id>13</hw-savi:vlan-id>
              <hw-savi:interface-name>GigabitEthernet0/0/3</hw-savi:interface-name>
              <hw-savi:snooping-trust-enable>true</hw-savi:snooping-trust-enable>
            </hw-savi:vlan-and-interface>
          </hw-savi:snooping>
        </hw-savi:dhcp-snooping>
      </hw-savi:savi>
    </config>
  </edit-config>
</rpc>
Response example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
  <ok/>
</rpc-reply>

Sample of failed response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message> Service process failed.</error-message>
    <error-info>Error on node /huawei-savi/savi/dhcp-snooping/snooping/interface[interface-name="GigabitEthernet0/0/2"]/snooping-trust-enable</error-info>
  </rpc-error>
</rpc-reply>

Disabling DHCP Snooping

This section provides a sample of disabling the DHCP snooping function using the rpc method.

Table 2-229  Disabling DHCP snooping

Operation

XPATH

rpc

/huawei-savi/savi/dhcp-snooping

Data Requirements

Item

Data

Description

Whether DHCP snooping is enabled globally

false

Disable DHCP snooping.

Request example
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-savi:savi xmlns:hw-savi="urn:huawei:params:xml:ns:yang:huawei-savi">
        <hw-savi:dhcp-snooping>
          <hw-savi:snooping-global-enable>
            <hw-savi:ipv4-enable>false</hw-savi:ipv4-enable>
          </hw-savi:snooping-global-enable>
        </hw-savi:dhcp-snooping>
      </hw-savi:savi>
    </config>
  </edit-config>
</rpc>
Response example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
  <ok/>
</rpc-reply>

Sample of failed response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message> Service process failed.</error-message>
    <error-info>Error on node /huawei-savi/savi/dhcp-snooping/snooping/interface[interface-name="GigabitEthernet0/0/1"]/snooping-enable</error-info>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2019-03-30

Document ID: EDOC1000178028

Views: 4439

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next