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).
IPv6 Static Route Management

IPv6 Static Route Management

This section describes the configuration model of IPv6 static route management and provides examples of XML packets.

Data Model

The configuration file matching IPv6 static route management is ietf-routing.yang, ietf-ipv6-unicast-routing.yang.

Table 2-173  IPv6 static route management

Object

Description

Value Remarks

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/send-advertisements

Enables the function that sends Router Advertisement (RA) messages.

The value is of the Boolean type:
  • true: enable
  • false: disable

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/max-rtr-adv-interval

Sets the maximum interval for sending RA messages.

The value is an integer that ranges from 4 to 1800.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/min-rtr-adv-interval

Sets the minimum interval for sending RA messages.

The value is an integer that ranges from 3 to 1350.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/managed-flag

Sets the managed (M) flag of stateful address autoconfiguration in an RA message.

The value is of the Boolean type:
  • true: enable
  • false: disable

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/other-config-flag

Sets the other-config flag of stateful address autoconfiguration in an RA message.

The value is of the Boolean type:
  • true: enable
  • false: disable

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/reachable-time

Sets the IPv6 neighbor reachable time.

The value is an integer that can be 0 or ranges from 1 to 3600000.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/retrans-timer

Sets the interval for sending Neighbor Solicitation (NS) messages.

The value is an integer that can be 0 or ranges from 1000 to 4294967295.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/cur-hop-limit

Sets the hop limit for RA messages.

The value is an integer that ranges from 0 to 255.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/default-lifetime

Sets the lifetime of RA messages.

The value is an integer that can be 0 or ranges from 4 to 9000.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/no-advertise

Configures RA messages not to carry the default prefix generated by an interface IPv6 address.

The value is a character string and can only be a space with unlimited length.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/valid-lifetime

Sets the valid lifetime of prefixes.

The value is an integer that ranges from 0 to 4294967295. valid-lifetime must be greater than or equal to preferred-lifetime.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/on-link-flag

Sets the O-Flag.

The value is of the Boolean type:
  • true: enable
  • false: disable

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/preferred-lifetime

Sets the preferred lifetime of prefixes.

The value is an integer that ranges from 0 to 4294967295.

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/autonomous-flag

Sets the A-Flag.

The value is of the Boolean type:
  • true: enable
  • false: disable

The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object.

/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/simple-next-hop

Configures the next-hop outbound interface of an IPv6 static route.

-

N/A

/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/special-next-hop

Configures a special next hop for an IPv6 static route.

Currently, only the blackhole next hop is supported.

N/A

/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/next-hop-address

Configures a next-hop address for an IPv6 static route.

The value is in dotted decimal notation.

N/A

/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/description

Configures a description for an IPv6 static route.

The value is a string of 1 to 80 characters without question marks. It can contain spaces.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/send-advertisements

Displays the enabling status of the function that sends RA messages:

The value is of the Boolean type:
  • true: enable
  • false: disable

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/max-rtr-adv-interval

Displays the maximum interval for sending RA messages.

The value is an integer that ranges from 4 to 1800.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/min-rtr-adv-interval

Displays the minimum interval for sending RA messages.

The value is an integer that ranges from 3 to 1350.

NA

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/managed-flag

Displays the M flag of stateful address autoconfiguration in an RA message.

The value is of the Boolean type:
  • true: enable
  • false: disable

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/other-config-flag

Displays the other-config flag of stateful address autoconfiguration in an RA message.

The value is of the Boolean type:
  • true: enable
  • false: disable

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/reachable-time

Displays the IPv6 neighbor reachable time.

The value is an integer that can be 0 or ranges from 1 to 3600000.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/retrans-timer

Displays the interval for sending NS messages.

The value is an integer that can be 0 or ranges from 1000 to 4294967295.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/cur-hop-limit

Displays the hop limit of RA messages.

The value is an integer that ranges from 0 to 255.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/default-lifetime

Displays the lifetime of RA messages.

The value is an integer that can be 0 or ranges from 4 to 9000.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/prefix-spec

Displays the prefix information carried in an RA message.

The value is a character string.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/valid-lifetime

Displays the valid lifetime of prefixes.

The value is an integer that ranges from 0 to 4294967295.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/on-link-flag

Displays the O-Flag.

The value is of the Boolean type:
  • true: enable
  • false: disable

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/preferred-lifetime

Displays the preferred lifetime of prefixes.

The value is an integer that ranges from 0 to 4294967295.

N/A

/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/autonomous-flag

Displays the A-Flag.

The value is of the Boolean type:
  • true: enable
  • false: disable

N/A

Configuring the IPv6 Static Routes And IPv6 ND RA Function

This section provides a sample of configuring the IPv6 Static Routes And IPv6 ND Router Advertisement (RA) function using the rpc method.

Table 2-174  Configuring the IPv6 Static Routes And IPv6 ND RA Function

Operation

XPATH

edit-config:merge

  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/send-advertisements
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/max-rtr-adv-interval
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/min-rtr-adv-interval
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/managed-flag
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/other-config-flag
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/reachable-time
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/retrans-timer
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/cur-hop-limit
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/default-lifetime
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/no-advertise
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/valid-lifetime
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/on-link-flag
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/preferred-lifetime
  • /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/autonomous-flag
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/simple-next-hop
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/special-next-hop
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/next-hop-address
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/description
Table 2-175  Obtaining IPv6 ND RA parameters

Operation

XPATH

edit-config:create

/huawei-device:device-state/upstream-interfaces/interface/IPv6

Data Requirements
Table 2-176  Configuring ND data and IPv6 routing information on an interface

Item

Data

Description

Enabling the function that sends RA messages

send-advertisements

Enable the function that sends RA messages.

Configuring the maximum interval for sending RA messages

max-rtr-adv-interval

Configure the maximum interval for sending RA messages.

Configuring the minimum interval for sending RA messages

min-rtr-adv-interval

Configure the minimum interval for sending RA messages.

Configuring the M flag of stateful address autoconfiguration in an RA message

managed-flag

Configure the M flag of stateful address autoconfiguration in an RA message.

Configuring the other-config flag of stateful address autoconfiguration in an RA message

other-config-flag

Configure the other-config flag of stateful address autoconfiguration in an RA message.

Configuring the IPv6 neighbor reachable time

reachable-time

Configure the IPv6 neighbor reachable time.

Configuring the interval for sending Neighbor Solicitation (NS) messages

retrans-timer

Configure the interval for sending NS messages.

Configuring the hop limit of RA messages

cur-hop-limit

Configure the hop limit of RA messages.

Configuring the lifetime of RA messages

default-lifetime

Configure the lifetime of RA messages.

Configuring RA messages not to carry the default prefix generated by an interface IPv6 address

no-advertise

Configure RA messages not to carry the default prefix generated by an interface IPv6 address.

Configuring the valid lifetime of prefixes

valid-lifetime

Configure the valid lifetime of prefixes.

Configuring the O-Flag

on-link-flag

Configure the O-Flag. If this parameter is specified, the prefix carried in the RA message cannot be allocated to the local link.

Configuring the preferred lifetime of prefixes

preferred-lifetime

Configure the preferred lifetime of prefixes. The preferred lifetime cannot be larger than the valid lifetime.

Removing the A-Flag

autonomous-flag

Remove the A-Flag. If this parameter is specified, the configured prefix cannot be used in stateless address auto-configuration. The A-Flag indicates the autonomous address configuration in the prefix option of RA messages.

Configuring a next-hop outbound interface for an IPv6 static route

simple-next-hop

Configure a next-hop outbound interface for an IPv6 static route.

Configuring a special next hop for an IPv6 static route

special-next-hop

Configure a special next hop for an IPv6 static route. Currently, only the blackhole next hop is supported.

Configuring a next-hop address for an IPv6 static route

next-hop-address

Configure a next-hop address for an IPv6 static route.

Request Example

Configure IPv6 ND RA.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="24" 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>Vlanif10</if:name>
          <if:type>propVirtual </if:type>
          <ip:ipv6 xmlns:ip="urn:ietf:params:xml:ns:yang:ietf-ip">
            <ip:enabled>true</ip:enabled>
            <v6ur:ipv6-router-advertisements xmlns:v6ur="urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing">
              <v6ur:send-advertisements>true</v6ur:send-advertisements>
              <v6ur:managed-flag>true</v6ur:managed-flag>
              <v6ur:other-config-flag>true</v6ur:other-config-flag>
              <v6ur:reachable-time>10</v6ur:reachable-time>
              <v6ur:retrans-timer>1000</v6ur:retrans-timer>
              <v6ur:cur-hop-limit>10</v6ur:cur-hop-limit>
              <v6ur:default-lifetime>2222</v6ur:default-lifetime>
              <v6ur:prefix-list>
                <v6ur:prefix>
                  <v6ur:prefix-spec>111::1/64</v6ur:prefix-spec>
                  <v6ur:valid-lifetime>1000</v6ur:valid-lifetime>
                  <v6ur:on-link-flag>true</v6ur:on-link-flag>
                  <v6ur:preferred-lifetime>111</v6ur:preferred-lifetime>
                </v6ur:prefix>
              </v6ur:prefix-list>
            </v6ur:ipv6-router-advertisements>
          </ip:ipv6>
        </if:interface>
      </if:interfaces>
    </config>
  </edit-config>
</rpc>

Configure IPv6 static routing.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="27" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing">
        <rt:routing-instance>
          <rt:name>default-routing-instance</rt:name>
          <rt:routing-protocols>
            <rt:routing-protocol>
              <rt:type>static</rt:type>
              <rt:name>default-routing-instance</rt:name>
              <rt:static-routes>
                <v6ur:ipv6 xmlns:v6ur="urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing">
                  <v6ur:route>
                    <v6ur:destination-prefix>111::1/64</v6ur:destination-prefix>
                    <v6ur:next-hop>
                      <v6ur:special-next-hop>blackhole</v6ur:special-next-hop>
                    </v6ur:next-hop>
                  </v6ur:route>
                </v6ur:ipv6>
              </rt:static-routes>
            </rt:routing-protocol>
          </rt:routing-protocols>
        </rt:routing-instance>
      </rt:routing>
    </config>
  </edit-config>
</rpc>

Display IPv6 ND RA data.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <if:interfaces-state xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>Vlanif10</if:name>
        </if:interface>
      </if:interfaces-state>
    </filter>
  </get>
</rpc>

Display IPv6 static route data.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="14" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get-config>
    <source>
      <running/>
    </source>
    <filter type="subtree">
      <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing">
        <rt:routing-instance/>
      </rt:routing>
    </filter>
  </get-config>
</rpc>
Response Example

Sample of successful response for configuring IPv6 ND RA/IPv6 static routing

##### Ok Reply or Operation Successful #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="24">
  <ok/>
</rpc-reply> 

Sample of successful response for displaying IPv6 ND RA data

##### Ok Reply or Operation Successful #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>Vlanif10</name>
        <type>propVirtual</type>
        <admin-status>up</admin-status>
        <oper-status>down</oper-status>
        <if-index>441</if-index>
        <phys-address>fc:e3:3c:9f:17:6b</phys-address>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <forwarding>false</forwarding>
          <mtu>1500</mtu>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <forwarding>false</forwarding>
          <mtu>1500</mtu>
          <ipv6-router-advertisements xmlns="urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing">
            <send-advertisements>false</send-advertisements>
            <max-rtr-adv-interval>600</max-rtr-adv-interval>
            <min-rtr-adv-interval>200</min-rtr-adv-interval>
            <managed-flag>true</managed-flag>
            <other-config-flag>true</other-config-flag>
            <reachable-time>10</reachable-time>
            <retrans-timer>1000</retrans-timer>
            <cur-hop-limit>10</cur-hop-limit>
            <default-lifetime>2222</default-lifetime>
            <prefix-list>
              <prefix>
                <prefix-spec>111::/64</prefix-spec>
                <valid-lifetime>1000</valid-lifetime>
                <on-link-flag>true</on-link-flag>
                <preferred-lifetime>111</preferred-lifetime>
                <autonomous-flag>true</autonomous-flag>
              </prefix>
            </prefix-list>
          </ipv6-router-advertisements>
        </ipv6>
      </interface>
    </interfaces-state>
  </data>
</rpc-reply>

Sample of successful response for displaying IPv6 static route data

##### Ok Reply or Operation Successful #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="14">
  <data>
    <routing xmlns="urn:ietf:params:xml:ns:yang:ietf-routing">
      <routing-instance>
        <name>default-routing-instance</name>
        <routing-protocols>
          <routing-protocol>
            <type>static</type>
            <name>default-routing-instance</name>
            <static-routes>
              <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing">
                <route>
                  <destination-prefix>111::1/64</destination-prefix>
                  <next-hop>
                    <special-next-hop>blackhole</special-next-hop>
                  </next-hop>
                </route>
              </ipv6>
            </static-routes>
            <enabled>true</enabled>
          </routing-protocol>
        </routing-protocols>
        <type xmlns:ietf-routing="urn:ietf:params:xml:ns:yang:ietf-routing">ietf-routing:default-routing-instance</type>
        <enabled>true</enabled>
      </routing-instance>
    </routing>
  </data>
</rpc-reply>

Sample of failed response

##### Error Reply or Operation Failed #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="25">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>invalid-value</error-tag>
    <error-severity>error</error-severity>
    <error-message>validation failed</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2019-03-30

Document ID: EDOC1000178028

Views: 4459

Downloads: 0

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