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 184.108.40.206 for R1 and 220.127.116.11 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 18.104.22.168 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 22.214.171.124 network 192.168.1.0 0.0.0.255 area 0 R2 router ospf 1 router-id 126.96.36.199 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 188.8.131.52 on FastEthernet0/0 from LOADING to FULL, Loading Done R1 *Mar 1 01:31:07.907: %OSPF-5-ADJCHG: Process 1, Nbr 184.108.40.206 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 (220.127.116.11) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 18.104.22.168 22.214.171.124 100 0x80000001 0x003515 1 126.96.36.199 188.8.131.52 99 0x80000002 0x00F44B 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.2 184.108.40.206 99 0x80000001 0x0009B0 R1#sh ip ospf database OSPF Router with ID (220.127.116.11) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 18.104.22.168 22.214.171.124 112 0x80000001 0x003515 1 126.96.36.199 188.8.131.52 113 0x80000002 0x00F44B 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.2 184.108.40.206 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 220.127.116.11/18.104.22.168 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 (22.214.171.124) (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: 126.96.36.199
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 (188.8.131.52) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 184.108.40.206 220.127.116.11 601 0x80000002 0x003612 1 18.104.22.168 22.214.171.124 623 0x80000003 0x00B528 2 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.2 126.96.36.199 1172 0x80000001 0x0009B0 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.10.10.10 188.8.131.52 597 0x80000001 0x00A768 Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 184.108.40.206 220.127.116.11 601 0x80000001 0x0007F9 1 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 18.104.22.168 22.214.171.124 602 0x80000001 0x003E9F 192.168.1.0 126.96.36.199 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.