Today I will continue with my OSPF series and dive into some command line. I will hopefully gel together what we have touched on thus far and show off the OSPF database. Before we start I wanted to share some good news. I resigned from my currently employee about a week ago. I will be moving into a much faster pace, mission critical environment where redundancy is paramount in every single aspect. More will come as I get started (skill level is going to a sharp vertical climb) but for now lets continue with today’s blog post.
I have slowly been introducing you to OSPF at this stage from a theory side and explained some of the basic concepts. Shortest Path First, OSPF Database and LSA’s, and how neighbor adjacency forms. Today I will go through on the CLI and explain this further. Let’s hope today we can put our theory into practice.
So today we will start with a simple topology of two routers directly connected via a switch. Each device will have a loop back adapter with an IP address. Simple multi-area OSPF coupled with some honest to goodness OSPF routing. Below is the topology we are going to use.
Alright. Today we are going to achieve the following tasks. I will outline them first and then we shall progress through them.
- Assign IP addresses to interfaces and devices.
- Configure and Verify basic connectivity
- Configure and Verify Area 0 OSPF. Set the OSPF ID to 22.214.171.124 for R1 and 126.96.36.199 for R2.
- Configure and Verify multi-area OSPF.
Easy enough. Let’s get started.
Configure and Verify IP addressing
R1 interface Loopback0 description Lo0_A1 ip address 10.10.10.10 255.255.255.0 ! interface FastEthernet0/0 description LINK_TO_R2 ip address 192.168.1.1 255.255.255.0 R2 interface Loopback0 description Lo0_A0 ip address 188.8.131.52 255.255.255.0 ! interface FastEthernet0/0 description LINK_TO_R1 ip address 192.168.1.2 255.255.255.0
R1#ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 20/23/28 ms R1#sh ip arp Protocol Address Age (min) Hardware Addr Type Interface Internet 192.168.1.1 - c000.0dff.0000 ARPA FastEthernet0/0 Internet 192.168.1.2 0 c001.0dff.0000 ARPA FastEthernet0/0
The Initial lost ping is ARP doing it’s thing.
OSPF time. We are going to initially set router id’s on each of the switches and enable OSPF on the 192.168.1.0/24 network for Area 0.
R1 router ospf 1 router-id 184.108.40.206 network 192.168.1.0 0.0.0.255 area 0 R2 router ospf 1 router-id 220.127.116.11 network 192.168.1.0 0.0.0.255 area 0
This simple configuration will broadly enable OSPF on each router. First thing to notice is that OSPF uses the wildcard mask. It is the inverse of the subnet mask. I do believe that this is a great concept and quite easily remember. How I remember the wildcard mask is in my head have 255.255.255.255 and subtract the subnet mask of the network.
255.255.255.255 -255.255.255.0 ------------------- 0 . 0 . 0 . 255
Notice the neighbor relationship’s now have come up. This is confirmed by what is printed by the logging,
R2 *Mar 1 01:31:07.599: %OSPF-5-ADJCHG: Process 1, Nbr 18.104.22.168 on FastEthernet0/0 from LOADING to FULL, Loading Done R1 *Mar 1 01:31:07.907: %OSPF-5-ADJCHG: Process 1, Nbr 22.214.171.124 on FastEthernet0/0 from LOADING to FULL, Loading Done
Remember back to the previous piece that LSA’s are generated and there were Router, Network and Summary. At this stage we should see Type 1 and 2 LSAs. Let’s confirm this.
R2#sh ip ospf database OSPF Router with ID (126.96.36.199) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 188.8.131.52 184.108.40.206 100 0x80000001 0x003515 1 220.127.116.11 18.104.22.168 99 0x80000002 0x00F44B 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.2 22.214.171.124 99 0x80000001 0x0009B0 R1#sh ip ospf database OSPF Router with ID (126.96.36.199) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 188.8.131.52 184.108.40.206 112 0x80000001 0x003515 1 220.127.116.11 18.104.22.168 113 0x80000002 0x00F44B 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.2 22.214.171.124 113 0x80000001 0x0009B0
Easy done! OSPF is running and sharing advertisements. You can see the Link ID which is the IP of the interface that is advertising the OSPF and the router-id being used for 126.96.36.199/188.8.131.52 respectively.
Task Three verified and complete
Now we come to the fun of OSPF. As mentioned prior, Area’s can define branches, routing groups or physical portions of the network. The loopback we are adding to this network (simulating the 10.10.10.10.0 network in our case) will be assigned to Area 1.
router ospf 1 network 10.10.10.0 0.0.0.255 area 1
Simple yet subtle change can make all the difference. First of all let’s check R2’s routing table.
R2#sh ip route ospf 10.0.0.0/32 is subnetted, 1 subnets O IA 10.10.10.10 [110/11] via 192.168.1.1, 00:07:43, FastEthernet0/0
Look at that. O IA – OSPF inter area route. Just what we wanted. Now let’s check out the LSA database of R2.
R2#sh ip ospf data summ
OSPF Router with ID (184.108.40.206) (Process ID 1)
Summary Net Link States (Area 0)
Routing Bit Set on this LSA
LS age: 519
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 10.10.10.10 (summary Network Number)
Advertising Router: 220.127.116.11
LS Seq Number: 80000001
Network Mask: /32
TOS: 0 Metric: 1
Notice the advertising router. Coming from R1. This is great. Now let’s compare and confirm with the OSPF database on R1
OSPF Router with ID (18.104.22.168) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 22.214.171.124 126.96.36.199 601 0x80000002 0x003612 1 188.8.131.52 184.108.40.206 623 0x80000003 0x00B528 2 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.2 220.127.116.11 1172 0x80000001 0x0009B0 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.10.10.10 18.104.22.168 597 0x80000001 0x00A768 Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 22.214.171.124 126.96.36.199 601 0x80000001 0x0007F9 1 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 188.8.131.52 184.108.40.206 602 0x80000001 0x003E9F 192.168.1.0 220.127.116.11 604 0x80000001 0x0013B1
Here you can see that there is both areas. This router is an Area Border Router (ABR) and has an interface in each area. Notice there is database entries for each area. Take your time and get used to this.
This is a brief entry into OSPF but we will dig deeper as we get through this series.
I think I’ve opened a can of worms.