OSPF LAB # 1 : “Basic” Implementation

Network Diagram

Network Diagram

Objectives

  1. Configure OSPF for the above network diagram. R1 will act as an ASBR by redistributing a series of static routes into theOSPF network. These routes should NOT increment their metric as they pass through the network and should have an initial OSPF cost of 200. All routers should have a router-id reflecting their hostname. You should be able to ping each router throughthe entire OSPF network.
  2. R1 Should become the DR for Area 0. R2 and R3 should neither become the DR or BDR. Check what type of neighbour relationship exists between R1 and R2. What about R2 and R3?
  3. Implement summarization at the ABRs R2 and R3 to make the routing tables as efficient as possible.
  4. Implement summarization at the ASBR R1. The summary route should have the same attributes as the original, individual routes redistributed into the network.
  5. We plan to upgrade to Gigabit Ethernet connections in the future. OSPF should accurately calculate its metric assuming Gigabit Ethernet will be the fastest link in the network.

Let’s take a look at the first Objective.

1. Configure OSPF for the above network diagram. R1 will act as an ASBR by redistributing a series of static routes into the OSPF network. These routes should NOT increment their metric as they pass through the network and should have an initial OSPF cost of 200. All routers should have a router-id reflecting their hostname. You should be able to ping each router through the entire OSPF network.

First we must ofcourse configure our interfaces and set up the OPSF neighbour relationships and areas. At the same time I will also configure the router IDs to reflect the hostnames.

Console logging will be disabled during this configuration to keep everything clean and readable.
This can be done with the global config command “no logging console“.
All interfaces have also been already enabled with the interface config command “no shutdown“.

R1>
R1>en
R1#conf t
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 172.30.0.1 255.255.255.0
R1(config-if)#end
R1#conf t
R1(config)#router ospf 10

I will be using OSPF process-id 10 on all routers for ease of config. The process-id does not need to match on all routers like the Autonomous System number needs to in EIGRP.

“From Cisco tech notes: The OSPF process-id is a numeric value local to the router. It does not have to match process-ids on other routers. It is possible to run multiple OSPF processes on the same router, but is not recommended as it creates multiple database instances that add extra overhead to the router.”
 

R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 172.30.0.0 0.0.0.255 area 0

That’s done, now on to R2.

R2>
R2>en
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int fa 0/0
R2(config-if)#ip address 172.30.0.2 255.255.255.0
R2(config-if)#int se 0/0
R2(config-if)#ip address 172.30.10.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#end
R2#conf t
R2(config)#router ospf 10
R2(config-router)#network 172.30.0.0 0.0.0.255 area 0
R2(config-router)#network 172.30.10.0 0.0.0.255 area 10
R2(config-router)#router-id 2.2.2.2

On to R3

R3>
R3>en
R3#conf t
R3(config)#int fa 0/0
R3(config-if)#ip address 172.30.0.3 255.255.255.0
R3(config-if)#int se 0/0
R3(config-if)#ip address 172.30.20.3 255.255.255.0
R3(config-if)#clock rate 64000
R3(config-if)#end
R3#conf t
R3(config)#router ospf 10
R3(config-router)#network 172.30.0.0 0.0.0.255 area 0
R3(config-router)#network 172.30.20.0 0.0.0.255 area 20
R3(config-router)#router-id 3.3.3.3

On to R4

R4>
R4>en
R4#
R4#conf t
R4(config)#interface serial 0/0
R4(config-if)#ip address 172.30.20.4 255.255.255.0
R4(config-if)#end
R4#conf t
R4(config)#router ospf 10
R4(config-router)#network 172.30.20.0 0.0.0.255 area 20
R4(config-router)#router-id 4.4.4.4

And finally R5

R5>
R5>en
R5#conf t
R5(config)#interface serial 0/0
R5(config-if)#ip address 172.30.10.5 255.255.255.
R5(config-if)#end
R5#conf t
R5(config)#router ospf 10
R5(config-router)#network 172.30.10.0 0.0.0.255 area 10
R5(config-router)#router-id 5.5.5.5

There, my base configuration is ready. You can verify that the neighbourships have formed with the command “show ip ospf 10 neighbor“. Also try a few ping tests to make sure you have full connectivity.

R1#ping 172.30.20.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.30.20.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/20/40 ms

Seems ok to me !
Now, what’s left for our first objective?

R1 will act as an ASBR by redistributing a series of static routes into the OSPF network. These routes should NOT increment their metric as they pass through the network and should have an initial OSPF cost of 200.
 

Okay, let’s go on R1 and get this done.
First I’ll create the static routes.

R1#conf t
R1(config)#ip route 172.16.0.0 255.255.255.0 Null0
R1(config)#ip route 172.16.1.0 255.255.255.0 Null0
R1(config)#ip route 172.16.2.0 255.255.255.0 Null0
R1(config)#ip route 172.16.3.0 255.255.255.0 Null0

These routes are pointing towards the Null 0 interface meaning all packets sent here will be discarded.
That is okay because we are only using these routes to test redistribution.

And the redistribution of these static routes;

R1(config)#router ospf 10
R1(config-router)#redistribute static metric 200 subnets

I’m adding “subnets” to the command because When redistributing routes into OSPF, only routes that are not subnetted are redistributed if the subnets keyword is not specified.
I’m adding the “Metric 200” part because the objective is asking for an OSPF cost of 200 for these routes.

NOTE: You can also define the metric-type for these routes.

R1(config-router)#redistribute static metric 200 subnets metric-type ?
1  Set OSPF External Type 1 metrics
2  Set OSPF External Type 2 metrics

“From Cisco tech notes: External routes fall under two categories, external type 1 and external type 2. The difference between the two is in the way the cost (metric) of the route is being calculated. The cost of a type 2 route is always the external cost, irrespective of the interior cost to reach that route. A type 1 cost is the addition of the external cost and the internal cost used to reach that route. A type 1 route is always preferred over a type 2 route for the same destination.”
 

The default metric-type is 2 which is also our objective.
We can verify this config with the priviliged mode command “show ip protocols

R1#sh ip protocols
Routing Protocol is “ospf 10”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 1.1.1.1
It is an autonomous system boundary router
Redistributing External Routes from,
static with metric mapped to 200, includes subnets in redistribution
Number of areas in this router is 1. 1 normal 0 stub 0 nssa

This is a cool command. You can see its router-ID, The fact that it has become an ASBR (because of the static route redistribution) and the way it is redistributing the routes.
And that’s it for objective 1. Now on to the second objective.

2. R1 Should become the DR for Area 0. R2 and R3 should neither become the DR or BDR. Check what type of neighbour relationship exists between R1 and R2. What about R2 and R3?
 

Easy enough. We need to use the interface config command “IP OSPF Priority

First I’ll make sure R1 has the highest priority.

R1(config)#int fa 0/0
R1(config-if)#ip ospf priority 200

I will set the priority for R2 and R3 to 0 because we do not want them to become the DR/BDR.

R2(config)#int fa 0/0
R2(config-if)#ip ospf priority 0

R3(config)#int fa 0/0
R3(config-if)#ip ospf priority 0

It’s possible you need to clear the OSPF process before you can see the changes.
You can do this with the priviliged mode command “clear ip ospf 10 process

R1#clear ip ospf 10 process
R2#clear ip ospf 10 process
R3#clear ip ospf 10 process

Now let’s check our neighbour relationships.

R1#sh ip ospf 10 neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/DROTHER    00:00:34    172.30.0.2      FastEthernet0/0
3.3.3.3           0   FULL/DROTHER    00:00:35    172.30.0.3      FastEthernet0/0

We can see the other two routers are set as “DROTHER” because they are neither the DR or BDR.
Let’s check if R1 has become the DR like we wanted with the command “show ip ospf 10 interface“.

R1#sh ip ospf 10 interface
FastEthernet0/0 is up, line protocol is up
Internet Address 172.30.0.1/24, Area 0
Process ID 10, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 100
Transmit Delay is 1 sec, State DR, Priority 200
Designated Router (ID) 1.1.1.1, Interface address 172.30.0.1
No backup designated router on this network

Looking good, we can see it has priority 200, it has a state of DR and that there are no BDRs on this network.

Now what is the relationship between R2 and R3?

R2#sh ip ospf 10 neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1         200   FULL/DR         00:00:30    172.30.0.1      FastEthernet0/0
3.3.3.3           0   2WAY/DROTHER    00:00:35    172.30.0.3      FastEthernet0/0

A “Full” state has been established with R1 because it is the DR.
A “2way” state has been established with R3 because it is a “DROTHER”.

Check these Cisco tech notes for more information on the OSPF Neighbour states.

And with that, we have finished objective 2 and are feeling good about ourselves!

Let’s take a look at the third objective.

3. Implement summarization at the ABRs R2 and R3 to make the routing tables as efficient as possible.
 
 

Okay, this is talking about those loopback interfaces on R4 and R5 you can see in the diagram.
I have not yet created those so let’s do that first and also enter the network commands.

R4(config)#interface loopback 1
R4(config-if)#ip address 10.20.0.1 255.255.255.0
R4(config-if)#interface loopback 2
R4(config-if)#ip address 10.20.1.1 255.255.255.0
R4(config-if)#interface loopback 3
R4(config-if)#ip address 10.20.2.1 255.255.255.0
R4(config-if)#interface loopback 4
R4(config-if)#ip address 10.20.3.1 255.255.255.0

R4(config)#router ospf 10
R4(config-router)#network 10.20.0.0 0.0.0.255 area 20
R4(config-router)#network 10.20.1.0 0.0.0.255 area 20
R4(config-router)#network 10.20.2.0 0.0.0.255 area 20
R4(config-router)#network 10.20.3.0 0.0.0.255 area 20

R5(config)#interface loopback 1
R5(config-if)#ip address 10.10.0.1 255.255.255.0
R5(config-if)#interface loopback 2
R5(config-if)#ip address 10.10.1.1 255.255.255.0
R5(config-if)#interface loopback 3
R5(config-if)#ip address 10.10.2.1 255.255.255.0
R5(config-if)#interface loopback 4
R5(config-if)#ip address 10.10.3.1 255.255.255.0

R5(config)#router ospf 10
R5(config-router)#network 10.10.0.0 0.0.0.255 area 10
R5(config-router)#network 10.10.1.0 0.0.0.255 area 10
R5(config-router)#network 10.10.2.0 0.0.0.255 area 10
R5(config-router)#network 10.10.3.0 0.0.0.255 area 10

Okay, those are configured and ready.

For the summarization we can look at the range of the loopback addresses at R4 and R5.
If you do some calculations, you will see that a mask of /20 will encompass all needed ranges.

Now let’s move to R2 and R3 to implement the Summarization.
Note that R4 and R5 can not do summarization because they are “internal” routers to their area.

We can do this with the router ospf config command “Area 10 range ip-address mask“.

R2(config)#router ospf 10
R2(config-router)#area 10 range 10.10.0.0 255.255.252.0

R3(config)#router ospf 10
R3(config-router)#area 20 range 10.20.0.0 255.255.252.0

Okay, that is configured. Now let’s look what R1 thinks about our configuration.

R1#sh ip route
10.0.0.0/22 is subnetted, 2 subnets
O IA    10.10.0.0 [110/748] via 172.30.0.2, 01:07:05, FastEthernet0/0
O IA    10.20.0.0 [110/748] via 172.30.0.3, 01:07:04, FastEthernet0/0

It looks pretty content with what we have done. All those routes are being nicely summarized.
We can also see “IA” which tells us this is an “inter-area route” because it’s coming from area 10 and 20.

What’s next?

4. Implement summarization at the ASBR R1. The summary route should have the same attributes as the original, individual routes redistributed into the network.

Alright, this is for the static routes that we redistributed earlier.
At the moment they are showing up like so;

R5#sh ip route 172.16.0.0
Routing entry for 172.16.0.0/24, 4 known subnets

O E2    172.16.0.0 [110/200] via 172.30.10.2, 00:02:48, Serial0/0
O E2    172.16.1.0 [110/200] via 172.30.10.2, 00:02:53, Serial0/0
O E2    172.16.2.0 [110/200] via 172.30.10.2, 00:02:53, Serial0/0
O E2    172.16.3.0 [110/200] via 172.30.10.2, 00:02:53, Serial0/0

We can see they’re E2 routes like we wanted but this table could be shortened.

Let’s go to R1 and do exactly that with the router ospf command “summary-address“.

R1(config)#router ospf 10
R1(config-router)#summary-address 172.16.0.0 255.255.252.0

Et voila, now let’s go check back on R5;

R5#sh ip route

172.16.0.0/22 is subnetted, 1 subnets
O E2    172.16.0.0 [110/200] via 172.30.10.2, 00:01:29, Serial0/0

Alright. It went from four to just one entry and we can also see the metric has remained the same.
So summarizing routes like this, did not change our previous metric configuration, neat.
This meets our goals for objective numero quatro.

The final objective.

5. We plan to upgrade to Gigabit Ethernet connections in the future. OSPF should accurately calculate its metric assuming Gigabit Ethernet will be the fastest link in the network. Check if costs are correctly being calculated after implementing this.

This can be done with the router ospf command “auto-cost reference-bandwidth
We are changin the reference bandwidth to 1000 because our gigabit links will be the fastest in our network.

R1(config-router)#auto-cost reference-bandwidth ?
<1-4294967>  The reference bandwidth in terms of Mbits per second
R1(config-router)#auto-cost reference-bandwidth 1000
% OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers.

We get a warning that this must be configured on all routers. This is just copy-pasting again so I’m not going to put that entire process in here.

After the reference bandwidth has been changed, you can see this reflected in the calculated metric for each route.
Note that the original reference was 100 (Fast ethernet) and is now changed to 1000 (Gigabit ethernet)

For example, on R5 we see;

O IA    172.30.20.0 [110/1394] via 172.30.10.2, 01:24:23, Serial0/0

Administrative distance is 110 (OSPF) but a metric or “cost” of 1394 you say? Let’s see how it calculated that.

The formula is as following: “reference bandwidth divided by interface bandwidth”

First, the bandwidth for a serial link;

R5#sh int se 0/0 | incl BW
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,

So that is (in kilobit) 1000000/1544 = 647
I’ll do 647 x 2 because there are two serial links involved.

647 * 2 = 1294 + 100 (for the 100 mpbs link between R2 and R3) = 1394.

All objectives have been completed.
The end.

Startup-config of each router used in this lab can be downloaded here.

This lab has been based on Jeremy Cioara’s “Implementing Basic OSPF” video over at cbtnuggets.com
Further References used are:
OSPF FAQ
OSPF Design guide

2 responses to “OSPF LAB # 1 : “Basic” Implementation

  1. you didn’t solve all the objective in number 1, the last sentence says we should be able to ping the router-id from anywhere in the network, you didn’t solve that…….

  2. In point 3 you say:
    “If you do some calculations, you will see that a mask of /20 will encompass all needed ranges.”

    I think you didn´t do yours and then noticed it as for R4´s and R5´s subnets you should use 10.0.20.0/22=10.20.0.1 – 10.20.3.254, which you configured :-)

    area 10 range 10.20.0.0 255.255.252.0

    You can see it too in point 4 when you configure R1 with the summary-address and then you check R5´s ip route:

    R1(config-router)#summary-address 172.16.0.0 255.255.252.0

    R5#sh ip route
    172.16.0.0/22 is subnetted, 1 subnets

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s