< Home

Configuring OSPF

This section provides a sample of configuring OSPF using the edit-config:merge method.

Table 1 Configuring OSPF

Operation

XPATH

edit-config:merge

  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/process-id
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/area/area-id
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/area/network
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/import-route/static-protocol/static
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/import-route/static-protocol/cost
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/import-route/static-protocol/type
  • /ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/import-route/static-protocol/tag
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/ospf-process-id
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/area-id
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/network-type
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/timer-hello
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/timer-dead
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/authentication/authentication-mode
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/authentication/key-id
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/authentication/auth-text-type
  • /ietf-interfaces:interfaces/interface/huawei-ospf:ospf/authentication/cipher-text

Data Requirements

Item

Data

Description

Creating and running an OSPF process

2

Create and run OSPF process 2.

Creating an OSPF area

0.0.0.2

Create OSPF area 0.0.0.2.

Interface that runs OSPF and the area to which the interface belongs

10.0.0.0/8

Specify the interface that runs OSPF and the area to which the interface belongs as 10.0.0.0 0.255.255.255.

Static routing protocol from which routes are imported

true

Import static routes.

Route cost

2

Set the route cost to 2.

Type of external routes

1

Set the type of external routes to Type 1.

Tag of an external LSA

2

Set the tag of an external LSA to 2.

Enabling an OSPF process on an interface

2

Enable OSPF process 2 on an interface.

Enabling an OSPF area on an interface

2

Enable an OSPF area 0.0.0.2 on an interface.

Network type of an OSPF interface

nbma

Set the network type of an OSPF interface to NBMA.

Interval for sending Hello packets on an interface

40

Set the interval for sending Hello packets on an interface to 40s.

Dead interval after which an interface considers its OSPF neighbor invalid

50

Set the dead interval after which an interface considers its OSPF neighbor invalid to 50s.

Authentication mode between neighboring devices

md5

Set the authentication mode between neighboring devices to MD5 authentication.

Authentication key ID for cipher authentication on an interface

2

Set the authentication key ID to 2 for cipher authentication on an interface.

Specifying a plaintext or ciphertext password

cipher

Set a ciphertext password.

Ciphertext password

password

Set the ciphertext password as password.

Request Example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="8" 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>1</rt:name>
          <rt:routing-protocols>
            <rt:routing-protocol>
              <rt:type xmlns:huawei-ospf="urn:huawei:params:xml:ns:yang:huawei-ospf">huawei-ospf:ospf-routing-protocol</rt:type>
              <rt:name>ospf</rt:name>
              <hw-ospf:ospf xmlns:hw-ospf="urn:huawei:params:xml:ns:yang:huawei-ospf">
                <hw-ospf:instance>
                  <hw-ospf:process-id>2</hw-ospf:process-id>
                  <hw-ospf:import-route>
                    <hw-ospf:static-protocol>
                      <hw-ospf:static>true</hw-ospf:static>
                      <hw-ospf:cost>2</hw-ospf:cost>
                      <hw-ospf:type>1</hw-ospf:type>
                      <hw-ospf:tag>2</hw-ospf:tag>
                    </hw-ospf:static-protocol>
                  </hw-ospf:import-route>
                  <hw-ospf:area>
                    <hw-ospf:area-id>0.0.0.2</hw-ospf:area-id>
                    <hw-ospf:network>10.0.0.0/8</hw-ospf:network>
                  </hw-ospf:area>
                </hw-ospf:instance>
              </hw-ospf:ospf>
            </rt:routing-protocol>
          </rt:routing-protocols>
        </rt:routing-instance>
      </rt:routing>
      <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>Vlanif10</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual</if:type>
          <hw-ospf:ospf xmlns:hw-ospf="urn:huawei:params:xml:ns:yang:huawei-ospf">
            <hw-ospf:ospf-process-id>2</hw-ospf:ospf-process-id>
            <hw-ospf:area-id>2</hw-ospf:area-id>
            <hw-ospf:network-type>nbma</hw-ospf:network-type>
            <hw-ospf:timer-hello>40</hw-ospf:timer-hello>
            <hw-ospf:timer-dead>50</hw-ospf:timer-dead>
            <hw-ospf:authentication>
              <hw-ospf:authentication-mode>md5</hw-ospf:authentication-mode>
              <hw-ospf:auth-text-type>cipher</hw-ospf:auth-text-type>
              <hw-ospf:key-id>2</hw-ospf:key-id>
              <hw-ospf:cipher-text>password</hw-ospf:cipher-text>
            </hw-ospf:authentication>
          </hw-ospf:ospf>
        </if:interface>
      </if:interfaces>
    </config>
  </edit-config>
</rpc>

Response Example

Sample of successful response

##### 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="8">
  <ok/>
</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="8">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>OSPF area id cannot be empty.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Vlanif10"]/huawei-ospf:ospf</error-info>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic