0% found this document useful (0 votes)
14 views21 pages

Lab 1-1 Single-Area OSPF

The document outlines a lab exercise focused on configuring single-area OSPF, including OSPF authentication and establishing neighbor relationships among routers. It details the necessary configurations for three routers, verification of connectivity, and commands to view OSPF status and routing tables. The lab aims to equip network administrators with practical skills in OSPF setup and troubleshooting in a multi-access network environment.

Uploaded by

Haroon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views21 pages

Lab 1-1 Single-Area OSPF

The document outlines a lab exercise focused on configuring single-area OSPF, including OSPF authentication and establishing neighbor relationships among routers. It details the necessary configurations for three routers, verification of connectivity, and commands to view OSPF status and routing tables. The lab aims to equip network administrators with practical skills in OSPF setup and troubleshooting in a multi-access network environment.

Uploaded by

Haroon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Lab 1-1 Single-Area OSPF

Learning Objectives
The objectives of this lab are to learn and understand how to perform the
following operations:
 How to configure single-area OSPF
 How to configure OSPF authentication
 How to establish neighbor relationships on multi-access networks
 How to use OSPF to advertise the subnet mask of the network to
which the loopback interface connects
 How to change cost values for OSPF interfaces
 How to configure an interface as a silent interface
 How to view OSPF status using the display command
 How to view OSPF neighbor relationships and troubleshoot faults
using the debug command

Topology

Figure 1-1 Single-area OSPF


Scenario
Assume that you are a network administrator of a company that has three
ARG3 routers. These routers are interconnected over the Ethernet. A
broadcast multi-access network, such as Ethernet, has security threats.
Therefore, OSPF area authentication is required to prevent malicious route
attacks. A network connectivity failure occurs during network deployment.
You can run the display and debug commands for fault location.

Tasks
Step 1 Perform basic configurations and configure IP
addresses.
Configure IP addresses and masks for R1, R2, and R3. Set a 24-bit mask for
loopback interfaces to simulate an independent network segment.
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.123.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24
[R1-LoopBack0]quit

<R2>system-view
Enter system view, return user view with Ctrl+Z.
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.123.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit

<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.0.123.3 24
[R3-GigabitEthernet0/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24
[R3-LoopBack0]quit
Verify the connectivity between routers.
[R1]ping -c 1 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.123.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

[R1]ping -c 1 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.123.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

[R2]ping -c 1 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.123.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

Step 2 Configure single-area OSPF.


Configure single-area OSPF and deploy all routers in area 0. Configure OSPF
process 1. In addition, configure area authentication and set the password to
huawei. In an OSPF area, Huawei devices support plain text or MD5
authentication. Plain text authentication is used for this step.
Set the wildcard subnet mask to 0.0.0.0 when you use the network
command. To ensure the stability of Router IDs, they are usually specified
manually as.
[R1]ospf 1 router-id 10.0.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.123.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit

[R2]ospf 1 router-id 10.0.2.2


[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.123.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit

[R3]ospf 1 router-id 10.0.3.3


[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.123.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit

View the routing tables and test the connectivity of the entire network.
View the routing table of R1.

[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/32OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

The command output shows that R1 learns two routes from OSPF:
10.0.2.2/32 and 10.0.3.3/32. The next hops of the two routes are 10.0.123.2
and 10.0.123.3 respectively.
Verify the connectivity from R1 to loopback interface addresses of R2 and
R3.
[R1]ping -c 1 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms

--- 10.0.2.2 ping statistics ---


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

[R1]ping -c 1 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.3.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

Run the display ospf brief command to view basic OSPF information on R1.
[R1]display ospf brief

OSPF Process 1 with Router ID 10.0.1.1


OSPF Protocol Information

RouterID: 10.0.1.1 Border Router:


Multi-VPN-Instance is not enabled
Global DS-TE Mode: Non-Standard IETF Mode
Graceful-restart capability: disabled
Helper support capability : not configured
Applications Supported: MPLS Traffic-Engineering
Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
Route Preference: 10
ASE Route Preference: 150
SPF Computation Count: 9
RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 1 Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Process total up interface count: 2
Process valid up interface count: 1

Area: 0.0.0.0 (MPLS TE not enabled)


Authtype: Simple Area flag: Normal
SPF scheduled Count: 9
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 2

Interface: 10.0.1.1 (LoopBack0)


Cost: 0 State: P-2-P Type: P2P MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Interface: 10.0.123.1 (GigabitEthernet0/0/0)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.0.123.1
Backup Designated Router: 10.0.123.2
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

The preceding command output Authtype: Simple shows that plaintext


authentication is enabled in Area 0. OSPF runs on two interfaces:
GigabitEthernet0/0/0 and Loopback0. The network type of
GigabitEthernet0/0/0 is broadcast, cost is 1, and priority is 1. DR is R1, and
BDR is 10.0.123.2. The network type of another OSPF-enabled Loopback 0 is
P2P.
Run the display ospf peer brief command on R1 to check information
about OSPF neighbor relationships between the routers.
[R1]display ospf peer brief

OSPF Process 1 with Router ID 10.0.1.1


Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 10.0.2.2 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.3.3 Full
----------------------------------------------------------------------------
Total Peer(s): 2

The preceding command output shows that R1 has two neighbors in Area
0.0.0.0, their router IDs are 10.0.2.2 and 10.0.3.3 respectively, and their
OSPF neighbor relationships are in Full state.
Run the display ospf lsdb command on R1 to check OSPF LSDB
information.
[R1]display ospf lsdb

OSPF Process 1 with Router ID 10.0.1.1


Link State Database

Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 1569 48 80000005 0
Router 10.0.2.2 10.0.2.2 1568 48 80000006 0
Router 10.0.1.1 10.0.1.1 1567 48 80000008 0
Network 10.0.123.110.0.1.1 1567 36 80000004 0

The preceding command output shows that the LSDB contains four LSAs, the
first three of which are Type 1 LSAs generated by R1, R2, and R3
respectively. You can check the AdvRouter field to determine which router
generates an LSA. The fourth LSA is a Type 2 LSA, which is generated by a
DR of a network segment. Because R1 is the DR of the network segment
10.0.123.0/24, you can see that the AdvRouter field of this LSA is 10.0.1.1.
[R1]display ospf lsdb router self-originate

OSPF Process 1 with Router ID 10.0.1.1


Area: 0.0.0.0
Link State Database

Type : Router
Ls id : 10.0.1.1
Adv rtr : 10.0.1.1
Ls age : 430
Len : 48
Options : E
seq# : 80000009
chksum : 0x8188
Link count: 2
* Link ID: 10.0.1.1
Data : 255.255.255.255
Link Type: StubNet
Metric : 0
Priority : Medium
* Link ID : 10.0.123.1
Data: 10.0.123.1
Link Type: TransNet
Metric :1

The preceding command output shows detailed information about the Router
LSA generated by R1. This LSA describes two networks. The first network is
the network segment where the loopback interface resides. The Link Type
field displays StubNet, and Link ID and Data fields indicate the IP address
and mask of this stub network segment. The second network is the network
segment that connects the three routers. The Link Type displays TransNet,
the Link ID field displays 10.0.123.1, which is the interface address of the
DR, and the Data field displays 10.0.123.1, which is the local interface
address on the network segment.
[R1]display ospf lsdb network self-originate

OSPF Process 1 with Router ID 10.0.1.1


Area: 0.0.0.0
Link State Database

Type : Network
Ls id : 10.0.123.1
Adv rtr : 10.0.1.1
Ls age : 1662
Len : 36
Options : E
seq# : 80000005
chksum : 0x3d58
Net mask : 255.255.255.0
Priority : Low
Attached Router 10.0.1.1
Attached Router 10.0.2.2
Attached Router 10.0.3.3

The preceding command output shows detailed information about the


Network LSA generated by R1. This Type 2 LSA describes neighbor
information on the network segment where the DR resides.
Step 3 Observe the OSPF neighbor relationship
establishment process on the routers.
Check DR and BDR election on the network segment 10.0.123.0/24 and
analyze whether the results of tests performed by different candidates are
the same. According to the following command output, the interface IP
address of the DR on this network segment is 10.0.123.1, and that of the
BDR on this network segment is 10.0.123.2.

[R1]display ospf peer

OSPF Process 1 with Router ID 10.0.1.1


Neighbors

Area 0.0.0.0 interface 10.0.123.1(GigabitEthernet0/0/0)'s neighbors


Router ID: 10.0.2.2 Address: 10.0.123.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.0.123.1 BDR: 10.0.123.2 MTU: 0
Dead timer due in 40 sec
Retrans timer interval: 5
Neighbor is up for 01:03:35
Authentication Sequence: [ 0 ]

Router ID: 10.0.3.3 Address: 10.0.123.3


State: Full Mode:Nbr is Master Priority: 1
DR: 10.0.123.1 BDR: 10.0.123.2 MTU: 0
Dead timer due in 33 sec
Retrans timer interval: 5
Neighbor is up for 01:02:27
Authentication Sequence: [ 0 ]

The results of tests performed by different candidates may be different. This


is because DR election of OSPF is not preempted. That is, when there is a DR
or BDR on a network, the router that newly joins the network cannot preempt
to be the DR or BDR. On this network, the router whose OSPF process starts
first or that connects to this network first becomes the DR, and other routers
are the BDR and DR others.
After the DR fails, the BDR becomes the new DR. You can reset an OSPF
process to observe the DR role change. The following example resets the
OSPF process of R1.
<R1>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
[R1]display ospf peer

OSPF Process 1 with Router ID 10.0.1.1


Neighbors

Area 0.0.0.0 interface 10.0.123.1(GigabitEthernet0/0/0)'s neighbors


Router ID: 10.0.2.2 Address: 10.0.123.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.0.123.2 BDR: 10.0.123.3 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 0
Neighbor is up for 00:00:19
Authentication Sequence: [ 0 ]

Router ID: 10.0.3.3 Address: 10.0.123.3


State: Full Mode:Nbr is Master Priority: 1
DR: 10.0.123.2 BDR: 10.0.123.3 MTU: 0
Dead timer due in 39 sec
Retrans timer interval: 5
Neighbor is up for 00:00:19
Authentication Sequence: [ 0 ]

After the OSPF process of R1 is reset, the BDR 10.0.123.2 becomes the new
DR, and the DR other 10.0.123.3 becomes the new BDR.
Shut down G0/0/0 of R1, R2, and R3 and run the debugging ospf 1 event
command to check the OSPF neighbor relationship establishment process.
Undoshutdown G0/0/0 of R1, R2, and R3 simultaneously, and observe
neighbor status change and DR and BDR election on the broadcast multi-
access network.
<R1>debugging ospf 1 event
<R1>terminal debugging
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]shut
[R1-GigabitEthernet0/0/0]undo shut

<R2>debugging ospf 1 event


<R2>terminal debugging
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]shut
[R2-GigabitEthernet0/0/0]undo shut

<R3>debugging ospf 1 event


<R3>terminal debugging
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]shutdown
[R3-GigabitEthernet0/0/0]undo shutdown

Perform the same operations on R2 and R3 and check debugging information


on R3. The default interface priority of all routers is 1. Therefore, router IDs
of the three routers are compared during DR election. Among the three
routers, R3 has the largest router ID and becomes the DR of the network
segment.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:54:59.220.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 1326 Level: 0x20
OSPF 1: Intf 10.0.123.3 Rcv InterfaceUp State Down -> Waiting.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:54:59.230.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 1440 Level: 0x20
OSPF 1 Send Hello Interface Up on 10.0.123.3
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:08.550.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1200 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv HelloReceived State Down -> Init.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:09.530.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1200 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv HelloReceived State Down -> Init.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:18.540.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1796 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv 2WayReceived State Init -> 2Way.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:19.570.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1796 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv 2WayReceived State Init -> 2Way.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.370.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1796 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv AdjOk? State 2Way -> ExStart.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.370.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1796 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv AdjOk? State 2Way -> ExStart.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.370.3+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 2127 Level: 0x20
OSPF 1 Send Hello Interface State Changed on 10.0.123.3
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.370.4+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 2138 Level: 0x20
OSPF 1: Intf 10.0.123.3 Rcv WaitTimer State Waiting -> DR.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.390.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1909 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv NegotiationDone State ExStart -> Exchange.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.390.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1909 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv NegotiationDone State ExStart -> Exchange.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.400.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 2021 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv ExchangeDone State Exchange -> Loading.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.400.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 2423 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv LoadingDone State Loading -> Full.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.400.3+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 2021 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv ExchangeDone State Exchange -> Loading.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.400.4+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 2423 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv LoadingDone State Loading -> Full.
<R1>undo debugging all
<R2>undo debugging all
<R3>undo debugging all

When G0/0/0 is just enabled, the interface state changes from Down to
Waiting. Then routers start exchanging Hello packets. After 40 seconds, the
status of G0/0/0 on R3 changes from Waiting to DR.
Step 4 Set the network type for loopback interfaces.
Check the IP routing table of R1 and focus on the two routes 10.0.2.2/32 and
10.0.3.3/32.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/32OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

During the configuration of IP addresses for loopback interfaces of R2 and


R3, the 24-bit mask is used. Analyze why the IP routing table of R1 displays
routes with the 32-bit mask.
Run the display ospf interface LoopBack 0 verbose command to check
the OSPF running status of Loopback0.
[R1]display ospf interface LoopBack 0 verbose

OSPF Process 1 with Router ID 10.0.1.1


Interfaces

Interface: 10.0.1.1 (LoopBack0)


Cost: 0 State: P-2-P Type: P2P MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
IO Statistics
Type Input Output
Hello 0 0
DB Description 0 0
Link-State Req 0 0
Link-State Update 0 0
Link-State Ack 0 0
ALLSPF GROUP
OpaqueId: 0 PrevState: Down

OSPF knows that the network segment where Loopback0 resides can have
only one IP address. Therefore the subnet mask of the advertised route is 32
bits.
Change the network type of Loopback0 on R2 to broadcast. When OSPF
advertises network information of this interface, it will use a 24-bit mask.
[R2]interface LoopBack 0
[R2-LoopBack0]ospf network-type broadcast

You can see that the subnet mask of the route to Loopback0 address
advertised by R2 is 24 bits.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/24OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

Run the display ospf interface LoopBack 0 verbose command to check


the OSPF running status of Loopback0. The command output shows that the
network type of Loopback0 is broadcast.
[R2]display ospf interface LoopBack 0 verbose

OSPF Process 1 with Router ID 10.0.2.2


Interfaces
Interface: 10.0.2.2 (LoopBack0)
Cost: 0 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.0.2.2
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
IO Statistics
Type Input Output
Hello 0 0
DB Description 0 0
Link-State Req 0 0
Link-State Update 0 0
Link-State Ack 0 0
ALLSPF GROUP
ALLDR GROUP
OpaqueId: 0 PrevState: Waiting

Step 5 Change the OSPF interface cost.


Check the cost of the route from R1 to Loopback0 of R3. You can see that the
cost of the route to 10.0.3.3/32 is 1.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/24OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

Change the cost of G0/0/0 on R1 to 20 and that on R3 to 10.


[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ospf cost 20
[R1-GigabitEthernet0/0/0]quit

[R3]interface GigabitEthernet 0/0/0


[R3-GigabitEthernet0/0/0]ospf cost 10
[R3-GigabitEthernet0/0/0]quit

Check the cost of the route from R1 to Loopback0 of R3 again. You can see
that the cost of the route to 10.0.3.3/32 is 20.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/24OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32OSPF 10 20 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

On R3, check the cost of the route to 10.0.1.1/32. You can see that the cost
is 10.
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32OSPF 10 10 D 10.0.123.1 GigabitEthernet0/0/0


10.0.2.0/24OSPF 10 10 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.0/24Direct 0 0 D 10.0.3.3 LoopBack0
10.0.3.3/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.3.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.123.0/24 Direct 0 0 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

Step 6 Configure OSPF interfaces as silent interfaces.


Configure G0/0/0 of R1 as a silent interface.
[R1]ospf 1
[R1-ospf-1]silent-interface GigabitEthernet 0/0/0
[R1-ospf-1]quit

Run the display ip routing-table on R1 to check OSPF neighbor


relationship establishment and routing entry learning on R1. The command
output shows that the route learned from OSPF disappears in the IP routing
table.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

Check the neighbor list of R1. You can see that OSPF neighbor relationships
between R1 and R2 and between R1 and R3 disapear. After a RIP interface is
configured as a silent interface, this interface does not send RIP updates. In
OSPF, routers can exchange routing information only after they establish an
OSPF neighbor relationship. After an OSPF interface is configured as a silent
interface, this interface does not receive or send Hello packets. As a result,
this interface cannot establish OSPF neighbor relationships with interfaces of
other routers.
[R1]display ospf interface GigabitEthernet 0/0/0

OSPF Process 1 with Router ID 10.0.1.1


Interfaces

Interface: 10.0.123.1 (GigabitEthernet0/0/0)


Cost: 20 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.0.123.1
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Silent interface, No hellos

Restore G0/0/0 of R1 to the default state and configure Loopback0 of the


three routes as silent interfaces.
[R1]ospf 1
[R1-ospf-1]undo silent-interface GigabitEthernet0/0/0
[R1-ospf-1]silent-interface LoopBack 0
[R1-ospf-1]quit

[R2]ospf 1
[R2-ospf-1]silent-interface LoopBack 0
[R1-ospf-1]quit

[R3]ospf 1
[R3-ospf-1]silent-interface LoopBack 0
[R1-ospf-1]quit

Check the IP routing table of R1. The command output shows that
configuring Loopback0 as a silent interface does not affect its route
advertisement.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.0/24OSPF 10 20 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32OSPF 10 20 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0

----End

Additional Exercises: Analysis and Verification


Analyze why the wildcard mask 0.0.0.0 is used in OSPF configuration? The
wildcard mask 0.0.0.255 can also be used in actual configuration, what are
the differences of the two wildcard masks?
Analyze which types of interfaces should be configured as silent interfaces in
real-world networks.

Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
#
sysname R1
#
interface GigabitEthernet0/0/0
ip address 10.0.123.1 255.255.255.0
ospf cost 20
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
#
ospf 1 router-id 10.0.1.1
silent-interface LoopBack0
area 0.0.0.0
authentication-mode simple plain huawei
network 10.0.1.1 0.0.0.0
network 10.0.123.1 0.0.0.0
#
return

<R2>display current-configuration
[V200R007C00SPC600]
#
sysname R2
#
interface GigabitEthernet0/0/0
ip address 10.0.123.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.2.2
silent-interface LoopBack0
area 0.0.0.0
authentication-mode simple plain huawei
network 10.0.2.2 0.0.0.0
network 10.0.123.2 0.0.0.0
#
return

<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#
interface GigabitEthernet0/0/0
ip address 10.0.123.3 255.255.255.0
ospf cost 10
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
#
ospf 1 router-id 10.0.3.3
silent-interface LoopBack0
area 0.0.0.0
authentication-mode simple plain huawei
network 10.0.3.3 0.0.0.0
network 10.0.123.3 0.0.0.0
#
return

You might also like