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

IPv4 Static Route Management

This section describes the configuration model of IPv4 static route management and provides XML packet examples.

Data Model

The configuration model files matching IPv4 static route management are ietf-routing.yang, ietf-ipv4-unicast-routing, and huawei-ipv4-static-route.

Table 2-171  IPv4 static route management

Object

Description

Value Remarks

/ietf-routing:routing/routing-instance/name

Indicates a routing instance name.

The value is a string of 1 to 31 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces.

Before configuring this object, you need to configure huawei-l3vpn:vpn-instances/vpn-instance/vpn-instance-name.

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/type

Indicates a route type.

Currently, only static routes are supported.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/name

Indicates a routing protocol instance name.

The value is a string of 1 to 31 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route /destination-prefix

Indicates a route prefix.

The value is in dotted decimal notation.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route /description

Indicates a route description.

The value is a string of 1 to 80 case-sensitive characters without question marks (?). It can contain spaces.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route /next-hop/next-hop-address

Indicates a next-hop address.

The value is in dotted decimal notation.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route /next-hop/outgoing-interface

Indicates a next-hop outbound interface.

-

Before configuring this object, you need to configure /if:interfaces/if:interface/if:name and /rt:routing/rt:routing-instance/rt:interfaces/rt:interface.

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route /next-hop/special-next-hop

Indicates a special next hop.

Currently, only a blackhole next hop is supported.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ ietf-ipv4-unicast-routing:ipv4/route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/ipv4-address-nexthop/next-hop-address

Indicates a next-hop IP address in multi next-hop scenarios.

The value is in dotted decimal notation.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ ietf-ipv4-unicast-routing:ipv4/route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/ipv4-address-nexthop/next-hop-address/preference

Indicates the route priority in multi next-hop scenarios.

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

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/" "route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/egress-interface-ipv4-nexthop/next-hop-address

Indicates an IP address in multi next-hop scenarios.

The value is in dotted decimal notation.

NA

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/" "route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/egress-interface-ipv4-nexthop/outgoing-interface

Indicates an outbound interface in multi next-hop scenarios.

-

Before configuring this object, you need to configure /if:interfaces/if:interface/if:name and /rt:routing/rt:routing-instance/rt:interfaces/rt:interface.

/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/" "route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/egress-interface-ipv4-nexthop/preference

Indicates the route priority in multi next-hop scenarios.

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

NA

Configuring IPv4 Static Routes

This section describes how to configure IPv4 static routes using rpc.

Table 2-172  Configuring an IPv4 static route

Operation

XPATH

edit-config:merge

  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route/description
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/ipv4-address-nexthop
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/ietf-ipv4-unicast-routing:ipv4/route/next-hop/next-hop-options/huawei-ipv4-static-route:multiple-path/egress-interface-ipv4-nexthop
Data Requirements

Item

Data

Description

Routing instance name

name

Indicates a static routing instance name.

VPN instance name

name

Indicates a VPN instance name.

Route prefix

destination-prefix

Indicates a route prefix.

Next hop of a route.

next-hop

Indicates next-hop information.

Description

description

Indicates a description.

Next hop of a route.

ipv4-address-nexthop

Indicates next-hop information.

Priority

preference

Indicates a route priority.

Outbound interface

outgoing-interface

Indicates a next-hop outbound interface for a route.

Request example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-l3vpn:vpn-instances xmlns:hw-l3vpn="urn:huawei:params:xml:ns:yang:huawei-l3vpn">
        <hw-l3vpn:vpn-instance>
          <hw-l3vpn:vpn-instance-name>vpna</hw-l3vpn:vpn-instance-name>
        </hw-l3vpn:vpn-instance>
      </hw-l3vpn:vpn-instances>
      <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing">
        <rt:routing-instance>
          <rt:name>vpna</rt:name>
          <rt:routing-protocols>
            <rt:routing-protocol>
              <rt:type>rt:static</rt:type>
              <rt:name>aaa</rt:name>
              <rt:static-routes>
                <v4ur:ipv4 xmlns:v4ur="urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing">
                  <v4ur:route>
                    <v4ur:destination-prefix>100.1.1.1/24</v4ur:destination-prefix>
                    <v4ur:description>123</v4ur:description>
                    <v4ur:next-hop>
                      <v4ur:special-next-hop>blackhole</v4ur:special-next-hop>
                    </v4ur:next-hop>
                  </v4ur:route>
                </v4ur:ipv4>
              </rt:static-routes>
            </rt:routing-protocol>
          </rt:routing-protocols>
        </rt:routing-instance>
      </rt:routing>
      <hw-l3vpn:vpn-instances xmlns:hw-l3vpn="urn:huawei:params:xml:ns:yang:huawei-l3vpn">
        <hw-l3vpn:vpn-instance>
          <hw-l3vpn:vpn-instance-name>vpna</hw-l3vpn:vpn-instance-name>
        </hw-l3vpn:vpn-instance>
      </hw-l3vpn:vpn-instances>
      <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing">
        <rt:routing-instance>
          <rt:name>vpna</rt:name>
          <rt:routing-protocols>
            <rt:routing-protocol>
              <rt:type>static</rt:type>
              <rt:name>aaa</rt:name>
              <rt:static-routes>
                <v4ur:ipv4 xmlns:v4ur="urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing">
                  <v4ur:route>
                    <v4ur:destination-prefix>110.1.1.1/24</v4ur:destination-prefix>
                    <v4ur:next-hop>
                      <hw-v4sr:ipv4-address-nexthop xmlns:hw-v4sr="urn:huawei:params:xml:ns:yang:hw-ipv4-static-route">
                        <hw-v4sr:next-hop-address>1.1.1.1</hw-v4sr:next-hop-address>
                      </hw-v4sr:ipv4-address-nexthop>
                    </v4ur:next-hop>
                  </v4ur:route>
                </v4ur:ipv4>
              </rt:static-routes>
            </rt:routing-protocol>
          </rt:routing-protocols>
        </rt:routing-instance>
      </rt:routing>
      <hw-l3vpn:vpn-instances xmlns:hw-l3vpn="urn:huawei:params:xml:ns:yang:huawei-l3vpn">
        <hw-l3vpn:vpn-instance>
          <hw-l3vpn:vpn-instance-name>vpna</hw-l3vpn:vpn-instance-name>
        </hw-l3vpn:vpn-instance>
      </hw-l3vpn:vpn-instances>
      <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>Vlanif123</if:name>
          <if:type>propVirtual</if:type>
        </if:interface>
      </if:interfaces>
      <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing">
        <rt:routing-instance>
          <rt:name>vpna</rt:name>
          <rt:interfaces>
            <rt:interface>Vlanif123</rt:interface>
          </rt:interfaces>
          <rt:routing-protocols>
            <rt:routing-protocol>
              <rt:type>static</rt:type>
              <rt:name>aaa</rt:name>
              <rt:static-routes>
                <v4ur:ipv4 xmlns:v4ur="urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing">
                  <v4ur:route>
                    <v4ur:destination-prefix>120.1.1.1/24</v4ur:destination-prefix>
                    <v4ur:next-hop>
                      <hw-v4sr:egress-interface-ipv4-nexthop xmlns:hw-v4sr="urn:huawei:params:xml:ns:yang:hw-ipv4-static-route">
                        <hw-v4sr:outgoing-interface>Vlanif123</hw-v4sr:outgoing-interface>
                        <hw-v4sr:next-hop-address>1.1.1.1</hw-v4sr:next-hop-address>
                        <hw-v4sr:preference>100</hw-v4sr:preference>
                      </hw-v4sr:egress-interface-ipv4-nexthop>
                    </v4ur:next-hop>
                  </v4ur:route>
                </v4ur:ipv4>
              </rt:static-routes>
            </rt:routing-protocol>
          </rt:routing-protocols>
        </rt:routing-instance>
      </rt:routing>
    </config>
  </edit-config>
</rpc>
Response example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
  <rpc-error>
    <error-app-tag>1</error-app-tag>
    <error-message>Service process failed.</error-message>
    <error-info>Error on node /ietf-routing:routing/routing-instance[name="vpna"]/routing-protocols/routing-protocol[type="static",name="aaa"]/static-routes/ietf-ipv4-unicast-routing:ipv4/route[destination-prefix="100.1.1.1/24"]/next-hop/huawei-ipv4-static-route:ipv4-address-nexthop[next-hop-address="1.1.1.1"]</error-info>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2019-03-30

Document ID: EDOC1000178028

Views: 4322

Downloads: 0

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