Networker Interview

Prepare for CCNA, CCNP, CCIE Interview !

header photo

OSPF Interview Questions and Answers [CCNP]

What is the OSPF Routing Protocol?
Open shortest path first is an Open Standard Link State routing protocol which works by using the Dijkstra algorithm to initially construct the shortest paths and follows that by populating the routing table with resulting best paths.

What are the steps required to change neighborship into adjacency?
1. Two-way communication (using Hello Protocol).
2. Database Synchronization which means exchange of Database Description (DD) packets, Link State Request (LSR) packets, Link State Update (LSU) packets.
After Database synchronization is complete, the two routers are considered adjacent.

Explain LSA (Link-State Advertisement), LSU (Link State Update) and LSR (Link State Request)?
The LSAs (Link-State Advertisements) are used by OSPF routers to exchange routing and topology information. When two neighbors decide to exchange routes, they send each other a list of all LSAs in their respective topology database. Each router then checks its topology database and sends Link State Request (LSR) message requesting all LSAs that was not found in its topology table. Other router responds with the Link State Update (LSU) that contains all LSAs requested by the neighbor.

Explain OSPF Router ID?
Router Id is used to identify the Router. The highest IP address of the router's loopback interfaces is chosen as the Router ID, If no loopback is present then the highest IP address of the router's physical interfaces will be chosen as the Router ID. OSPF prevents neighborships between routers with duplicate RIDs. All OSPF RIDs in a domain should be unique. OSPF Router ID should not be changed after the OSPF process is started and the OSPF neighborships are established. If you change the OSPF router ID, we need to either reload the IOS or use "clear ip ospf process" command (restart the OSPF process) for changed Router ID to take effect.
To manually configure the router ID
R1(config)# router ospf 5
R1(config-router)# router-id 5.5.5.5

Can we use OSPF without backbone area?
Yes, but then only intra-area communication is possible. Inter-area communication is not possible without the backbone area.

What is the difference between an OPPF neighbor and an adjacent neighbor?
LSAs are exchanged only among adjacent routers not among neighbor routers.

What are different neighbour states in OSPF?
OSPF routers need to go through several states before establishing a neighbor relationship:-
1. Down - No Hello packets have been received on the interface.

2. Attempt - In Attempt state neighbors must be configured manually. It applies only to nonbroadcast multi-access (NBMA) networks.

3. Init - Router has received a Hello message from the other OSFP router.

4. 2way - Neighbor has received the Hello message and replied with a Hello message of his own. Bidirectional Communication has been established. In Broadcast network DR-BDR election can occur after this point.

5. Exstart - DR & BDR establish adjacencies with each router in the network. A master-slave election will take place (Master will send its DBD first).

6. Exchange - Routing information is exchanged using DBD (Database Descriptor) packets, Link-State Request (LSR) and Link-State Update packets may also be sent.

7. Loading - LSRs (Link State Requests) are send to neighbors for every network it doesn't know about. The Neighbor replies with the LSUs (Link State Updates) which contains information about requested networks. After all the requested information have been received, other neighbor goes through the same process.

8. Full - All neighbor routers have the synchronized database and adjacencies has been established.

Explain different OSPF LSA Types?
1. Router LSA (Type1)  - Each router generates a Type 1 LSA that lists its active interfaces, IP addresses, neighbors and the cost. LSA Type 1 is flooded only within an area.

2. Network LSA (Type2 - Type2 LSA is sent out by the designated router (DR) and lists all the routers on the segment it is adjacent to. Type 2 LSA are flooded only within an area.

3. Summary LSA (Type3) - Type 3 LSAs are generated by Area Border Routers (ABRs) to advertise networks from one area to the rest of the areas in Autonomous System.

4. Summary ASBR LSA (Type4) - Generated by the ABR. It contains routes to ASBRs.

5. External LSA (Type5) - External LSAs are generated by ASBRs and contain routes to networks that are external to the current Autonomous System.

6. Not-So-Stubby Area LSA (Type7) - Stub areas do not allow Type 5 LSAs.  A Not So Stubby Area (NSSA) allows advertisement of Type 5 LSA as Type 7 LSAs. Type LSA is generated by an ASBR inside a Not So Stubby Area (NSSA) to describe routes redistributed into the NSSA.

Why does the master slave need to be elected between two neighbour interface?
Master sends its DBD (Database Description) First.

Explain different OSPF Network types?
1. Broadcast
2. Non-Broadcast (NBMA)
3. Point-to-Point
4. Point-to-multipoint
5. Point-to-multipoint non-broadcast

What is the requirement of doing summarization?
1. Reduces the amount of information stored in routing tables.
2. Allocates an existing pool of addresses more economically.
3. Lessens the load on router processor and memory resources.
4. Less number of update messages.
5. Less bandwidth.

How routes are selected in OSPF according to preference?
Intra-Area routes(0)> Inter-Area routes(0-IA)> External-Type-1(E1)> External-Type-2(E2)> NSSA-1(N1)> NSSA-2(N2).

What is Route Redistribution?
Route redistribution is the process of taking routes learned via one routing protocol and injecting those routes into another routing protocol domain.
For example, two companies might merge, one company is using Enhanced Interior Gateway Routing Protocol (EIGRP) and the other is using Open Shortest Path First (OSPF). Route redistribution allows exchanging of routes between the two routing domains with a minimal amount of configuration and with little disruption to the existing networks.

What is the default redistribution OSPF cost?
Redistribution into OSPF uses the following defaults:-
1. When taking from BGP, use a default metric of 1.
2. When taking from another OSPF process, take the source route’s metric.
3. When taking from all other sources, use a default metric of 20.

What is the difference between Type-1 (E1) & Type-2 (E2) redistribution?
Type-2 is the default route type for routes learned via redistribution. The key with E2 routes is that the cost of these routes reflects only the redistributed cost. E2 = only redistributed cost.
Type-1 redistributed routes reflects the cost to reach ASBR + redistributed cost. E1 = Cost to reach ASBR + redistributed cost

Explain OSPF Virtual Link?
OSPF requires the use of a backbone area (area 0) with each area connecting to area 0 through an ABR. However, in some cases, the regular area might not have a convenient point of connection to the backbone area. In this case, OSPF uses the virtual link to connect that regular area to the backbone area virtually. An OSPF virtual link allows two ABRs that connect to the same non-backbone area to form a neighbor relationship through that non-backbone area, even when separated by many other routers and subnets. This virtual link acts as a virtual point-to-point connection between the two routers, with that link inside area 0. The routers form a neighbor relationship, inside area 0, and flood LSAs over that link.

Explain OSPF Stub Area and different types of Stub Areas?
Stub Area
Sometimes we need to control the advertisement of external routes into an area. This area is called Stub area. Stub areas are not capable of importing routes external to OSPF. Type 4 & Type 5 LSA are filtered from Stub areas and a default route is injected into that area by ABR in place of external routes. To make area stub we have to give # area 1 stub command on all routers of that area.
Three restrictions apply to OSPF stub areas
1. No virtual links are allowed in the stub area.
2. Stub area cannot be a backbone area.
3. No Autonomous System Boundary Routers are allowed.

Totally Stubby Area
Like stub areas, totally stubby areas do not receive type 4 or 5 LSAs from their ABRs. However, they also do not receive type 3 LSAs. It only allows advertisement of internal routes in that area.
To make area totally stubby area we have to give # area 1 stub no-summary command on ABR.

Not-So-Stubby Areas
The motivation behind NSSA is to allow OSPF stub areas to carry external routes. External routes are imported into OSPF NSSA as Type 7 LSA by ASBR. Type 7 LSA cannot go into area 0 so it is converted back into Type 5 LSA by ABR and injected into area 0.
To make area Not-So-Stubby Area we have to give # area 1 NSSA command on all routers of that area.

Totally NSSA
Along with Type 4 & Type 5 LSA, Type 3 LSA will also be filtered in Totally NSSA.
To make area Totally Not-So-Stubby Area we have to give # area 1 nssa no-summary command on ABR of that area.

How do I change the reference bandwidth in OSPF?
We can change the reference bandwidth using the OSPF auto-cost reference-bandwidth command under router OSPF. By default, reference bandwidth is 100 Mbps.

How does OSPF calculate its metric or cost?
OSPF uses Cost as its metric. The formula to calculate the OSPF cost is reference bandwidth divided by interface bandwidth. For example, in the case of Ethernet, it is 100 Mbps / 10 Mbps = 10.
If # ip ospf cost _ command is used on the interface, it overrides this formulated cost.

Explain OSPF Authentication?
These are the three different types of authentication supported by OSPF to secure routing updates.
1. Null Authentication - also called Type 0. It means no authentication information is included in the packet header. It is the default.
2. Plain Text Authentication - also called Type 1. It uses simple clear-text passwords.
3. MD5 Authentication - also called Type 2. It uses MD5 cryptographic passwords.

Plain Text Authentication
Step1 - To configure plain text authentication, first we have to enable authentication. Authentication can be enabled either under area or for a specific interface.
To enable authentication for area
Router(config)#  router ospf 100
Router(config-router)#  network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#  area 0 authentication  

This will enable authentication for all the interfaces of the router in area 0.
OR
If we don't want to enable authentication for an area, we can enable it for the specific interface. This is useful if different interfaces that belong to the same area need to use different authentication methods.
Router(config)#  interface fa0/1
Router(config-if)#  ip ospf authentication

Step2 - Next, We have to configure authentication key on the interface
Router(config)#  interface fa0/1
Router(config-if)#  ip ospf authentication-key Cisco123
 
Here Cisco123 is the password value.

MD5 Authentication
Step1 - To configure MD5 authentication, first we have to enable authentication.
Router(config)#  router ospf 1
Router(config-router)#  network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#  area 0 authentication message-digest  

OR
Router(config)# interface fa0/1
Router(config-router)# ip ospf authentication message-digest

Step2 - Next, We have to configure authentication key on the interface
Router(config)# interface fa0/1
Router(config-router)# ip ospf message-digest-key 10 md5 Cisco123

Here Cisco123 is the password value and 10 is the Key ID (number). It doesn’t matter which key ID you choose but it has to be the same on both ends.
Authentication passwords do not have to be the same throughout an area. However, they must be the same between neighbors.

Which command enables OSPF for IPv6 on a router?
# ipv6 router ospf process-id

What is the link-state retransmit interval, and what is the command to set it?
OSPF must send an acknowledgement of each newly received link-state advertisement (LSA). LSAs are retransmitted until they are acknowledged. The link-state retransmit interval defines the time between retransmissions. We can use the command ip ospf retransmit-interval to set the retransmit interval. The default value is 5 seconds.

When routes are redistributed between OSPF processes, are all shortest path first algorithm (SPF) metrics preserved or is the default metric value used?
The SPF metrics are preserved. The redistribution between them is like redistribution between any two IP routing processes.

How do I stop individual interfaces from developing adjacencies in an OSPF network?
To stop routers from becoming OSPF neighbors on a particular interface, issue the passive-interface command at the interface.

When I have two Type 5 link-state advertisements (LSAs) for the same external network in the OSPF database, which path should be installed in the routing table?
When you have two Type 5 LSAs for the same external network in the OSPF database, prefer the external LSA that has the shortest path to the Autonomous System Boundary Router (ASBR) and install that into the IP routing table. Use the show ip ospf border-routers command to check the cost to the ASBR.

Should I use the same process number while configuring OSPF on multiple routers within the same network?
OSPF, unlike Border Gateway Protocol (BGP) or Enhanced Interior Gateway Routing Protocol (EIGRP), does not check the process number (or autonomous system number) when adjacencies are formed between neighboring routers and routing information is exchanged.

Can we have OSPF run over a GRE tunnel?
Yes, we can have OSPF run over a GRE tunnel.

Related Post

  1. OSPF Interview Questions and Answers [CCNA]
  2. EIGRP Interview Questions and Answers [CCNP]
  3. BGP Interview Questions and Answers [CCNP]
  4. STP Interview Questions and Answers [CCNP]
  5. RSTP & MST Interview Questions and Answers [CCNP]

Go Back



Comment