跳转到内容
Ask AI

OSPF Configuration Guide

此内容尚不支持你的语言。

OSPF (Open Shortest Path First) is an internal gateway protocol based on link state developed by the IETF organization, which is used to announce routing information in a single autonomous system. It has the advantages of fast convergence of routing changes, no routing loops, support for variable-length subnet masks (VLSM), and support for area division, etc. After deploying the OSPF protocol in the network, most routes will be automatically calculated and generated, eliminating the need for manual configuration by network administrators. When the network topology changes, the protocol can automatically recalculate and correct routes, significantly facilitating network management. Before the advent of OSPF, RIP (Routing Information Protocol) was widely used as an internal gateway protocol in the network. Since the RIP is a routing protocol based on the distance-vector algorithm, it suffers from issues such as slow convergence, routing loops, and poor scalability. As a result, it has gradually been replaced by the OSPF. Currently, OSPF Version 2 (RFC2328) is used for the IPv4 protocol, while OSPF Version 3 (RFC5340) is used for the IPv6 protocol.

OSPF is a link-state routing protocol. The link can be thought of as a router’s interface, and the link state can be thought of as a collection of interface and neighbor information, including the interface IP, mask, neighbors, and so on.

In the OSPF, “cost” is used as the routing metric. If the interface cost is not specified, the interface cost is calculated as the OSPF reference bandwidth divided by the interface bandwidth, with the OSPF reference bandwidth being 100 Mbps. If the calculated value is less than 1, the cost is set to 1. The calculation of the route cost is the sum of the costs of all ingress interfaces from the origin of the route to reach the local network.

Router ID is a 32-bit value used to identify an OSPF device, usually in the form of IPv4 address. The Router ID can be manually configured on the router running OSPF, or automatically generated by the router. Typically, when a Router ID is not manually configured, the router will select the largest IP address among its interface addresses to be used as the Router ID.

OSPF is a link-state routing protocol in which all routers broadcast the link state of their connected networks. Each router then uses this comprehensive link-state information to construct its own view of the network topology, upon which route calculations are based. However, when the network size is large, the amount of link state broadcasts will become large, affecting the scalability of OSPF. To resolve this issue, OSPF introduced the concept of Area. In OSPF, there are five types of areas: Standard Area, Stub Area, Totally Stub Area, NSSA (Not-So-Stubby Area), and Totally NSSA.

Table 1 OSPF area type

Area TypeDescription
Standard AreaGenerally, the OSPF area type is defined as a standard area, which can be categorized into standard areas and backbone areas:- Standard Area: Receives routing information from within the area, between areas, and from outside the autonomous system.- Backbone Area: Serves as the central area connecting other OSPF areas, which uses the special OSPF Area 0 (often written as Area 0.0.0.0)
Stub AreaDoes not accept routing information from outside the autonomous system. External route information is advertised by the area’s ABR (Area Border Router) as a Type 3 default route into the area.
Totally Stub AreaOnly receives internal area routing information. External routes and inter-area routing information are advertised into the area by the Area Border Router (ABR) as a Type 3 default route.
NSSA (Not-So-Stubby Area)Permits the introduction of external autonomous system routes while maintaining the characteristics of a STUB area within the autonomous system.
Totally NSSAPermits the introduction of external autonomous system routes while maintaining the characteristics of a Totally Stub area within the autonomous system.

When the AS is split into OSPF areas, the routers are further divided according to function into the following four overlapping categories.

  • Internal routers: A router with all directly connected networks belonging to the same area.
  • Area border routers: A router that attaches to multiple areas. Area border routers condense the topological information of their attached areas for distribution to the backbone. The backbone in turn distributes the information to the other areas.
  • Backbone routers: A router that has an interface to the backbone area. This includes all routers that interface to more than one area (i.e., area border routers). However, backbone routers do not have to be area border routers. Routers with all interfaces connecting to the backbone area are supported.
  • AS boundary routers: A router that exchanges routing information with routers belonging to other Autonomous Systems. Such a router advertises AS external routing information throughout the Autonomous System. AS boundary routers may be internal or area border routers, and may or may not participate in the backbone.

LSA (Link State Advertisement), is used to carry and transmit link state information, including adjacent routing information, directly connected link information, area information, etc. Currently, various LSA types are defined. The table below enumerates the commonly encountered LSA types.

Table 2 LSA Type

LAS TypeNameRouterDescription
Type-1Router LSAAll routersThis LSA describes the link-state and cost of a device and can only be propagated within its originating area.
Type-2Network LSADRIt describes the link-state of routers in a multi-access network and is propagated only within its originating area.
Type-3Network Summary LSAABRIt describes the network prefixes and cost metrics to reach other areas, enabling routers to perform inter-area route calculation.
Type-4ASBR Summary LSAABRIt describes the route to the ASBR and is advertised to other relevant areas except the one where the ASBR resides.
Type-5AS External LSAASBRIt describes routes to external AS and is advertised to all areas except STUB areas and NSSA.
Type-7NSSA LSAASBRIt describes routes to external AS and is propagated only within NSSA.

The support for different types of LSAs in different OSPF areas is as follows:

Table 3 Support for LSA dissemination in various areas

Area TypeType-1Type-2Type-3Type-4Type-5
Standard Area,11111
Stub Area11100
Totally Stub Area11000
NSSA Area11100
Totally NSSA Area11000

In Totally STUB and Totally NSSA areas, no Type-3 LSAs can be propagated except for the default routes of ABR-generated Type-3 LSAs.

Table 4 Message type

Message typeDescription
HelloHello packets are sent out each functioning router interface. They are used to discover and maintain neighbor relationships
DD(Database Description)After the OSPF neighbor relationship is established, DD packets are used for describing its local LSDB (Link State Database). Upon receiving this information, routers compare it with their own LSDB to synchronize the LSDB within the area.
LSR(Link-State Request)LSR packets are used to request the necessary LSAs from the counterpart
LSU(Link-State Update)LSU packets are used to response to the LSR.
LSAckLSAck are used to send an acknowledgment message in response to receiving an LSU from the peer.

In an OSPF network, two routers need to establish an adjacency to exchange routing information. Neighbor relationships and adjacency relationships are distinct.

  • Neighbor Relationships: OSPF routers detect each other via Hello packets on a shared subnet. If the information (e.g., Area ID, Hello/Dead intervals) carried in Hello packets matches, two routers will form a neighbor relationship
  • Adjacency Relationships: Adjacency is a deeper relationship where routers synchronize their Link-State Databases by exchanging DD, LSR, and LSU packets. There are seven types of neighbor states in OSPF.

Table 5 Neighbor states

Neighbor statesDescription
DownIt’s the initial stage of the neighbor session, indicating that no active neighbor has been detected.
InitWhen the received Hello packet does not contain its own Router ID, the state transitions to Init
2-wayWhen the received Hello packet contain its own Router ID, the state transitions to 2-Way. At this point, the neighbor relationship has been established and link status data can be shared.
ExstartThe state transitions to Exstart when master-slave relationship negotiation begins and the DD sequence number is determined.
ExchangeThe state transitions to Exchange when master-slave relationship negotiation has finished and the DD message begin to be exchanged.
LoadingThe state transitions to Loading when DD message exchange has completed.
FullThe state transitions to Full when the LSR retransmission list is empty.

OSPF supports three authentication methods: Interface Authentication, Area Authentication, and Virtual Link Authentication. Each of these methods can use either Plain Text authentication or Message Digest (MD5) authentication. Plain Text authentication transmits credentials in text, which can be intercepted by network sniffers and is therefore insecure. It is not recommended. In contrast, Message Digest (MD5) authentication encrypts credentials before transmission, making it the preferred method for secure deployments.

Table 6 Authentication methods

AuthenticationDescription
Interface AuthenticationEnable authentication for all packets on this interface.
Area AuthenticationEnable authentication for all packets on all interface in this area.
Virtual Link AuthenticationEnable authentication for all packets on virtual link.

Route aggregation refers to the process where an Area Border Router combines routes with common subnet prefixes into a single route and advertises it to other areas. By implementing inter-area route aggregation, the number of routing information is reduced, thereby reducing routing table sizes and improving device performance. OSPF does not support automatic route aggregation; it requires manual configuration. OSPF offers two aggregation mechanisms: inter-area route aggregation and external route aggregation. Inter-area route aggregation, also known as ABR aggregation, refers to the process where an ABR combines routes generated by Type-1 LSAs or Type-2 LSAs within its directly connected area. This reduces the number of Type-3 LSAs propagated to other directly connected areas. External route aggregation, also known as ASBR aggregation, refers to the process where an ASBR combines external routes introduced into the OSPF network. This reduces the number of Type-5 LSAs within the OSPF domain.

In OSPF network, there are four network types based on the link layer protocol type.

  • Broadcast: The OSPF network type defaults to Broadcast when the link-layer protocol is Ethernet or FDDI. In such networks, DR and BDR are automatically elected, and manual neighbor configuration is not required.
  • Non-Broadcast Multiple Access(NBMA): The OSPF network type defaults to NBMA when the link-layer protocol is Frame Relay or X.25. In such networks, DR is elected, all protocol packets are sent via unicast, and manual neighbor configuration is required.
  • Point-to-Multipoint(P2MP): OSPF does not automatically assign the P2MP network type to any link-layer protocol. P2MP must be manually configured by overriding the original network type. In this type, Hello packets are sent via multicast, while other protocol packets (e.g., DD, LSR, LSU) use unicast. P2MP networks do not elect a DR/BDR and do not require manual neighbor configuration.
  • Point-to-Point(P2P): The OSPF network type defaults to P2P when the link-layer protocol is PPP, HDLC or LAPB. In such networks, there is no need to elect a DR/BDR. Multicast address 224.0.0.5 is used to send various protocol packets, allowing routers to automatically form full adjacencies without manual neighbor configuration. DR in the above context means Designated Router and BDR means Backup Designated Router. After the election of a DR, all routers send their information only to the DR, which broadcasts the LSA. This mechanism reduces synchronization overhead within the area, lowers router memory consumption, minimizes routing update traffic, and ensures all routers in the same area maintain identical link-state information. The DR is not manually assigned but elected autonomously by routers in the area. The router with the highest priority becomes the DR (the default priority for all OSPF routers is 1, but this can be modified via configuration commands; a priority of 0 excludes a router from the election). If priorities are equal, the router with the highest Router ID is elected as the DR.

Prerequisite: Configure the interface IP so that the network layer of adjacent nodes is reachable.

Table 7 Overview of OSPF Configuration Tasks

Configuration TasksDescriptionRefer to
Basic functionsEnable OSPFRequiredEnable OSPF
Configure OSPF areaRequiredConfigure OSPF area
Configure cost for interfaceOptionalConfigure cost for interface
Configure OSPF reference bandwidthOptionalConfigure OSPF reference bandwidth
Configure OSPF network typeOptionalConfigure OSPF network type
Configure OSPF interface priorityOptionalConfigure OSPF interface priority
Configure OSPF parametersOptionalConfigure OSPF parameters
Configure OSPF interface authenticationOptionalConfigure OSPF interface authentication
Configure OSPF area authenticationOptionalConfigure OSPF area authentication
Configure OSPF route introductionOptionalConfigure OSPF route introduction
Enable BFD with OSPF LinkageOptionalEnable OSPF with BFD

Table 8 OSPF Default Setting

ParameterDefault value
OSPFDisable
Area typeStandard Area
Router IDLargest address in interface IP address list
Network typeBroadcast
OSPF parametersHello packets interval: 10sLSA retransmission interval: 5sTimeout interval: 40s

Table 9 Enable OSPF

PurposeCommandsDescription
Enter global configuration view.configure terminal-
Configure OSPF packet trap to CPUospf enableDefault disable
Configure OSPF instance.router ospf [vrf vrf-name]-
Configure the Router IDospf router-id x.x.x.xThe Router ID uniquely identifies a device within an Autonomous System

Table 10 Configure OSPF Area

PurposeCommandsDescription
Enter global configuration view.configure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure area-idip ospf area area_idarea_id: range 0-4294967295.
Enter OSPF configuration view.router ospf [vrf vrf_name]-
(Optional)Configure area typearea area_id {stub|nssa}Area type cannot be configured as a Stub area or NSSA area when area id is 0. By default, an area without explicit type configuration is classified as a standard area.

Table 11 Configure Cost For Interface

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure the costip ospf cost valuevalue: range 1-65535.

Table 12 Configure Reference Bandwidth

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter OSPF configuration view.router ospf [vrf vrf_name]-
Configure reference bandwidthauto-cost reference-bandwidth bandwidthbandwidth: range 1- 4294967Mbps.

Table 13 Configure OSPF Network Type

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure OSPF network typeip ospf network {broadcast|non-broadcast|point-to-multipoint|point-to-point}The default network type is broadcast.

Table 14 Configure OSPF Interface Priority

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure OSPF priorityip ospf priority prioritypriority: range 0-255.

Table 15 Configure OSPF Parameters

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure Hello packets intervalip ospf hello-interval secondsrange: 1-65535
Configure timeout intervalip ospf dead-interval secondsrange: 1-65535
Configure LSA retransmission intervalip ospf retransmit-interval secondsrange: 1-65535

Table 16 Configure OSPF Interface Authentication

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure Authentication Methodsip ospf authentication [message-digest]When the configuration command does not include ‘message-digest’, the authentication method is plain text authentication; when ‘message-digest’ is included, the authentication method is message digest (md5) authentication
Configure the key for plain text authenticationip ospf authentication-key auth-keyauth-key: length should be no more than 8 characters.
Configure the key for method is message digest authenticationip ospf message-digest-key key-id md5 auth-keykey-id: range 1-255. auth-key: length should be no more than 16 characters.

Table 17 Configure OSPF Area Authentication

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure the key for plain text authenticationip ospf authentication-key auth-keyauth-key: length should be no more than 8 characters.
Configure the key for method is message digest authenticationip ospf message-digest-key key-id md5 auth-keykey-id: range 1-255. auth-key: length should be no more than 16 characters.
Exit interface configuration viewexit-
Enter OSPF configuration view.router ospf [vrf vrf_name]-
Configure Authentication Methodsarea area-id authentication [message-digest]When the configuration command does not include ‘message-digest’, the authentication method is plain text authentication; when ‘message-digest’ is included, the authentication method is message digest (md5) authentication

Table 18 Configure OSPF Route Introduction

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter OSPF config view.router ospf [vrf vrf_name]-
Configure route introductionredistribute {ospf|kernel| connected|static|rip|bgp}-

Table 19 Enable OSPF with BFD

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter interface configuration viewinterface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id}-
Configure OSPF with BFD.ip ospf bfd [profile profile-name]You can modify BFD session parameters via binding to a user-defined BFD profile. The default BFD parameters are set to 3×300ms.

Table 20 OSPF Configuration Display

PurposeCommandsDescription
Show OSPF neighbor informationshow ip ospf neighbor [OPTIONs]The options for OPTIONs are as follows:all: Display summary information of all neighbors.json: Display OSPF neighbor information in json format.detail: Display neighbor details.A.B.C.D: Display information about neighbors with the specified Router ID.ethernet: Display neighbor information for the specified physical port.vlan: Display neighbor information for the specified VLANIF.link-aggregation: Display neighbor information for the specified LAG port.
Display OSPF neighbor information for the specified interfaceshow ip ospf interface [OPTIONs]The options for OPTIONs are as follows:ethernet: Display neighbor information for the specified physical port.vlan: Display neighbor information for the specified VLANIF.link-aggregation: Display neighbor information for the specified LAG port.json: Display OSPF neighbor information in json format.traffic: Display OSPF packet counts.
Display OSPF Routing Informationshow ip ospf route [OPTIONs]The options for OPTIONs are as follows:json: Display OSPF routing information in json format.
Display OSPF Link-State Informationshow ip ospf database-
  1. Networking Requirements Hosts on different network segments are connected via four switches, all running the OSPF protocol. It is required to configure OSPF neighbors so that PC1 hanging under Switch D and PC0 hanging under SwitchA can interoperate.
  2. Topology

  1. Configuration Roadmap
  2. First check that the status of each interface is UP and that the wiring is correct.
  3. Configure the IP address of each interface and the Loopback0 IP.
  4. Configure the OSPF Router-ID.
  5. Configure OSPF Area ID, authentication methods and authentication-key.
  6. Import direct routes into the OSPF protocol on Switch A and Switch D.
  7. Procedure

Switch A

interface loopback 0
ip address 10.0.1.226
exit
!
interface ethernet 0/56
fec rs
ip address 200.101.1.2/24
mtu 9216
speed 100000
ip ospf area 1
ip ospf authentication
ip ospf authentication-key 12345678
exit
!
ospf enable
!
interface ethernet 0/0
fec rs
ip address 200.101.2.1/24
mtu 9216
speed 100000
description to_PC0
exit
!
router ospf
ospf router-id 10.0.1.226
redistribute connected
exit
**Switch B**
interface loopback 0
ip address 10.0.1.110
exit
!
interface ethernet 0/48
fec rs
ip address 200.101.1.1/24
mtu 9216
speed 100000
ip ospf area 1
ip ospf authentication
ip ospf authentication-key 12345678
exit
!
interface ethernet 0/56
fec rs
ip address 200.101.3.1/24
mtu 9216
speed 100000
ip ospf area 0
ip ospf message-digest-key 1 md5 12345678
exit
!
ospf enable
!
router ospf
ospf router-id 10.0.1.110
area 0 authentication message-digest
exit

Switch C

interface loopback 0
ip address 10.0.1.225
exit
!
interface ethernet 0/48
fec rs
ip address 200.101.3.2/24
mtu 9216
speed 100000
ip ospf area 0
ip ospf message-digest-key 1 md5 12345678
exit
!
interface ethernet 0/52
fec rs
ip address 200.101.4.2/24
mtu 9216
speed 100000
ip ospf area 0
ip ospf message-digest-key 1 md5 12345678
exit
!
ospf enable
!
router ospf
ospf router-id 10.0.1.225
area 0 authentication message-digest
exit

Switch D

interface loopback 0
ip address 10.0.1.221
exit
!
interface ethernet 0/56
fec rs
ip address 200.101.4.1/24
mtu 9216
speed 100000
ip ospf area 0
ip ospf message-digest-key 1 md5 12345678
exit
!
interface ethernet 0/0
fec rs
ip address 200.101.5.1/24
mtu 9216
speed 100000
description to_PC1
exit
!
ospf enable
!
router ospf
ospf router-id 10.0.1.221
redistribute connected
area 0 authentication message-digest
exit
  1. Verify the configuration

#Check if the OSPF connection is established successfully.

Switch A

sonic# show ip ospf neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.1.110 1 Full/DR 1h44m56s 33.289s 200.101.1.1 ethernet 0/56:200.101.1.2 0 0 0

Switch B

sonic# show ip ospf neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.1.226 1 Full/Backup 1h47m33s 34.972s 200.101.1.2 ethernet 0/48:200.101.1.1 0 0 0
10.0.1.225 1 Full/DR 1h27m07s 32.434s 200.101.3.2 ethernet 0/56:200.101.3.1 0 0 0

Switch C

sonic# show ip ospf neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.1.110 1 Full/Backup 1h28m48s 38.460s 200.101.3.1 ethernet 0/48:200.101.3.2 0 0 0
10.0.1.221 1 Full/Backup 1h25m24s 35.713s 200.101.4.1 ethernet 0/52:200.101.4.2 0 0 0

Switch D

sonic# show ip ospf neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.1.225 1 Full/DR 1h25m58s 37.968s 200.101.4.2 ethernet 0/56:200.101.4.1 0 0 0

#Check for successful OSPF route exchange.

Switch A

sonic# show ip route ospf
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric,
> - selected route, \* - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
O>* 10.1.0.1/32 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20
O>* 10.1.0.137/32 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20
O>* 10.226.148.0/24 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20
O>* 10.250.0.0/24 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20
O>* 99.0.0.0/24 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20
O>* 172.1.1.0/24 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20
O>* 172.2.1.0/24 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 00:38:40
O 200.101.1.0/24 [110/10000] is directly connected, ethernet 0/56, weight 1, 01:52:41
O>* 200.101.3.0/24 [110/10010] via 200.101.1.1, ethernet 0/56, weight 1, 01:32:06
O>* 200.101.4.0/24 [110/20010] via 200.101.1.1, ethernet 0/56, weight 1, 01:30:54
O>* 200.101.5.0/24 [110/20] via 200.101.1.1, ethernet 0/56, weight 1, 01:16:20

Switch D

sonic# show ip route ospf
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric,
> - selected route, \* - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
O>* 10.250.0.0/16 [110/20] via 200.101.4.2, ethernet 0/56, weight 1, 01:18:21
O>* 172.16.1.111/32 [110/20] via 200.101.4.2, ethernet 0/56, weight 1, 01:18:21
O>* 172.16.1.226/32 [110/20] via 200.101.4.2, ethernet 0/56, weight 1, 01:18:21
O>* 200.101.1.0/24 [110/10020] via 200.101.4.2, ethernet 0/56, weight 1, 01:29:28
O>* 200.101.2.0/24 [110/10020] via 200.101.4.2, ethernet 0/56, weight 1, 01:29:28
O>* 200.101.3.0/24 [110/10010] via 200.101.4.2, ethernet 0/56, weight 1, 01:29:28
O 200.101.4.0/24 [110/10] is directly connected, ethernet 0/56, weight 1, 01:29:33

The subnet 200.101.2.0/24 is the directly connected segment of Switch A, and the subnet 200.101.5.0/24 is the directly connected segment of Switch D. This indicates that both Switch A and Switch D get each other’s directly connected routes through OSPF.

#Verify connectivity using the ping command.

PC0 and PC1 can ping each other successfully.