Documente Academic
Documente Profesional
Documente Cultură
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
Table of Contents
ii
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
Experiment Tasks
Relevant Materials
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.
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
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
Figure 1-1
Run OSPF
Create an area
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.
The networks of each device can access each other (as tested via the ping
command)
ms
ms
ms
ms
ms
2)
[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
DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
DIRECT
OSPF
0
0
0
0
0
0
0
10
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.
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.
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
Use the display ospf brief command to check the summary information of OSPF;
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?
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.
[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
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)
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)
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)
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)
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.
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
Figure 2-2
Specify Router ID
In system-view, specify a router ID. Generally, the Loopback address is used as router
ID.
2)
Run OSPF
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.
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
11
[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
[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
OSPF
10
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.
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
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.
13
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.
14
[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
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)
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)
5)
Create area 1
[RTB-ospf-1]area 1
6)
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)
15
5)
Create area 2
[RTC-ospf-1]area 2
6)
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)
16
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
Configure
the
Route
Summarization of OSPF
Area
Version
VRP 3.30
VRP 5.10
Command
17
Figure 3-2
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)
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
Interface
Serial2/0
Serial2/0
InLoopBack0
Serial2/0
Serial2/0
Serial2/0
InLoopBack0
InLoopBack0
Serial2/0
InLoopBack0
Serial2/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
19
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)
[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
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)
5)
Create area 1
[RTB-ospf-1]area 1
6)
7)
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)
20
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.
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
21
Figure 4-2
In system-view, specify a router ID. Generally, the Loopback address is used as router
ID.
2)
Run OSPF
Create an area
Declare network
Use the display ospf brief command to check the summary information of the
router OSPF.
22
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.
23
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.
[RTA]router id 1.1.1.1
2)
Run OSPF
[RTA]ospf 1
24
3)
Create area 0
[RTA-ospf-1]area 0
4)
[RTB]router id 2.2.2.2
2)
Setting priority
3)
[RTB]ospf 1
4)
Create area 0
[RTB-ospf-1]area 0
5)
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.
25
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.
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
Version
VRP 5.10
Figure 5-2
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
Create an area
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)
27
Under the corresponding port, apply the authentication mechanism and configure a
password.
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
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
Note:
From the error information, we can see that the error lies in mismatch of authentication type.
[RTA]router id 1.1.1.1
2)
[RTA]ospf 1
3)
Create area 0
[RTA-ospf-1]area 0
4)
5)
[RTA-ospf-1-area-0.0.0.0]authentication-mode md5
6)
29
[RTB]router id 2.2.2.2
2)
[RTB]ospf 1
3)
Create area 0
[RTB-ospf-1]area 0
4)
5)
[RTB-ospf-1-area-0.0.0.0]authentication-mode md5
6)
30
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.
Version
VRP 3.30
Command
stub [ no-summary ]
31
area
VRP 5.10
stub [ no-summary ]
VRP 3.30
default-cost value
VRP 5.10
default-cost value
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
32
Interface
InLoopBack0
Ethernet0/0
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
Ethernet0/0
Ethernet0/0
Ethernet0/0
InLoopBack0
InLoopBack0
Ethernet0/0
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.
33
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
34
Interface
Ethernet0/0
InLoopBack0
Ethernet0/0
InLoopBack0
InLoopBack0
InLoopBack0
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
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)
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)
35
5)
Create area 1
[RTB-ospf-1]area 1
6)
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)
5)
Create area 2
[RTC-ospf-1]area 2
6)
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)
5)
6)
[RTD-ospf-1]import-route static
36
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
37