Vous êtes sur la page 1sur 41

NE Series Routers OSPF Protocol

Features Practice Guide

NE Series Routers OSPF Protocol Features Practice Guide

Table of Contents

Table of Contents
Experiment Description ....................................................................................................................1
Experiment Description ................................................................................................................1
Experiment Objectives .................................................................................................................1
Experiment Tasks ........................................................................................................................1
Relevant Materials .......................................................................................................................1
Chapter 1 OSPF Single-area Experiment Guide .............................................................................2
1.1 Networking and Service Description ......................................................................................2
1.2 Command Line List ................................................................................................................2
1.3 Configuration Flow .................................................................................................................3
1.4 Configuration Procedure ........................................................................................................3
1.5 Result Verification ..................................................................................................................3
1.6 FAQ ........................................................................................................................................6
1.7 Configuration Reference ........................................................................................................7
1.7.1 Configure the Port .......................................................................................................7
1.7.2 OSPF Configuration ....................................................................................................8
Chapter 2 OSPF Multi-area Experiment Guide ............................................................................ 10
2.1 Networking and Service Description ................................................................................... 10
2.2 Command Line List ............................................................................................................. 10
2.3 Configuration Flow .............................................................................................................. 11
2.4 Configuration Procedure ..................................................................................................... 11
2.5 Result Verification ............................................................................................................... 11
2.6 FAQ ..................................................................................................................................... 14
2.7 Configuration Reference ..................................................................................................... 14
2.7.1 Configure the Port .................................................................................................... 14
2.7.2 OSPF Configuration ................................................................................................. 15
Chapter 3 OSPF Route Aggregration Configuration Guide ....................................................... 17
3.1 Networking and Service Introduction: ................................................................................. 17
3.2 Command Line List ............................................................................................................. 17
3.3 Configuration Flow .............................................................................................................. 18
3.4 Configuration Procedure ..................................................................................................... 18
3.5 Result Verification ............................................................................................................... 18
3.6 Configuration Reference ..................................................................................................... 19
3.6.1 Configure the Port .................................................................................................... 19
3.6.2 OSPF Configuration ................................................................................................. 20
Chapter 4 Experiment Guide to OSPF Electing DR/BDR............................................................ 21
4.1 Networking and Service Description ................................................................................... 21
4.2 Command Line List ............................................................................................................. 21
4.3 Configuration Flow .............................................................................................................. 22
4.4 Configuration Procedure ..................................................................................................... 22
4.5 Result Verification ............................................................................................................... 22
4.6 FAQ ..................................................................................................................................... 24
4.7 Configuration Reference ..................................................................................................... 24
4.7.1 Configure the Port .................................................................................................... 24
4.7.2 OSPF Configuration ................................................................................................. 24
Chapter 5 Area Authentication Configuration Guide.................................................................. 26
5.1 Networking and Service Description ................................................................................... 26
5.2 Command Line List ............................................................................................................. 26
5.3 Configuration Flow .............................................................................................................. 27
5.4 Configuration Procedure ..................................................................................................... 27
5.5 Result Verification ............................................................................................................... 28
Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Table of Contents

5.6 Configuration Reference ..................................................................................................... 29


5.6.1 Configure the Port .................................................................................................... 29
5.6.2 OSPF Configuration ................................................................................................. 29
Chapter 6 STUB Area Configuration Guide ................................................................................. 31
6.1 Networking and Service Introduction .................................................................................. 31
6.2 Command Line List ............................................................................................................. 31
6.3 Configuration Procedure ..................................................................................................... 32
6.4 Result Verification ............................................................................................................... 32
6.4.1 Before Configuration: ............................................................................................... 32
6.4.2 After Configuring Area 1 to Stub .............................................................................. 32
6.5 Configuration Reference ..................................................................................................... 34
6.5.1 Configure the Port .................................................................................................... 34
6.5.2 OSPF Configuration ................................................................................................. 35
6.5.3 Configure stub area .................................................................................................. 36

ii

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to the


text that you want to appear here.

Experiment Description
Experiment Description
This experiment guide introduces the configuration methods and configuration
procedure of the basic services of OSPF protocol, and covers the currently prevalent
technologies of OSPF. It is designed to help you understand the configuration methods
and configuration procedure of the basic services of OSPF.

Experiment Objectives



Understand configuration procedures of different applications of OSPF


Get familiar with the configuration commands of relevant applications of OSPF

Experiment Tasks








Configure OSPF area


Configure OSPF area
OSPF route aggregation configuration
Configure DR/BDR election
Configure area authentication
STUB area configuration
Configure NSSA area

Relevant Materials


VRP Operation Manual

Confidential Information of Huawei. No Spreading without Permission

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

NE Series Routers OSPF Protocol Features Practice Guide

Chapter 1 OSPF Single-area Experiment Guide


1.1 Networking and Service Description

4 routers RTA, RTB, RTC and RTD run the OSPF concurrently, and belong to the
same area, i.e., Area 0.
By running OSPF, communication between routers is implemented.

1.2 Command Line List


Table 1-1
Operation

Version

Configure Router ID

VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10

Enable OSPF and Enter the


OSPF View
Enter OSPF Area view
Run OSPF protocol on the
specified network segment

Command

router id router-id
router id router-id
ospf [ process-id ] [ router-id router-id ]
ospf [ process-id ] [ router-id router-id ]
Area area-id
Area area-id
network ip-address wildcard-mask
network ip-address wildcard-mask

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

1.3 Configuration Flow

Figure 1-1

1.4 Configuration Procedure


1)

Specify the router ID

In system-view, specify a router ID. Generally, the Loopback address is used as a


router ID.
2)

Run OSPF

In system-view, run OSPF, and adopt the default OSPF process 1.


3)

Create an area

In the OSPF view, create a backbone area: Area 0.


4)

Declare the network

In the Area view, declare the corresponding network. Different routers declare different
networks. For example, 10.1.1.0 and 192.2.2.0 are declared on the router RTB.

1.5 Result Verification


1)

The networks of each device can access each other (as tested via the ping
command)

[RTA]ping -a 1.1.1.1 3.3.3.3


PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=29
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=29
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=29
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=28
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=28

ms
ms
ms
ms
ms

--3.30.30.3 ping statistics-5 packet(s) transmitted


5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 28/28/3 ms

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

2)

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

Use the display ip routing-table command to check the routing table.

[RTA]display ip routing-table
Routing Tables: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
DIRECT
0
2.2.2.2/32
OSPF
10
3.3.3.3/32
OSPF
10

Cost
0
2
1564

4.4.4.4/32
10.1.1.0/30
10.1.1.1/32
10.2.2.0/30
127.0.0.0/8
127.0.0.1/32
192.1.1.0/30
192.1.1.1/32
192.1.1.2/32
192.2.2.0/30

1563
0
0
1563
0
0
0
0
0
1563

OSPF
DIRECT
DIRECT
OSPF
DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
OSPF

10
0
0
10
0
0
0
0
0
10

[RTB]display ip routing-table
Routing Tables: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
DIRECT
0
3.3.3.3/32
OSPF
10
4.4.4.4/32
OSPF
10

Cost
2
0
1563
1564

10.1.1.0/30
10.1.1.2/32
10.2.2.0/30
127.0.0.0/8
127.0.0.1/32
192.1.1.0/30
192.2.2.0/30
192.2.2.1/32
192.2.2.2/32

0
0
1563
0
0
1563
0
0
0

DIRECT
DIRECT
OSPF
DIRECT
DIRECT
OSPF
DIRECT
DIRECT
DIRECT

0
0
10
0
0
10
0
0
0

[RTC]display ip routing-table
Routing Tables: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10

Cost
1564

2.2.2.2/32
3.3.3.3/32
4.4.4.4/32
10.1.1.0/30
10.2.2.0/30
10.2.2.2/32
127.0.0.0/8
127.0.0.1/32
192.1.1.0/30
192.2.2.0/30
192.2.2.1/32
192.2.2.2/32

1563
0
2
1563
0
0
0
0
1563
0
0
0

OSPF
DIRECT
OSPF
OSPF
DIRECT
DIRECT
DIRECT
DIRECT
OSPF
DIRECT
DIRECT
DIRECT

10
0
10
10
0
0
0
0
10
0
0
0

[RTD]display ip routing-table
Routing Tables: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
OSPF
10

Cost
1563
1564

3.3.3.3/32
4.4.4.4/32
10.1.1.0/30

2
0
1563

OSPF
DIRECT
OSPF

10
0
10

Nexthop
127.0.0.1
10.1.1.2
10.1.1.2
192.1.1.2
192.1.1.2
10.1.1.1
127.0.0.1
192.1.1.2
127.0.0.1
127.0.0.1
192.1.1.1
127.0.0.1
192.1.1.2
10.1.1.2

Interface
InLoopBack0
Ethernet0/0
Ethernet0/0
Serial2/0
Serial2/0
Ethernet0/0
InLoopBack0
Serial2/0
InLoopBack0
InLoopBack0
Serial2/0
InLoopBack0
Serial2/0
Ethernet0/0

Nexthop
10.1.1.1
127.0.0.1
192.2.2.1
10.1.1.1
192.2.2.1
10.1.1.2
127.0.0.1
192.2.2.1
127.0.0.1
127.0.0.1
10.1.1.1
192.2.2.2
192.2.2.1
127.0.0.1

Interface
Ethernet0/0
InLoopBack0
Serial2/0
Ethernet0/0
Serial2/0
Ethernet0/0
InLoopBack0
Serial2/0
InLoopBack0
InLoopBack0
Ethernet0/0
Serial2/0
Serial2/0
InLoopBack0

Nexthop
10.2.2.1
192.2.2.2
192.2.2.2
127.0.0.1
10.2.2.1
192.2.2.2
10.2.2.2
127.0.0.1
127.0.0.1
127.0.0.1
10.2.2.1
192.2.2.1
127.0.0.1
192.2.2.2

Interface
Ethernet0/0
Serial2/0
Serial2/0
InLoopBack0
Ethernet0/0
Serial2/0
Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0
Ethernet0/0
Serial2/0
InLoopBack0
Serial2/0

Nexthop
192.1.1.1
10.2.2.2
192.1.1.1
10.2.2.2
127.0.0.1
192.1.1.1

Interface
Serial2/0
Ethernet0/0
Serial2/0
Ethernet0/0
InLoopBack0
Serial2/0

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide


10.2.2.0/30
10.2.2.1/32
127.0.0.0/8
127.0.0.1/32
192.1.1.0/30
192.1.1.1/32
192.1.1.2/32
192.2.2.0/30

DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
OSPF

0
0
0
0
0
0
0
10

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

0
0
0
0
0
0
0
1563

10.2.2.1
127.0.0.1
127.0.0.1
127.0.0.1
192.1.1.2
192.1.1.1
127.0.0.1
10.2.2.2

Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0
Serial2/0
Serial2/0
InLoopBack0
Ethernet0/0

 Note:
Each channel of router learns other route information through OSPF and provide interconnection of
network. From the routing table, we can see that the OSPF can support equivalent routes. For example, on
the RTD, the data that reaches 2.2.2.2/32 can be sent to 10.2.2.2, or sent to 192.1.1.1.
3)

Use the display ospf routing command to check the OSPF routing table.

[RTA] display ospf routing


OSPF Process 1 with Router ID 1.1.1.1
Routing Tables:
Routing for Network
Destination
Cost Type NextHop
AdvRouter
10.1.1.0/30
1 Net 10.1.1.1
1.1.1.1
192.2.2.0/30
1563 Stub 10.1.1.2
2.2.2.2
2.2.2.2/32
2 Stub 10.1.1.2
2.2.2.2
1.1.1.1/32
1 Stub 1.1.1.1
1.1.1.1
192.1.1.0/30
1562 Stub 192.1.1.1
1.1.1.1
10.2.2.0/30
1563 Net 192.1.1.2
3.3.3.3
4.4.4.4/32
1563 Stub 192.1.1.2
4.4.4.4
3.3.3.3/32
1564 Stub 192.1.1.2
3.3.3.3
10.1.1.2
Total Nets: 8
Intra Area: 8 Inter Area: 0 ASE: 0 NSSA: 0

4)

Area
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0

Use the display ospf lsdb command to check the link state database.

[RTA] display ospf lsdb


OSPF Process 1 with Router ID 1.1.1.1
Link State Database

Type
Stub
Stub
Stub
Stub
Stub
Stub
Rtr
Rtr
Rtr
Rtr
Net
Net

LinkState ID
192.2.2.0
2.2.2.2
4.4.4.4
192.1.1.0
1.1.1.1
3.3.3.3
2.2.2.2
4.4.4.4
1.1.1.1
3.3.3.3
10.1.1.1
10.2.2.2

Area: 0.0.0.0
AdvRouter
2.2.2.2
2.2.2.2
4.4.4.4
1.1.1.1
1.1.1.1
3.3.3.3
2.2.2.2
4.4.4.4
1.1.1.1
3.3.3.3
1.1.1.1
3.3.3.3

Age
149
136
162
162
125
149
137
163
125
151
241
189

Len
24
24
24
24
24
24
72
72
72
72
32
32

Sequence
0
0
0
0
0
0
80000009
80000009
80000009
80000009
80000001
80000001

Metric
0
0
0
0
0
0
0
0
0
0
0
0

Where
SpfTree
SpfTree
SpfTree
SpfTree
SpfTree
SpfTree
Clist
Clist
SpfTree
Clist
SpfTree
SpfTree

 Note:
The OSPF describes the network topology of an area through the correct LSA. Note that each database
type represents a different type of LSA in the OSPF. Listed below are common LAS types:
Stub: LSA of route connected to an end network. (Note: End network refers to edge network, and is not the
same concept as Stub area.)
Rtr: Router LSA
Net: Network LSA
Snet: Network summary LSA
Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

ASB: Border router summary LSA of autonomous system


ASE: External LSA of autonomous system
NSSA: External LSA of NSSA
5)

Use the display ospf brief command to check the summary information of OSPF;

[RTA]display ospf brief


OSPF Process 1 with Router ID 1.1.1.1
OSPF Protocol Information
RouterID: 1.1.1.1
Spf-schedule-interval: 5
Routing preference: Inter/Intra: 10 External: 150
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
SPF computation count: 10
Area Count: 1
Nssa Area Count: 0
Area 0.0.0.0:
Authtype: none
Flags: <>
SPF scheduled: <>
Interface 10.1.1.1 (Ethernet0/0)
Cost: 1 State: DR
Type: Broadcast
Priority: 1
Designated Router: 10.1.1.1
Backup Designated Router: 10.1.1.2
Timers : Hello 10,Dead 40,Poll 40,Retransmit 5,Transmit Delay 1
Interface 192.1.1.1 (Serial2/0) --> 192.1.1.2
Cost: 1562 State: PtoP
Type: PointToPoint
Priority: 1
Timers : Hello 10,Dead 40,Poll 40,Retransmit 5,Transmit Delay 1
Interface 1.1.1.1 (LoopBack0) --> 1.1.1.1
Cost: 1 State: PtoP
Type: PointToPoint
Priority: 1
Timers : Hello 10,Dead 40,Poll 40,Retransmit 5,Transmit Delay 1

 Note:
The display ospf brief command can be used to check all OSPF-related information except routing
information, e.g., neighbor information, network type, DR/BDR, Hello time, and so on. It is one of the
frequently used commands for detecting error.
Other router-related information can also be viewed via the above commands, which is not described here
any further.

1.6 FAQ
Q: What does neighbor relationship mean in the OSPF?
A: Neighbor means the router on the same network link.
Q: What does neighboring relationship in OSPF?
A: Neighboring relationship is based on the neighbor relationship. When two neighbors
have synchronized the OSPF database, a neighboring relationship is developed
between them.
Q: How many network types are supported by OSPF?

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

A: P2P, P2MP, NBMA and Broadcast. In addition, in the NBMA network, the neighbor
relationship needs to be created manually.
Q: Does equivalent router exist in the current networking diagram? How many
equivalent routes are supported by VRP3.30? How many equivalent routes are
supported by VRP5.10 as a maximum?
A: Yes, it exists. The VRP3.30 supports a maximum of 3 equivalent routes, and the
VRP5.10 supports a maximum of 6 equivalent routes.

1.7 Configuration Reference


1.7.1 Configure the Port
I. Configure RTA
<Quidway>system-view
[Quidway]sysname RTA
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 1.1.1.1 255.255.255.255
[RTA-LoopBack0]quit
[RTA]interface ethernet 0/0
[RTA-Ethernet0/0]ip address 10.1.1.1 255.255.255.252
[RTA-Ethernet0/0]quit
[RTA]interface serial 2/0
[RTA-Serial2/0]ip address 192.1.1.1 255.255.255.252
[RTA-Serial2/0]quit

II. Configure RTB


<Quidway>system-view
[Quidway]sysname RTB
[RTB]interface loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 255.255.255.255
[RTB-LoopBack0]quit
[RTB]interface Ethernet 0/0
[RTB-Ethernet0/0]ip address 10.1.1.2 255.255.255.252
[RTB-Ethernet0/0]quit
[RTB]interface serial 2/0
[RTB-Serial2/0]ip address 192.2.2.2 255.255.255.252
[RTB-Serial2/0]quit

III. Configure RTC


<Quidway>system-view
[Quidway]sysname RTC
[RTC]interface loopback 0
[RTC-LoopBack0]ip address 3.3.3.3 255.255.255.255
[RTC-LoopBack0]quit
[RTC]interface Ethernet 0/0
[RTC-Ethernet2/0]ip address 10.2.2.2 255.255.255.252
[RTC-Ethernet2/0]quit
[RTC]interface serial 2/0
[RTC-Serial2/0]ip address 192.2.2.1 255.255.255.252
[RTC-Serial2/0]quit

IV. Configure RTD


<Quidway>system-view
[Quidway]sysname RTD

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

[RTD]interface loopback 0
[RTD-LoopBack0]ip address 4.4.4.4 255.255.255.255
[RTD-LoopBack0]quit
[RTD]interface ethernet 0/0
[RTD-Ethernet0/0]ip address 10.2.2.1 255.255.255.252
[RTD-Ethernet0/0]quit
[RTD]interface serial 2/0
[RTD-Serial2/0]ip address 192.1.1.2 255.255.255.252
[RTD-Serial2/0]quit

1.7.2 OSPF Configuration


I. Configure RTA
1)

Specify Router ID

[RTA]router id 1.1.1.1

2)

Run OSPF

[RTA]ospf 1

3)

Create area 0

[RTA-ospf-1]area 0

4)

Declare network in the area 0 view

[RTA-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3


[RTA-ospf-1-area-0.0.0.0]network 192.1.1.0 0.0.0.3
[RTA-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

II. Configure RTB


1)

Specify Router ID

[RTB]router id 2.2.2.2

2)

Run OSPF

[RTB]ospf 1

3)

Create area 0

[RTB-ospf-1]area 0

4)

Declare network in the area 0 view

[RTB-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3


[RTB-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3
[RTB-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

III. Configure RTC


1)

Specify Router ID

[RTC]router id 3.3.3.3

2)

Run OSPF

[RTC]ospf 1

3)

Create area 0

[RTC-ospf-1]area 0

4)

Declare network in the area 0 view

[RTC-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.3


[RTC-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3
[RTC-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

IV. Configure RTD


1)

Specify Router ID

[RTD]router id 4.4.4.4

2)

Run OSPF

[RTD]ospf 1

3)

Create area 0

[RTD-ospf-1]area 0

4)

Declare network in the area 0 view

[RTD-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.3


[RTD-ospf-1-area-0.0.0.0]network 192.1.1.0 0.0.0.3
[RTD-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

Confidential Information of Huawei. No Spreading without Permission

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

NE Series Routers OSPF Protocol Features Practice Guide

Chapter 2 OSPF Multi-area Experiment Guide


2.1 Networking and Service Description

Figure 2-1


Four routers RTA, RTB, RTC and RTD run the OSPF concurrently. As shown in
the figure, RTA and RTB belong to area 1, RTB and RTC belong to area 0, and
RTC and RTD belong to area 2 (Note: The 10.1.1.2/30 of RTA belongs to area 1,
and the 10.2.2.2/30 of RTC belongs to area 2)
The four routers use their respective loopback as their respective router ID.

2.2 Command Line List


Table 2-1
Operation

Configure Router ID
Enable OSPF and Enter the
OSPF View
Enter OSPF Area view
Run the OSPF protocol in the
specified network segment
10

Version

VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10

Command

router id router-id
router id router-id
ospf [ process-id ] [ router-id router-id ]
ospf [ process-id ] [ router-id router-id ]
area area-id
area area-id
network ip-address wildcard-mask
network ip-address wildcard-mask

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice


Guide

Error! Use the Home tab to apply 1 to the


text that you want to appear here.Error! Use the
Home tab to apply 1 to the text that you
want to appear here.

2.3 Configuration Flow

Figure 2-2

2.4 Configuration Procedure


1)

Specify Router ID

In system-view, specify a router ID. Generally, the Loopback address is used as router
ID.
2)

Run OSPF

In system-view, run OSPF. Adopt the default OSPF process 1.


3)

Create an area

In the OSPF view, create the correseponding area. Different routers have different area
codes. For example, area 0 and area 1 should be created on router B.
4)

Declare network

Declare the network in the corresponding area view. Different routers declare different
networks. For example, area 0 of router RTB should only declare 192.2.2.0.

2.5 Result Verification


1)

Use the Ping or Tracert command to detect the connectivity of the network;

[RTA]ping 10.2.2.1
PING 10.2.2.1: 56 data bytes, press CTRL_C to break
Reply from 10.2.2.1: bytes=56 Sequence=1 ttl=253 time=30
Reply from 10.2.2.1: bytes=56 Sequence=2 ttl=253 time=29
Reply from 10.2.2.1: bytes=56 Sequence=3 ttl=253 time=29
Reply from 10.2.2.1: bytes=56 Sequence=4 ttl=253 time=29
Reply from 10.2.2.1: bytes=56 Sequence=5 ttl=253 time=28

ms
ms
ms
ms
ms

--10.20.20.1 ping statistics-5 packet(s) transmitted


5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 28/29/3 ms

Confidential Information of Huawei. No Spreading without Permission

11

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

[RTA]tracert 10.2.2.1
traceroute to 10.2.2.1(10.2.2.1) 30 hops max,40 bytes packet
1 10.1.1.2 10 ms 2 ms 2 ms
2 192.2.2.1 20 ms 19 ms 20 ms
3 10.2.2.1 30 ms 20 ms 20 ms

2)

12

Use the display ip routing-table command to check the routing table.

[RTA]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
DIRECT
0
2.2.2.2/32
OSPF
10
3.3.3.3/32
OSPF
10
4.4.4.4/32
OSPF
10
10.1.1.0/30
DIRECT
0
10.1.1.1/32
DIRECT
0
10.2.2.0/30
OSPF
10
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
OSPF
10

Cost
0
2
1564
1565
0
0
1564
0
0
1563

Nexthop
127.0.0.1
10.1.1.2
10.1.1.2
10.1.1.2
10.1.1.1
127.0.0.1
10.1.1.2
127.0.0.1
127.0.0.1
10.1.1.2

Interface
InLoopBack0
Ethernet0/0
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
Ethernet0/0
InLoopBack0
InLoopBack0
Ethernet0/0

[RTB]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
DIRECT
0
3.3.3.3/32
OSPF
10
4.4.4.4/32
OSPF
10
10.1.1.0/30
DIRECT
0
10.1.1.2/32
DIRECT
0
10.2.2.0/30
OSPF
10
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
DIRECT
0
192.2.2.1/32
DIRECT
0
192.2.2.2/32
DIRECT
0

Cost
2
0
1563
1564
0
0
1563
0
0
0
0
0

Nexthop
10.1.1.1
127.0.0.1
192.2.2.1
192.2.2.1
10.1.1.2
127.0.0.1
192.2.2.1
127.0.0.1
127.0.0.1
192.2.2.2
192.2.2.1
127.0.0.1

Interface
Ethernet0/0
InLoopBack0
Serial2/0
Serial2/0
Ethernet0/0
InLoopBack0
Serial2/0
InLoopBack0
InLoopBack0
Serial2/0
Serial2/0
InLoopBack0

[RTC]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
OSPF
10
3.3.3.3/32
DIRECT
0
4.4.4.4/32
OSPF
10
10.1.1.0/30
OSPF
10
10.2.2.0/30
DIRECT
0
10.2.2.2/32
DIRECT
0
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
DIRECT
0
192.2.2.1/32
DIRECT
0
192.2.2.2/32
DIRECT
0

Cost
1564
1563
0
2
1563
0
0
0
0
0
0
0

Nexthop
192.2.2.2
192.2.2.2
127.0.0.1
10.2.2.1
192.2.2.2
10.2.2.2
127.0.0.1
127.0.0.1
127.0.0.1
192.2.2.1
127.0.0.1
192.2.2.2

Interface
Serial2/0
Serial2/0
InLoopBack0
Ethernet0/0
Serial2/0
Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0
Serial2/0
InLoopBack0
Serial2/0

[RTD]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
OSPF
10
3.3.3.3/32
OSPF
10
4.4.4.4/32
DIRECT
0
10.1.1.0/30
OSPF
10
10.2.2.0/30
DIRECT
0
10.2.2.1/32
DIRECT
0
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0

Cost
1565
1564
2
0
1564
0
0
0
0

Nexthop
10.2.2.2
10.2.2.2
10.2.2.2
127.0.0.1
10.2.2.2
10.2.2.1
127.0.0.1
127.0.0.1
127.0.0.1

Interface
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
Ethernet0/0
Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice


Guide
192.2.2.0/30

OSPF

10

Error! Use the Home tab to apply 1 to the


text that you want to appear here.Error! Use the
Home tab to apply 1 to the text that you
want to appear here.
1563

10.2.2.2

Ethernet0/0

 Note:
As compared with a single area, the result is exactly the same. Each router learns the routing information
of each other by running OSPF to provide connectivity for the network.

3)

Use the display ospf lsdb command to check the link state database. In
addition, other commands can be used to check the OSPF-related information.

[RTA]dis ospf lsdb


OSPF Process 1 with Router ID 1.1.1.1
Link State Database

Type
Stub
Rtr
Rtr
Net
SNet
SNet
SNet
SNet
SNet

LinkState ID
1.1.1.1
2.2.2.2
1.1.1.1
10.1.1.1
2.2.2.2
4.4.4.4
3.3.3.3
192.2.2.0
10.2.2.0

Area: 0.0.0.1
AdvRouter
Age Len Sequence
1.1.1.1
1055 24
0
2.2.2.2
1062 36
80000004
1.1.1.1
1055 48
80000007
1.1.1.1
1055 32
80000002
2.2.2.2
941 28
80000002
2.2.2.2
940 28 80000001
2.2.2.2
941 28 80000002
2.2.2.2
941 28 80000002
2.2.2.2
941 28 80000002

Metric Where
0 SpfTree
0 SpfTree
0 SpfTree
0 SpfTree
1 Uninitialized
1564 Uninitialized
1563 Uninitialized
1562 Uninitialized
1563 Uninitialized

[RTB]display ospf lsdb


OSPF Process 1 with Router ID 2.2.2.2
Link State Database

Type
Stub
Stub
Stub
Rtr
Rtr
Rtr
Rtr
Net
SNet
SNet
SNet
SNet

LinkState ID
2.2.2.2
192.2.2.0
3.3.3.3
2.2.2.2
4.4.4.4
1.1.1.1
3.3.3.3
10.2.2.1
4.4.4.4
10.1.1.0
1.1.1.1
10.2.2.0

Area: 0.0.0.0
AdvRouter
Age Len Sequence
2.2.2.2
1266 24
0
2.2.2.2
1203 24
0
3.3.3.3
1203 24
0
2.2.2.2
183 60
8000000b
4.4.4.4
1376 60
80000009
1.1.1.1
1375 60
80000007
3.3.3.3
184 60
8000000a
4.4.4.4
1968 32 80000002
3.3.3.3
1073 28 80000002
2.2.2.2
1135 28
80000002
2.2.2.2
1135 28
80000002
3.3.3.3
1073 28 80000003

Metric Where
0 SpfTree
0 SpfTree
0 SpfTree
0 SpfTree
0 Uninitialized
0 Uninitialized
0 SpfTree
0 Uninitialized
2 Uninitialized
1 Inter List
2 Inter List
1 Uninitialized

Type
Stub
Rtr
Rtr
Net
SNet
SNet
SNet
SNet
SNet

LinkState ID
1.1.1.1
2.2.2.2
1.1.1.1
10.1.1.1
2.2.2.2
4.4.4.4
3.3.3.3
192.2.2.0
10.2.2.0

Area: 0.0.0.1
AdvRouter
Age
1.1.1.1
1251
2.2.2.2
183
1.1.1.1
184
1.1.1.1
184
2.2.2.2
1135
2.2.2.2
1135
2.2.2.2
1135
2.2.2.2
1135
2.2.2.2
1135

Metric
0
0
0
0
1
1564
1563
1562
1563

Len
24
36
48
32
28
28
28
28
28

Sequence
0
80000005
80000008
80000003
80000002
80000001
80000002
80000002
80000002

Where
SpfTree
SpfTree
Clist
SpfTree
Inter List
Inter List
Inter List
Inter List
Inter List

 Note:
By comparing the LSDB of RTA and the LSDB of RTB, we can see that the ABR router, i.e., RTB, needs to
maintain the LSDB of two areas: area 1 and area 0.

Confidential Information of Huawei. No Spreading without Permission

13

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

2.6 FAQ
Q: Why are many external areas divided in the OSPF?
A: In order to reduce the calculation amount of SPF.
Q: Why can SPF calculation amount be reduced by setting up many areas?
A: Since the area division is used to divide the planar network into many hierarchical
netowrks, the size of the topology data table is reduced. When the network changes,
the SPF calculation is only specific to the changed area, so the SPF calculation amount
is reduced.

2.7 Configuration Reference


2.7.1 Configure the Port
I. Configure RTA
<Quidway>system-view
[Quidway]sysname RTA
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 1.1.1.1 255.255.255.255
[RTA-LoopBack0]quit
[RTA]interface ethernet 0/0
[RTA-Ethernet0/0]ip address 10.1.1.1 255.255.255.252
[RTA-Ethernet0/0]quit

II. Configure RTB


<Quidway>system-view
[Quidway]sysname RTB
[RTB]interface loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 255.255.255.255
[RTB-LoopBack0]quit
[RTB]interface Ethernet 0/0
[RTB-Ethernet0/0]ip address 10.1.1.2 255.255.255.252
[RTB-Ethernet0/0]quit
[RTB]interface serial 2/0
[RTB-Serial2/0]ip address 192.2.2.2 255.255.255.252
[RTB-Serial2/0]quit

III. Configure RTC


<Quidway>system-view
[Quidway]sysname RTC
[RTC]interface loopback 0
[RTC-LoopBack0]ip address 3.3.3.3 255.255.255.255
[RTC-LoopBack0]quit
[RTC]interface Ethernet 0/0
[RTC-Ethernet2/0]ip address 10.2.2.2 255.255.255.252
[RTC-Ethernet2/0]quit
[RTC]interface serial 2/0
[RTC-Serial2/0]ip address 192.2.2.1 255.255.255.252
[RTC-Serial2/0]quit

IV. Configure RTD


<Quidway>system-view

14

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice


Guide

Error! Use the Home tab to apply 1 to the


text that you want to appear here.Error! Use the
Home tab to apply 1 to the text that you
want to appear here.

[Quidway]sysname RTD
[RTD]interface loopback 0
[RTD-LoopBack0]ip address 4.4.4.4 255.255.255.255
[RTD-LoopBack0]quit
[RTD]interface ethernet 0/0
[RTD-Ethernet0/0]ip address 10.2.2.1 255.255.255.252
[RTD-Ethernet0/0]quit

2.7.2 OSPF Configuration


I. Configure RTA
1)

Specify Router ID

[RTA]router id 1.1.1.1

2)

Run OSPF

[RTA]ospf 1

3)

Create area 1

[RTA-ospf-1]area 1

4)

Declare network in the area 1 view

[RTA-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.3


[RTA-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0

II. Configure RTB


1)

Specify Router ID

[RTB]router id 2.2.2.2

2)

Run OSPF

[RTB]ospf 1

3)

Create area 0

[RTB-ospf-1]area 0

4)

Declare network in the area 0 view

[RTB-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3


[RTB-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

5)

Create area 1

[RTB-ospf-1]area 1

6)

Declare network in the area 1 view

[RTB-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.3

III. Configure RTC


1)

Specify Router ID

[RTC]router id 3.3.3.3

2)

Run OSPF

[RTC]ospf 1

3)

Create area 0

[RTC-ospf-1]area 0

4)

Declare network in the area 0 view

[RTC-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3


[RTC-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

Confidential Information of Huawei. No Spreading without Permission

15

NE Series Routers OSPF Protocol Features Practice Guide

5)

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

Create area 2

[RTC-ospf-1]area 2

6)

Declare network in the area 2 view

[RTC-ospf-1-area-0.0.0.2]network 10.2.2.0 0.0.0.3

IV. Configure Router D


1)

Specify Router ID

[RTD]router id 4.4.4.4

2)

Run OSPF

[RTD]ospf 1

3)

Create area 2

[RTD-ospf-1]area 2

4)

Declare network in the area 2 view

[RTD-ospf-1-area-0.0.0.2]network 10.2.2.0 0.0.0.3


[RTD-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0

16

Confidential Information of Huawei. No Spreading without Permission

Error! Use the Home tab to apply 1 to the


text that you want to appear here.Error! Use the
Home tab to apply 1 to the text that you
NE Series Routers OSPF Protocol Features Practice Guide
want to appear here.

Chapter 3 OSPF Route Aggregration


Configuration Guide
3.1 Networking and Service Introduction:
L2: 110.1.1.1/32

RTB

RTA
.1

R
L1: 110.1.1.2/32

10.1.1.0/30

.2

RTC
.1

Area 1

L0: 2.2.2.2/32

L0: 1.1.1.1/32

192.2.2.0/30

.2

Area 0

L0: 3.3.3.3/32

Figure 3-1


On the basis of multi-area routing experiment, add L1 and L2 interfaces on the


RTA, and enable OSPF. Perform route aggregration on the RTB.The route seen
on RTC is the converged route.

3.2 Command Line List


Table 3-1
Operation

Configure
the
Route
Summarization of OSPF
Area

Version

VRP 3.30
VRP 5.10

Command

abr-summary ip-address mask [ advertise |


not-advertise ]
abr-summary ip-address mask [ advertise |
not-advertise | cost cost ]

Confidential Information of Huawei. No Spreading without Permission

17

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

3.3 Configuration Flow

Figure 3-2

3.4 Configuration Procedure


1)

Configure interfaces.

The RTA creates two interface addresses: L1: 110.1.1.1/32 and L2:110.1.1.2/32.
2)

Declare network

In the area 1 view of RTA, declare the network corresponding to the newly created
interface.
3)

Configure aggregration on the ABR

Configure route aggregration of 110.1.1.0/24 in the area 1 view of RTB.

3.5 Result Verification


1)

The L1-L2 route of RTA displayed on RTC is a convergent route.

Before aggregration:
[RTC]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
OSPF
10
3.3.3.3/32
DIRECT
0
10.1.1.0/30
OSPF
10
110.1.1.1/32
OSPF
10
110.1.1.2/32
OSPF
10
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
DIRECT
0
192.2.2.1/32
DIRECT
0
192.2.2.2/32
DIRECT
0

Cost
1564
1563
0
1563
1564
1564
0
0
0
0
0

Nexthop
192.2.2.2
192.2.2.2
127.0.0.1
192.2.2.2
192.2.2.2
192.2.2.2
127.0.0.1
127.0.0.1
192.2.2.1
127.0.0.1
192.2.2.2

After aggregration:
18

Confidential Information of Huawei. No Spreading without Permission

Interface
Serial2/0
Serial2/0
InLoopBack0
Serial2/0
Serial2/0
Serial2/0
InLoopBack0
InLoopBack0
Serial2/0
InLoopBack0
Serial2/0

Error! Use the Home tab to apply 1 to the


text that you want to appear here.Error! Use the
Home tab to apply 1 to the text that you
NE Series Routers OSPF Protocol Features Practice Guide
want to appear here.
[RTC]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
OSPF
10
2.2.2.2/32
OSPF
10
3.3.3.3/32
DIRECT
0
10.1.1.0/30
OSPF
10
110.1.1.0/24
OSPF
10
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
DIRECT
0
192.2.2.1/32
DIRECT
0
192.2.2.2/32
DIRECT
0

Cost
1564
1563
0
1563
1564
0
0
0
0
0

Nexthop
192.2.2.2
192.2.2.2
127.0.0.1
192.2.2.2
192.2.2.2
127.0.0.1
127.0.0.1
192.2.2.1
127.0.0.1
192.2.2.2

Interface
Serial2/0
Serial2/0
InLoopBack0
Serial2/0
Serial2/0
InLoopBack0
InLoopBack0
Serial2/0
InLoopBack0
Serial2/0

3.6 Configuration Reference


3.6.1 Configure the Port
I. Configure RTA
<Quidway>system-view
[Quidway]sysname RTA
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 1.1.1.1 255.255.255.255
[RTA-LoopBack0]quit
[RTA]interface loopback 1
[RTA-LoopBack1]ip address 110.1.1.1 255.255.255.255
[RTA-LoopBack1]quit
[RTA]interface loopback 2
[RTA-LoopBack2]ip add 110.1.1.2 255.255.255.255
[RTA-LoopBack2]quit
[RTA]interface ethernet 0/0
[RTA-Ethernet0/0]ip address 10.1.1.1 255.255.255.252
[RTA-Ethernet0/0]quit

II. Configure RTB


<Quidway>system-view
[Quidway]sysname RTB
[RTB]interface loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 255.255.255.255
[RTB-LoopBack0]quit
[RTB]interface Ethernet 0/0
[RTB-Ethernet0/0]ip address 10.1.1.2 255.255.255.252
[RTB-Ethernet0/0]quit
[RTB]interface serial 2/0
[RTB-Serial2/0]ip address 192.2.2.2 255.255.255.252
[RTB-Serial2/0]quit

III. Configure RTC


<Quidway>system-view
[Quidway]sysname RTC
[RTC]interface loopback 0
[RTC-LoopBack0]ip address 3.3.3.3 255.255.255.255
[RTC-LoopBack0]quit
[RTC]interface serial 2/0
[RTC-Serial2/0]ip address 192.2.2.1 255.255.255.252
[RTC-Serial2/0]quit

Confidential Information of Huawei. No Spreading without Permission

19

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply


1 to the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to
appear here.

3.6.2 OSPF Configuration


I. Configure RTA
1)

Specify Router ID

[RTA]router id 1.1.1.1

2)

Run OSPF

[RTA]ospf 1

3)

Create area 1

[RTA-ospf-1]area 1

4)

Declare network in the area 1 view

[RTA-ospf-1-area-0.0.0.1]network
[RTA-ospf-1-area-0.0.0.1]network
[RTA-ospf-1-area-0.0.0.1]network
[RTA-ospf-1-area-0.0.0.1]network

10.1.1.0 0.0.0.3
1.1.1.1 0.0.0.0
110.1.1.1 0.0.0.0
110.1.1.2 0.0.0.0

II. Configure RTB


1)

Specify Router ID

[RTB]router id 2.2.2.2

2)

Run OSPF

[RTB]ospf 1

3)

Create area 0

[RTB-ospf-1]area 0

4)

Declare network in the area 0 view

[RTB-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3


[RTB-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

5)

Create area 1

[RTB-ospf-1]area 1

6)

Declare network in the area 1 view

[RTB-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.3

7)

RTB performs route aggregration on area 1.

[RTB-ospf-1-area-0.0.0.1]abr-summary 110.1.1.0 255.255.255.0 advertise

III. Configure RTC


1)

Specify Router ID

[RTC]router id 3.3.3.3

2)

Run OSPF

[RTC]ospf 1

3)

Create area 0

[RTC-ospf-1]area 0

4)

Declare network in the area 0 view

[RTC-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3


[RTC-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

20

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

Chapter 4 Experiment Guide to OSPF Electing


DR/BDR
4.1 Networking and Service Description

Figure 4-1


Two routers run OSPF concurrently, and are connected via Ethernet. Change the
DR priority of RTB to 100, and make it become a DR router in the network.

4.2 Command Line List


Table 4-1
Operation

Configure Router ID
Enable OSPF and Enter the
OSPF View
Enter OSPF Area view
Run OSPF protocol in the
specified network segment
Configure the interface with a
priority for DR election

Version

VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10

Command

router id router-id
router id router-id
ospf [ process-id ] [ router-id router-id ]
ospf [ process-id ] [ router-id router-id ]
area area-id
area area-id
network ip-address wildcard-mask
network ip-address wildcard-mask
ospf dr-priority priority_number
ospf dr-priority priority_number

Confidential Information of Huawei. No Spreading without Permission

21

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

4.3 Configuration Flow

Figure 4-2

4.4 Configuration Procedure


1)

Specify the Router ID

In system-view, specify a router ID. Generally, the Loopback address is used as router
ID.
2)

Set DR priorityof OSPF

In the Port view, Change the DR priority of RTB to 100.


3)

Run OSPF

In system-view, run OSPF, and adopt the default OSPF process 1.


4)

Create an area

In the OSPF view, create area 0.


5)

Declare network

In the corresponding Area view, declare the network.

4.5 Result Verification


1)

Use the display ospf brief command to check the summary information of the
router OSPF.

[RTA]display ospf brief


OSPF Process 1 with Router ID 1.1.1.1
OSPF Protocol Information
RouterID: 1.1.1.1
Spf-schedule-interval: 5
Routing preference: Inter/Intra: 10 External: 150
Default ASE parameters: Metric: 1 Tag: 1 Type: 2

22

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

SPF computation count: 11


Area Count: 1
Nssa Area Count: 0
Area 0.0.0.0:
Authtype: none
Flags: <>
SPF scheduled: <>
Interface: 10.1.1.1 (Ethernet0/0)
Cost: 1 State: BackupDR
Type: Broadcast
Priority: 1
Designated Router: 10.1.1.2
Backup Designated Router: 10.1.1.1
Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1
Interface: 1.1.1.1 (LoopBack0) --> 1.1.1.1
Cost: 1 State: PtoP
Type: PointToPoint
Priority: 1
Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1
[RTB]display ospf brief
OSPF Process 1 with Router ID 2.2.2.2
OSPF Protocol Information
RouterID: 2.2.2.2
Spf-schedule-interval: 5
Routing preference: Inter/Intra: 10 External: 150
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
SPF computation count: 10
Area Count: 1
Nssa Area Count: 0
Area 0.0.0.0:
Authtype: none
Flags: <>
SPF scheduled: <>
Interface: 10.1.1.2 (Ethernet0/0)
Cost: 1 State: DR
Type: Broadcast
Priority: 100
Designated Router: 10.1.1.2
Backup Designated Router: 10.1.1.1
Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1
Interface: 2.2.2.2 (LoopBack0) --> 2.2.2.2
Cost: 1 State: PtoP
Type: PointToPoint
Priority: 1
Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1

 Note:
As seen from the above information, the current RTB is the DR router in the network, and its preference
level is 100. But RTA is the BDR router in the network, and its preference level is the default value 1.
The DR election is decided by two parameters: DR priority and router ID.
The value range of DR priority is 0-255. Value 0 means no participation in the DR/BDR
election. Namely, the router is always DROther, and the DR priority of each router is 1.
Between routers, this parameter will be compared first to decide the DR. The higher the
value, the better.
Router ID: The router ID must exist if the router needs to run the OSPF protocol. If no ID
is configured, the system will select one from the IP addresses of the current interface
as the router ID. If the DR priorityis the same, the routers will compare the value of
router ID to decide the DR. The lower the router ID value, the better.

Confidential Information of Huawei. No Spreading without Permission

23

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

4.6 FAQ
Q: What is DR/BDR? What are their functions?
A: In order for each router to broadcast the local state information to the whole
autonomous system, many neighboring relationships should be set up between the
routers. This way, the route change of any router will be transferred repeatedly, and the
bandwidth resources will be wasted. In order to solve the problem, OSPF defines the
"Designated Router" (DR). All the routers only need to transmit information to the DR
for broadcasting the network link states. The router being the DR in its segment is not
specified manually.
Q: In the current network, the DR priority of RTB is 100, the DR priority of RTA is 1. Now
we change the DR priorityl of RTA to 200. Will it be changed to DR immediately?
A: No. The DR mechanism in the OSPF is on a lifelong basis. Unless the DR is
disconnected, the BDR will not be changed to DR. Once the BDR is changed to DR, the
OSPF network will not perform BDR election for DR any longer.

4.7 Configuration Reference


4.7.1 Configure the Port
I. Configure RTA
<Quidway>system-view
[Quidway]sysname RTA
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 1.1.1.1 255.255.255.255
[RTA-LoopBack0]quit
[RTA]interface ethernet 0/0
[RTA-Ethernet0/0]ip address 10.1.1.1 255.255.255.252
[RTA-Ethernet0/0]quit

II. Configure RTB


<Quidway>system-view
[Quidway]sysname RTB
[RTB]interface loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 255.255.255.255
[RTB-LoopBack0]quit
[RTB]interface Ethernet 0/0
[RTB-Ethernet0/0]ip address 10.1.1.2 255.255.255.252
[RTB-Ethernet0/0]quit

4.7.2 OSPF Configuration


I. Configure RTA
1)

Specify the router ID

[RTA]router id 1.1.1.1

2)

Run OSPF

[RTA]ospf 1

24

NE Series Routers OSPF Protocol Features Practice Guide

3)

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

Create area 0

[RTA-ospf-1]area 0

4)

Declare network in the area 0 view

[RTA-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3


[RTA-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

II. Configure RTB


1)

Specify the router ID

[RTB]router id 2.2.2.2

2)

Setting priority

[RTB-Ethernet0/0]ospf dr-priority 100

3)

Run the OSPF

[RTB]ospf 1

4)

Create area 0

[RTB-ospf-1]area 0

5)

Declare network in the area 0 view

[RTB-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3


[RTB-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

NOTE: After you complete the configuration, maybe you can find RTA is the DR. In this
case, you should reset the ospf process on RTA and RTB, to let the system votes DR
again.

Confidential Information of Huawei. No Spreading without Permission

25

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

Chapter 5 Area Authentication Configuration


Guide
5.1 Networking and Service Description

Figure 5-1


Run OSPF on RTA and RTB, and learn the loopback address of the opposite
party.
Use the Simple and Cipher authentication methods on the RTA to perform
regional authentication for RTB.

5.2 Command Line List


Table 5-1
Operation

Configure Router ID
Enable OSPF and Enter the
OSPF View
Enter OSPF Area view
Run the OSPF protocol in the
specified network segment
Configure the area to support
authentication type
Specify a password for OSPF
simple text authentication
Specify the key-id and key for

26

Version

VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30
VRP 5.10
VRP 3.30

Command

router id router-id
router id router-id
ospf [ process-id ] [ router-id router-id ]
ospf [ process-id ] [ router-id router-id ]
Area area-id
Area area-id
network ip-address wildcard-mask
network ip-address wildcard-mask
authentication-mode { simple | md5 }
authentication-mode { simple | md5 |
hmac-md5 }
ospf authentication-mode simple password
ospf authentication-mode simple [ plain |
cipher ] password
ospf authentication-mode md5 key_id key

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide


Operation

OSPF MD5 authentication

Version

VRP 5.10

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.
Command

ospf authentication-mode { md5 |


hmac-md5 } key-id [ plain | cipher ] password

5.3 Configuration Flow

Figure 5-2

5.4 Configuration Procedure


1)

2)

Authoring indication: [ List the steps required for completing the experiment, and
provide necessary description on each step. The description should help the
learner understand services more easily. Give the relevant parameters when
giving the configuration description (e.g., IP address, key and name listed below).
Try to make the configuration data normative, and avoid configuration conflict.]
Specify the router ID

In system-view, specify a router ID. Generally, the Loopback address is used as a


router ID.
3)

Run the OSPF

In system-view, run the OSPF. Apply the default OSPF process 1.


4)

Create an area

In OSPF view, create area 0.


5)

Declare network

In the Area view, declare the corresponding network, e.g., declare two networks 1.1.1.1
and 10.1.1.1 on the RTA.
6)

Run the area authentication


Confidential Information of Huawei. No Spreading without Permission

27

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

In the Area view, run the area authentication.


7)

Authenticate use of port

Under the corresponding port, apply the authentication mechanism and configure a
password.

5.5 Result Verification


1)

Use the display ip routing-table command to compare the routing table


information before and after RTA authentication.

When no authentication:
[RTA]display ip routing-table
Routing Tables: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
DIRECT
0
2.2.2.2/32
OSPF
10
10.1.1.0/30
DIRECT
0
10.1.1.1/32
DIRECT
0
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0

Cost
0
2
0
0
0
0

Nexthop
127.0.0.1
10.1.1.2
10.1.1.1
127.0.0.1
127.0.0.1
127.0.0.1

Interface
InLoopBack0
Ethernet0/0
Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0

Completing the configuration of authentication on RTA ,but do not configure


authentication on RTB ,you cant find the route toward 2.2.2.2/32.
[RTA]display ip routing-table
Routing Tables: public net
Destination/Mask
Protocol Pre Cost
Nexthop
Interface
1.1.1.1/32
DIRECT
0
0
127.0.0.1
InLoopBack0
10.1.1.0/30
DIRECT
0
0
10.1.1.1
Ethernet0/0
10.1.1.1/32
DIRECT
0
0
127.0.0.1
InLoopBack0
127.0.0.0/8
DIRECT
0
0
127.0.0.1
InLoopBack0
127.0.0.1/32
DIRECT
0
0
127.0.0.1
InLoopBack0

 Note:
If the authentication fails, the neighbor relationship cannot be established, and the previously learned
route 2.2.2.2 cannot be deleted from the routing table due to timeout.
2)

Then use the display ospf error command to check the error information.

When enable authentication on RTA, but dont enable it on RTB,you can find
errors occurred.
[RTA]display ospf error
OSPF Process 1 with Router ID 1.1.1.1
OSPF
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:
0:

28

packet error statistics:


IP received my own packet
OSPF wrong version
OSPF wrong area id
OSPF wrong virtual link
OSPF wrong authentication key
OSPF packet size > ip length
OSPF interface down
HELLO: netmask mismatch
HELLO: dead timer mismatch
HELLO: router id confusion
HELLO: NBMA neighbor unknown
DD: router id confusion
DD: unknown LSA type
LS ACK: wrong ack
LS ACK: unknown LSA type
LS REQ: empty request
LS UPD: neighbor state low

0: OSPF wrong packet type


0: OSPF wrong checksum
0: OSPF area mismatch
15: OSPF wrong authentication type
0: OSPF too small packet
0: OSPF transmit error
0: OSPF unknown neighbor
0: HELLO: hello timer mismatch
0: HELLO: extern option mismatch
0: HELLO: virtual neighbor unknown
0: DD: neighbor state low
0: DD: extern option mismatch
0: LS ACK: neighbor state low
0: LS ACK: duplicate ack
0: LS REQ: neighbor state low
0: LS REQ: wrong request
0: LS UPD: newer self-generate LSA

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide


0:
0:
0:
0:
0:

LS UPD: LSA checksum wrong


LS UPD: unknown LSA type
DD: MTU option mismatch
OPQ-9 : out of flooding scope
OPQ-11 : out of flooding scope

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.
0: LS UPD: received less recent LSA
0: OSPF routing: next hop not exist
0: ROUTETYPE: wrong type value
0: OPQ-10 : out of flooding scope

 Note:
From the error information, we can see that the error lies in mismatch of authentication type.

5.6 Configuration Reference


5.6.1 Configure the Port
I. Configure RTA
<Quidway>system-view
[Quidway]sysname RTA
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 1.1.1.1 255.255.255.255
[RTA-LoopBack0]quit
[RTA]interface ethernet 0/0
[RTA-Ethernet0/0]ip address 10.1.1.1 255.255.255.252
[RTA-Ethernet0/0]quit

II. Configure RTB


<Quidway>system-view
[Quidway]sysname RTB
[RTB]interface loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 255.255.255.255
[RTB-LoopBack0]quit
[RTB]interface Ethernet 0/0
[RTB-Ethernet0/0]ip address 10.1.1.2 255.255.255.252
[RTB-Ethernet0/0]quit

5.6.2 OSPF Configuration


I. Configure RTA
1)

Specify the router ID

[RTA]router id 1.1.1.1

2)

Run the OSPF

[RTA]ospf 1

3)

Create area 0

[RTA-ospf-1]area 0

4)

Declare network in the area 0 view

[RTA-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3


[RTA-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

5)

Run the area authentication

[RTA-ospf-1-area-0.0.0.0]authentication-mode md5

6)

Authenticate use of port

[RTA-Ethernet0/0]ospf authentication-mode md5 1 huawei

Confidential Information of Huawei. No Spreading without Permission

29

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

II. Configure RTB


1)

Specify the router ID

[RTB]router id 2.2.2.2

2)

Run the OSPF

[RTB]ospf 1

3)

Create area 0

[RTB-ospf-1]area 0

4)

Declare network in the area 0 view

[RTB-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3


[RTB-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

5)

Run the area authentication

[RTB-ospf-1-area-0.0.0.0]authentication-mode md5

6)

Authenticate use of port

[RTB-Ethernet0/0]ospf authentication-mode md5 1 huawei

30

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

Chapter 6 STUB Area Configuration Guide


6.1 Networking and Service Introduction

Figure 6-1


On the basis of introducing the external route to the multi-area OSPF, configure
area 1 to STUB area.
The Stub area is a special type of OSPF area, which does not receive or
disseminate type-5 LSA (AS-external-LSAs). For the network that generates
plenty of type-5 LSA, such processing mode can shorten the LSDB of the router in
the Stub area effectively, and relieve the occupation of SPF computation for the
router resources. Generally, the Stub area is located at the border of the
autonomous system.
To ensure that the packets from the Stub area to the autonomous system can be
forwarded correctly, the ABR of the Stub area will release a default route to this
area, and only disseminates packets in this area.
Creat vlan 2 and vlan 3 on switch, on RTD configures static routes towards vlan2
and vlan 3. On ospf view import static these static routes.

6.2 Command Line List


Table 6-1
Operation

Configure an area to be the STUB

Version

VRP 3.30

Command

stub [ no-summary ]

Confidential Information of Huawei. No Spreading without Permission

31

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

area

VRP 5.10

stub [ no-summary ]

Configure the cost of the default route


transmitted by OSPF to the STUB
area

VRP 3.30

default-cost value

VRP 5.10

default-cost value

6.3 Configuration Procedure


1)

Configure area 1 to stub

6.4 Result Verification


6.4.1 Before Configuration:
Display the lsdb and routing-table of RTA before configure stub area.
[RTA]display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database

LinkState ID
1.1.1.1
2.2.2.2
1.1.1.1
10.1.1.1
2.2.2.2
4.4.4.4
3.3.3.3
192.2.2.0
10.2.2.0
4.4.4.4

Area: 0.0.0.1
AdvRouter
Age Len Sequence
1.1.1.1
1661 24
0
2.2.2.2
1651 36
80000008
1.1.1.1
1661 48
8000000b
1.1.1.1
1661 32
80000006
2.2.2.2
1644 28
80000005
2.2.2.2
1644 28
80000004
2.2.2.2
1644 28
80000005
2.2.2.2
1644 28
80000005
2.2.2.2
1644 28
80000005
2.2.2.2
323 28
80000001

Metric Where
0 SpfTree
0 SpfTree
0 SpfTree
0 SpfTree
1 Uninitialized
1564 Uninitialized
1563 Uninitialized
1562 Uninitialized
1563 Uninitialized
1563 Uninitialized

Type LinkState ID
ASE 110.1.1.0
ASE 110.1.2.0

AS External Database:
AdvRouter
Age Len Sequence
4.4.4.4
326 36
80000001
4.4.4.4
326 36
80000001

Metric Where
1 Uninitialized
1 Uninitialized

Type
Stub
Rtr
Rtr
Net
SNet
SNet
SNet
SNet
SNet
ASB

[RTA]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
1.1.1.1/32
DIRECT
0
2.2.2.2/32
OSPF
10
3.3.3.3/32
OSPF
10
4.4.4.4/32
OSPF
10
10.1.1.0/30
DIRECT
0
10.1.1.1/32
DIRECT
0
10.2.2.0/30
OSPF
10
110.1.1.0/24
O_ASE
150
110.1.2.0/24
O_ASE
150
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
OSPF
10

Cost
0
2
1564
1565
0
0
1564
1
1
0
0
1563

Nexthop
127.0.0.1
10.1.1.2
10.1.1.2
10.1.1.2
10.1.1.1
127.0.0.1
10.1.1.2
10.1.1.2
10.1.1.2
127.0.0.1
127.0.0.1
10.1.1.2

6.4.2 After Configuring Area 1 to Stub

32

Confidential Information of Huawei. No Spreading without Permission

Interface
InLoopBack0
Ethernet0/0
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
InLoopBack0
Ethernet0/0

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

Notes: The following information describe the different results of the commands
stub and stub no-summary
These are the results when you use the command
[RTA-ospf-1-area-0.0.0.1]stub
[RTB-ospf-1-area-0.0.0.1]stub
[RTA]display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database

Type
Stub
Rtr
Rtr
Net
SNet
SNet
SNet
SNet
SNet
SNet

LinkState ID
1.1.1.1
2.2.2.2
1.1.1.1
10.1.1.2
0.0.0.0
2.2.2.2
4.4.4.4
3.3.3.3
192.2.2.0
10.2.2.0

Area: 0.0.0.1
AdvRouter
Age Len Sequence
1.1.1.1
96 24
0
2.2.2.2
91 36
8000001a
1.1.1.1
96 48
8000001b
2.2.2.2
91 32
80000002
2.2.2.2
111 28
80000002
2.2.2.2
107 28
80000001
2.2.2.2
107 28
80000001
2.2.2.2
107 28
80000001
2.2.2.2
111 28
80000002
2.2.2.2
107 28
80000001

[RTA]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
0.0.0.0/0
OSPF
10
1.1.1.1/32
DIRECT
0
2.2.2.2/32
OSPF
10
3.3.3.3/32
OSPF
10
4.4.4.4/32
OSPF
10
10.1.1.0/30
DIRECT
0
10.1.1.1/32
DIRECT
0
10.2.2.0/30
OSPF
10
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0
192.2.2.0/30
OSPF
10

Cost
2
0
2
1564
1565
0
0
1564
0
0
1563

Metric Where
0 SpfTree
0 SpfTree
0 SpfTree
0 SpfTree
1 Uninitialized
1 Uninitialized
1564 Uninitialized
1563 Uninitialized
1562 Uninitialized
1563 Uninitialized

Nexthop
10.1.1.2
127.0.0.1
10.1.1.2
10.1.1.2
10.1.1.2
10.1.1.1
127.0.0.1
10.1.1.2
127.0.0.1
127.0.0.1
10.1.1.2

Interface
Ethernet0/0
InLoopBack0
Ethernet0/0
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
Ethernet0/0
InLoopBack0
InLoopBack0
Ethernet0/0

 Note:
1If you still find AS External Database on RTA, reset ospf process on RTA.
2The default route of RTA is type-3 LSA and is generated by ABR-RTB.
3Take a look at the routing table of RTA: The external route disappears, and a new default route appears,
but inter-area routes still exist.
4In order to further shorten the lsdb and the routing table, use the no-summary parameter on the
ABR-RTB.

These are the results when you use the command


[RTA-ospf-1-area-0.0.0.1]stub
[RTB-ospf-1-area-0.0.0.1] stub no-summary

[RTA]display ospf lsdb

Confidential Information of Huawei. No Spreading without Permission

33

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

OSPF Process 1 with Router ID 1.1.1.1


Link State Database

Type
Stub
Rtr
Rtr
Net
SNet

LinkState ID
1.1.1.1
2.2.2.2
1.1.1.1
10.1.1.1
0.0.0.0

Area: 0.0.0.1
AdvRouter
Age Len Sequence
Metric Where
1.1.1.1
65 24
0
0 SpfTree
2.2.2.2
60 36
8000001f
0 SpfTree
1.1.1.1
65 48
80000007
0 SpfTree
1.1.1.1
65 32
80000002
0 SpfTree
2.2.2.2
69 28 80000004
1 Uninitialized

[RTA]display ip routing-table
Routing Table: public net
Destination/Mask
Protocol Pre
0.0.0.0/0
OSPF
10
1.1.1.1/32
DIRECT
0
10.1.1.0/30
DIRECT
0
10.1.1.1/32
DIRECT
0
127.0.0.0/8
DIRECT
0
127.0.0.1/32
DIRECT
0

Cost
2
0
0
0
0
0

Nexthop
10.1.1.2
127.0.0.1
10.1.1.1
127.0.0.1
127.0.0.1
127.0.0.1

6.5 Configuration Reference


6.5.1 Configure the Port
I. Configure RTA
<Quidway>system-view
[Quidway]sysname RTA
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 1.1.1.1 255.255.255.255
[RTA-LoopBack0]quit
[RTA]interface ethernet 0/0
[RTA-Ethernet0/0]ip address 10.1.1.1 255.255.255.252
[RTA-Ethernet0/0]quit

II. Configure RTB


<Quidway>system-view
[Quidway]sysname RTB
[RTB]interface loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 255.255.255.255
[RTB-LoopBack0]quit
[RTB]interface Ethernet 0/0
[RTB-Ethernet0/0]ip address 10.1.1.2 255.255.255.252
[RTB-Ethernet0/0]quit
[RTB]interface serial 2/0
[RTB-Serial2/0]ip address 192.2.2.2 255.255.255.252
[RTB-Serial2/0]quit

III. Configure RTC


<Quidway>system-view
[Quidway]sysname RTC
[RTC]interface loopback 0
[RTC-LoopBack0]ip address 3.3.3.3 255.255.255.255
[RTC-LoopBack0]quit
[RTC]interface Ethernet 0/0
[RTC-Ethernet2/0]ip address 10.2.2.2 255.255.255.252
[RTC-Ethernet2/0]quit
[RTC]interface serial 2/0

34

Confidential Information of Huawei. No Spreading without Permission

Interface
Ethernet0/0
InLoopBack0
Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

[RTC-Serial2/0]ip address 192.2.2.1 255.255.255.252


[RTC-Serial2/0]quit

IV. Configure RTD


<Quidway>system-view
[Quidway]sysname RTD
[RTD]interface loopback 0
[RTD-LoopBack0]ip address 4.4.4.4 255.255.255.255
[RTD-LoopBack0]quit
[RTD]interface ethernet 0/0
[RTD-Ethernet0/0]ip address 10.2.2.1 255.255.255.252
[RTD-Ethernet0/0]quit
[RTD]interface ethernet 0/1
[RTD-Ethernet0/1]ip address 10.3.3.1 255.255.255.252
[RTD-Ethernet0/1]quit

V. Configure switch
[Quidway]sysname switch
[switch]vlan 2
[switch-vlan2]quit
[switch]vlan 3
[switch-vlan3]quit
[switch]interface vlan 1
[switch-Vlan-interface1]ip address 10.3.3.2 255.255.255.252
[switch-Vlan-interface1]quit
[switch]interface vlan 2
[switch-Vlan-interface2]ip address 110.1.1.1 255.255.255.0
[switch-Vlan-interface2]quit
[switch]interface vlan 3
[switch-Vlan-interface3]ip address 110.1.2.1 255.255.255.0
[switch]ip route-static 0.0.0.0 0.0.0.0 10.3.3.1

6.5.2 OSPF Configuration


I. Configure RTA
1)

Specify Router ID

[RTA]router id 1.1.1.1

2)

Run OSPF

[RTA]ospf 1

3)

Create area 1

[RTA-ospf-1]area 1

4)

Declare network in the area 1 view

[RTA-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.3


[RTA-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0

II. Configure RTB


1)

Specify Router ID

[RTB]router id 2.2.2.2

2)

Run OSPF

[RTB]ospf 1

3)

Create area 0

[RTB-ospf-1]area 0

4)

Declare network in the area 0 view


Confidential Information of Huawei. No Spreading without Permission

35

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear
here.Error! Use the Home tab to apply
1 to the text that you want to appear here.

[RTB-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3


[RTB-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

5)

Create area 1

[RTB-ospf-1]area 1

6)

Declare network in the area 1 view

[RTB-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.3

III. Configure RTC


1)

Specify Router ID

[RTC]router id 3.3.3.3

2)

Run OSPF

[RTC]ospf 1

3)

Create area 0

[RTC-ospf-1]area 0

4)

Declare network in the area 0 view

[RTC-ospf-1-area-0.0.0.0]network 192.2.2.0 0.0.0.3


[RTC-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

5)

Create area 2

[RTC-ospf-1]area 2

6)

Declare network in the area 2 view

[RTC-ospf-1-area-0.0.0.2]network 10.2.2.0 0.0.0.3

IV. Configure Router D


1)

Specify Router ID

[RTD]router id 4.4.4.4

2)

Run OSPF

[RTD]ospf 1

3)

Create area 2

[RTD-ospf-1]area 2

4)

Declare network in the area 2 view

[RTD-ospf-1-area-0.0.0.2]network 10.2.2.0 0.0.0.3


[RTD-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0

5)

Configure static routes towords vlan 2 and vlan 3

[RTD]ip route-static 110.1.1.0 255.255.255.0 10.3.3.2


[RTD]ip route-static 110.1.2.0 255.255.255.0 10.3.3.2

6)

On ospf view import these static routes

[RTD-ospf-1]import-route static

6.5.3 Configure stub area


I. Set area 1 of RTA to Stub
[RTA-ospf-1-area-0.0.0.1]stub

36

Confidential Information of Huawei. No Spreading without Permission

NE Series Routers OSPF Protocol Features Practice Guide

Error! Use the Home tab to apply 1 to


the text that you want to appear here.Error!
Use the Home tab to apply 1 to the text
that you want to appear here.

II. Set area 1 of RTB to stub. Since RTB is ABR, set stub no-summary
[RTB-ospf-1-area-0.0.0.1]stub no-summary

Confidential Information of Huawei. No Spreading without Permission

37