show ip ospf neighbor – Sass Learns https://sassenachlearns.com/ Thu, 08 Jun 2023 23:09:22 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.2 OSPF Neighbor Adjacency Requirements https://sassenachlearns.com/2017/10/22/ospf-neighbor-adjacency-requirements/ https://sassenachlearns.com/2017/10/22/ospf-neighbor-adjacency-requirements/#respond Sun, 22 Oct 2017 22:07:00 +0000 https://sassenachlearns.com/?p=136 Routing Protocols, unlike humans, can choose their neighbors. We, no matter what we do, cannot choose who’s going to rent or occupy the house near us. Yeah, we like to have handsome neighbors, neighbors with abs, educated persons, kind and thoughtful, clean and tidy, caring, and the most important one is someone with a stable job. However, in reality, it can be anyone. There is no such choice or whatever. Are we really looking for neighbors or fiance?

OSPF, like any other routing protocols, can agree or decline neighborship if their requirements are not met. Here are the adjacency requirements in order to form neighborship with OSPF:

1. same area ID
2. same subnet
3. same authentication type and authentication password
4. same hello and dead timers configuration
5. same area type

AREA ID

You configure Hyla s2/0 interface in area 1 and you configure Anaxyrus s2/1 interface in area 0. Do you think they are going to be neighbors? No. The first thing that OSPF checks is to form adjacencies with routers in the same area. It will be a mismatch if they are not on the same area.

Bringing back my topology on my previous post:

Anopheles(config)#router ospf 2
Anopheles(config-router)#network 192.168.12.0 0.0.0.255 area 0

Culex(config)#router ospf 1
Culex(config-router)#no network 192.168.12.0 0.0.0.255 area 0
Culex(config-router)#network 192.168.12.0 0.0.0.255 area 10
*Oct 18 23:54:34.411: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 192.168.12.2, Serial2/0

An invalid packet has seen indicating a mismatch area ID.

SUBNET MASK

A subnet mask is part of a Hello packet and one of the criteria that OSPF looks to form adjacencies. If you configure the two links in a different subnet, it will show a mismatch in hello packet parameters. This indicates that both links have different subnet masks. There is somehow a debate about this because this one should not be a mandatory requirement for OSPF adjacency. Subnet mask in point-to-point links is ignored and formed neighborship even connected links don’t have the same subnet mask. I will show you my lab example in my future posts.

AUTHENTICATION TYPE/AUTHENTICATION PASSWORD

As the name explicitly states, it is all about authentication configuration on OSPF. You must sure that if you have configured authentication on one link, you should have the same authentication configured on the remote link as well. And the authentication type should be the same: 0 – no password, 1 – plain text, and 2 – MD5 password. Lastly, the authentication key should be the same as well. I have a separated full-blown post regarding OSPF authentication.

HELLO AND DEAD TIMERS

EIGRP doesn’t care about its hello and dead timers but OSPF does. Hello and dead timers are OSPF Hello parameters and they must match or else adjacencies will not be formed. These two parameters are very crucial in determining if a neighbor still exists or not. A hello interval indicates how often the hello packet is sent while the dead timer indicates how long the neighbor router should wait for hello packets before declaring its link dead. The default hello interval for broadcast and point-to-point links is 10 seconds while dead timer is 40 seconds. And for the NBMA, point-to-multipoint, and point-to-multipoint NBMA hello timer default is 30 seconds while dead timer is 120 seconds. Did you notice that the dead timer is always four times the value of hello timer?

AREA TYPE

This is where OSPF area types like StubTotally StubbyNSSA, and Totally NSSA come into play. Looking back on my previous post regarding area types, if you want to configure a certain area as Stub, Totally Stubby, NSSA, and Totally NSSA all the routers in this area should be in the same area type as well or else no adjacencies will be formed.

OSPF NETWORK TYPE
There are different OSPF network types: Broadcast, Non-Broadcast, Point-to-point, and Point-to-multipoint. Network type is not usually tagged as one of the mandatory requirements to form neighborship with OSPF. However, incompatible network types can’t form adjacency to each other. These network types can be further classified as DRs and non-DR types. Combining a DR and non-DR will not form OSPF adjacencies.

]]>
https://sassenachlearns.com/2017/10/22/ospf-neighbor-adjacency-requirements/feed/ 0
The OSPF Virtual Link https://sassenachlearns.com/2017/10/20/the-ospf-virtual-link/ https://sassenachlearns.com/2017/10/20/the-ospf-virtual-link/#respond Fri, 20 Oct 2017 22:19:00 +0000 https://sassenachlearns.com/?p=144 The golden rule in designing an OSPF network is to have all the areas physically connected to the backbone area. No matter how many areas you want to have, they should be connected to the Area 0. This is the OSPF design and as what I’ve been saying since my previous posts, we cannot argue with how it is designed. The one who designed this have worked on this and tested this a lot of times. There are many trial and errors before this was officially brought to the public. I’ve been told that this is to prevent routing loops. Routers can exchange routes to all networks and if they are divided into areas, they cannot see others routes beyond their area and this would make them vulnerable to routing loops. I haven’t tried this kind of scenario on the lab that will show that routing loops occur when you don’t connect the areas to Area 0. One thing that I’ve tried is when you don’t connect an area directly to area 0, routes will not be learned by other routers in the other areas.

So here’s the Virtual Link. Virtual link is the solution to fix this broken OSPF design. You don’t need to physically interconnect an area but a logical connection in between a router connected to Area 0 and to a router connected to an Area not connected to Area 0. Confuse? Yeah, it is really hard when you just read it. Without digging deeper, as the name implies, it’s a virtual link. So let’s try to lab it!

OSPF Virtual Link

There are 3 areas in this lab: area 0, area 20 and area 200. As per OSPF golden rule, areas should all be connected to area 0. On this diagram, area 20 comply with this rule while area 200 does not.

I have configured the basic OSPF configuration connectivity for Tianjin, Danyang, and BangNa routers. Pings are successful except for loopback200 – 203 because I haven’t added the said area.

Tianjin: ping result
Danyang: ping result
BangNa: ping result
BangNa#conf t
 Enter configuration commands, one per line. End with CNTL/Z.
 BangNa(config)#router ospf 3
 BangNa(config-router)#network 192.168.200.0 0.0.3.255 area 200
 BangNa(config-router)#exit
 BangNa(config)#int lo3
 BangNa(config-if)#ip ospf network point-to-point
 BangNa(config)#int range lo200 - 203
 BangNa(config-if-range)#ip ospf network point-to-point
BangNa: show ip route

Now that area 200 has been added to BangNa router and since it is not connected to area 0 but connected to area 20, this what happens:

Danyang to BangNa ping result
Danyang: show ip route

Danyang doesn’t know how to go to the 192.168.200.1 because it is not on its routing table. This is what I’m talking about earlier, if it is not connected to area 0 then they will not exchange routes for that area. There are no area 200 routes on the ABR so to fix this let’s use a virtual link.

Before using a virtual link, you must know the router IDs. I did not hardcoded the router ID so let’s make use of show ip ospf, show ip protocols, or show ip ospf interface to know the router IDs.

BangNa router ID: show ip ospf
Danyang router ID: show ip protocols

Looking at Danyang router, it’s router ID is 172.16.2.1 while BangNa has router ID of 192.168.203.1. When I first learned about the virtual link, I thought we could just make use of loopback IP and should be active and configured. I’m wrong. The physical IP address is also allowed and even the IP is not active nor configured on any interface as long as it is configured as router ID, it should work.

BangNa(config)#router ospf 3
BangNa(config-router)#area 20 virtual-link 172.16.2.1
BangNa(config-router)#
*Oct 19 15:50:43.235: %OSPF-5-ADJCHG: Process 3, Nbr 172.16.2.1 on OSPF_VL0 from LOADING to FULL, Loading Done
BangNa(config-router)#end
BangNa#
*Oct 19 15:50:53.675: %SYS-5-CONFIG_I: Configured from console by console
BangNa#conf t
Enter configuration commands, one per line. End with CNTL/Z.
BangNa(config)#router ospf 3
BangNa(config-router)#router-id 192.168.204.1

I changed my BangNa router ID from 192.168.203.1 to 192.168.204.1.

Danyang: show ip route and show ip ospf neighbor
BangNa: show ip ospf neighbor

There are two same router IDs on both BangNa and Danyang routers. One is for the area 20 and the other one for the virtual link as indicated with “OSPF_VL” interface. You can also check it via “show ip ospf interface.”

BangNa: show ip ospf interface

BangNa’s router ID, 192.168.204.1, is configured as point-to-point and virtual link network type.

Same goes with Danyang.

Amazing right? Now that there is virtual link configured, area 200 is somehow logically connected to area 0. Danyang and Tianjin can now ping routers from this area.

(Sigh) Virtual link is such a remedy on broken OSPF design. I was just thinking that if love has this kind of technology, there will be no broken hearts in the world.

]]>
https://sassenachlearns.com/2017/10/20/the-ospf-virtual-link/feed/ 0
OSPF Areas: The OSPF Stub Area https://sassenachlearns.com/2017/10/17/ospf-areas-the-ospf-stub-area/ https://sassenachlearns.com/2017/10/17/ospf-areas-the-ospf-stub-area/#respond Tue, 17 Oct 2017 21:54:00 +0000 https://sassenachlearns.com/?p=111 Stub Area is usually configured when there is only a single exit point on the network. It is like the dead-end of the OSPF network. This type of OSPF area only allows Inter-Area, Intra-Area and default route from ABRs. Thus, LSA Type 1, Type 2 and Type 3 are allowed to enter. It restricts LSA Type 5 from entering their zone. Recall the LSA Types on my previous post. LSA Type 5 is External LSA advertised by the ASBR. Routers configured as “stub” doesn’t care about external routes. Thus, you cannot see any O E1 or E2 on the routing table of the routers within the Stub area. Since it doesn’t bother to know LSA Type 5, there is no sense to know about LSA Type 4. As simple as it is, you cannot create virtual link in Stub Area and there is no ASBR as well.

It is very easy to understand Stub Area if you are going to configure and apply it in the laboratory. A few years ago, what I did is just memorize the concepts of OSPF Stub Area. But after being away from the Academy for so long, my own brain failed to store my memories about it. As we all know the brain is flexible in storing lots of lots information about what you’ve learned, experienced, your everyday life since birth, and so on. However, it is not a reliable storage most especially if you are not doing it every day (And it is not that quite memorable enough to be remembered).

One day, I was asked by an Erudite about the Stub Area.

“What is that again?” I asked my brain.

My brain whispered, “Uhm… I don’t know… I think there is nothing special on it.”

“What on bits-and-bytes!”

Analyzing the routing table and the result after configuration will help you understand the Stub area better than reading it a hundred times.

OSPF Stub Area

Assuming that you have configured the interfaces and the OSPF adjacencies are established on each router, let us configure Aedes router and Anopheles router as part of the Stub Area:

Aedes#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Aedes(config)#router ospf 3
Aedes(config-router)#area 20 stub
Aedes(config-router)#end


Anopheles#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Anopheles(config)#router ospf 2
Anopheles(config-router)#area 20 stub
Anopheles(config-router)#end
Anopheles#

Easy?

Now, this is the fun part. Let’s take a look at the routing tables of each router before and after we configure Aedes and Anopheles routers as stub.

Culex: show ip ospf neighbor and show ip route

The output above is captured from Culex. Culex’ neighborship with Anopheles is still up. The loopback network address of Anopheles, 192.168.2.0 (appearing as “O“), is learned by Culex through the directly connected interface address 192.168.12.2 of Anopheles.  Aedes network 192.168.3.0 and the 192.168.23.0 network configured between Aedes and Anopheles appeared as “O IA” before and after Aedes and Anopheles are configured as Stub Area. Therefore, since Culex is in Area 0 and not configured as part of Stub Area, it’s routing table did not change after I configured Aedes and Anopheles router as part of Stub network.

The same goes with its database:

Culex: show ip ospf database

Router Link State (LSA Type 1) shows router IDs of Culex and Anopheles, while the Summary Net (LSA Type 3) shows the 192.168.3.0 and 192.168.23.0 network being generated and advertised by Anopheles.

Culex: show ip ospf database

If you are thinking that there are some changes on the Anopheles router, we’ll there is none on the routing table and OSPF adjacencies.

Anopheles: show ip ospf neighbor and show ip route

Before and after screenshot shows that Anopheles is still converged with Culex and Anopheles and the routing table still shows that there are 3 directly connected links and 2 OSPF neighbors (192.168.1.0 and 192.168.3.0).

However, the Anopheles database has changed. The Summary Net Link States(LSA Type 3) now shows the default route 0.0.0.0 being advertised to the Aedes router.

Anopheles: show ip ospf database

Looking at the Aedes router, though the neighborship is still the same, its routing table is changed after it was configured as part of Stub Area network. A Type 3 LSA is injected into the area by Anopheles to act as a default route. This allows Aedes to connect to other routers outside the stub area.

Aedes: show ip ospf neighbor and show ip route
Aedes: show ip ospf database

Lastly, what did you notice on the database of each router? Aren’t they the same?

Anopheles, since it is the ABR, has the database of both Area 0 and Area 20. It has the same database with Culex in Area 0 and same database with Aedes in Area 23. We, therefore, conclude, that it is true that OSPF maintains the same database in each area. Amazing, right?

]]>
https://sassenachlearns.com/2017/10/17/ospf-areas-the-ospf-stub-area/feed/ 0