Just another Cisco blog
OSPF Lab #1 Walkthrough
This is the walkthrough for OSPF Lab #1.
Here’s the topology:

Click here for the initial configs
Here is task one:
1. Configure R1′s s0/0.102 interface and R2′s s0/0.201 interface in area 12, this area should not receive any Type 5 LSAs. Configure R1′s s0/0.103 interface and R3′s s0/0.301 interface in area 13, R1 should only receive a default route from R3, no other OSPF routes should be in R1′s RIB (from R3). Do not use network statements to accomplish this task.
Config:
R1(config)#interface Serial0/0.102 point-to-point R1(config-subif)#ip ospf 100 area 12 R1(config-subif)# R1(config-subif)#interface Serial0/0.103 point-to-point R1(config-subif)#ip ospf 100 area 13 R1(config-subif)# R1(config-subif)#router ospf 100 R1(config-router)#area 12 stub R1(config-router)#area 13 stub R2(config)#interface Serial0/0.201 point-to-point R2(config-subif)#ip ospf 100 area 12 R2(config-subif)# R2(config-subif)#router ospf 100 R2(config-router)#area 12 stub R3(config)#interface Serial0/0.301 point-to-point R3(config-subif)#ip ospf 100 area 13 R3(config-subif)# R3(config-subif)#router ospf 100 R3(config-router)#area 13 stub no-summary |
Here we configure OSPF 100 under the routers’ interfaces (avoiding network statements). Then we configure R1 and R2′s link/area as a stub. Last we configure R1 and R3′s link/area as a totally stubby area, preventing R3 from sending anything buy a default route to R1.
Task two:
2. Configure R2, R3 and R4′s ethernet interfaces in area 0. R4 and R5′s serial interfaces should be in area 45. Area 45 should not receive any type 5 LSAs. R5 is an ASBR connected to the internet, it should be the default gateway for the entire OSPF domain.
Config:
R2(config)#interface Loopback0 R2(config-if)#ip ospf 100 area 0 R2(config-if)# R2(config-if)#interface FastEthernet0/0 R2(config-if)#ip ospf 100 area 0 R3(config)#interface Loopback0 R3(config-if)#ip ospf 100 area 0 R3(config-if)# R3(config-if)#interface FastEthernet0/0 R3(config-if)#ip ospf 100 area 0 R4(config)#interface Loopback0 R4(config-if)#ip ospf 100 area 0 R4(config-if)# R4(config-if)#interface FastEthernet0/0 R4(config-if)#ip ospf 100 area 0 R4(config-if)# R4(config-if)#interface Serial0/0 R4(config-if)#ip ospf 100 area 45 R4(config-if)# R4(config-if)#router ospf 100 R4(config-router)#area 45 nssa R5(config)#interface Loopback0 R5(config-if)#ip ospf 100 area 45 R5(config-if)# R5(config-if)#interface Serial0/0 R5(config-if)#ip ospf 100 area 45 R5(config-if)# R5(config-if)#router ospf 100 R5(config-router)#area 45 nssa default-information-originate |
This one is long, but pretty basic. We configure the ethernet interfaces and we configure R4 and R5′s link in Area 45. Finally we make area 45 a not so stubby area and tell R5 to originate a default route, which is then propagated throughout the OSPF domain.
Task three:
3. Ensure that all loopbacks are accessible from all routers in the OSPF domain. Ensure that the loopbacks are advertised with their configured masks. Change the OSPF timers on the ethernet segment to be twice as fast as the default.
Config:
R1(config)#interface Loopback0 R1(config-if)#ip ospf network point-to-point R1(config-if)#ip ospf 100 area 12 R2(config)#interface Loopback0 R2(config-if)#ip ospf 100 area 0 R2(config-if)#ip ospf network point-to-point R2(config-if)# R2(config)#interface FastEthernet0/0 R2(config-if)#ip ospf hello-interval 5 R2(config-if)#ip ospf dead-interval 20 R3(config)#interface Loopback0 R3(config-if)#ip ospf 100 area 0 R3(config-if)#ip ospf network point-to-point R3(config-if)# R3(config)#interface FastEthernet0/0 R3(config-if)#ip ospf hello-interval 5 R3(config-if)#ip ospf dead-interval 20 R4(config)#interface Loopback0 R4(config-if)#ip ospf 100 area 0 R4(config-if)#ip ospf network point-to-point R4(config-if)# R4(config)#interface FastEthernet0/0 R4(config-if)#ip ospf hello-interval 5 R4(config-if)#ip ospf dead-interval 20 R5(config)#interface Loopback0 R5(config-if)#ip ospf 100 area 45 R5(config-if)#ip ospf network point-to-point |
For this one we configure all the loopbacks and make sure the OSPF network type is point to point, this causes the correct mask to be advertised. Then on R2, R3, and R4 we change the hello and dead timers to be twice as fast as the default. Note: I did not have to manually set the dead timer as it’s four times the hello timer by default.
Task four:
4. Configure loopback IPs 192.168.1.1/24, 192.168.2.1/24, 192.168.3.1/24 and 192.168.4.1/24 on R3. Inject them into OSPF. These routes should be in Type 5 LSAs. .1.0/24 and .2.0/24 should show a cost of 50, the other two routes’ cost should increment as they travel through the network.
Config:
R3(config)#interface Loopback1 R3(config-if)#ip address 192.168.1.1 255.255.255.0 R3(config-if)# R3(config-if)#interface Loopback2 R3(config-if)#ip address 192.168.2.1 255.255.255.0 R3(config-if)# R3(config-if)#interface Loopback3 R3(config-if)#ip address 192.168.3.1 255.255.255.0 R3(config-if)# R3(config-if)#interface Loopback4 R3(config-if)#ip address 192.168.4.1 255.255.255.0 R3(config-if)# R3(config-if)#ip access-list standard E1_Routes R3(config-std-nacl)#permit 192.168.3.0 0.0.0.255 R3(config-std-nacl)#permit 192.168.4.0 0.0.0.255 R3(config-std-nacl)# R3(config-std-nacl)#ip access-list standard E2_Routes R3(config-std-nacl)#permit 192.168.1.0 0.0.0.255 R3(config-std-nacl)#permit 192.168.2.0 0.0.0.255 R3(config-std-nacl)# R3(config-std-nacl)#route-map Redist_Conn permit 10 R3(config-route-map)#match ip address E1_Routes R3(config-route-map)#set metric-type type-1 R3(config-route-map)# R3(config-route-map)#route-map Redist_Conn permit 20 R3(config-route-map)#match ip address E2_Routes R3(config-route-map)#set metric 50 R3(config-route-map)# R3(config-route-map)#router ospf 100 R3(config-router)#redistribute connected subnets route-map Redist_Conn |
This is a fun one and it’s a bit tricky. The task tells us that two of the routes need to be E1 (default, cost doesn’t increment) and the other two need to be E2 (cost does increment). First we configure the loopbacks, we match .3.0/24 and .4.0/24 in the E1 ACL, then we match the other two in the E2 ACL. Next we configure the first line of our route map to match the E1 ACL and set them to E1 routes, then in the second line we match the other routes and set the cost to 50, notice that we don’t need to set the type here because E2 is the default.
This one we’ll verify:
R4#sh ip route ospf O E2 192.168.1.0/24 [110/50] via 10.2.2.3, 00:57:45, FastEthernet0/0 O E2 192.168.2.0/24 [110/50] via 10.2.2.3, 00:57:45, FastEthernet0/0 O E1 192.168.3.0/24 [110/30] via 10.2.2.3, 00:57:45, FastEthernet0/0 O E1 192.168.4.0/24 [110/30] via 10.2.2.3, 00:57:45, FastEthernet0/0 |
We can see that .1 and .2 are E2 with a cost of 50 while the others are E2 with the cost incrementing.
Task five:
5. Configure the OSPF domain to compensate for gigabit link speeds and calculate cost accordingly. Configure strong authentication between R1 and R3 using the password “cisco”.
Config:
R1(config)#router ospf 100 R1(config-router)#auto-cost reference-bandwidth 1000 R1(config-router)# R1(config-router)#interface Serial0/0.103 point-to-point R1(config-subif)#ip ospf authentication message-digest R1(config-subif)#ip ospf message-digest-key 1 md5 cisco R2(config)#router ospf 100 R2(config-router)#auto-cost reference-bandwidth 1000 R3(config)#router ospf 100 R3(config-router)#auto-cost reference-bandwidth 1000 R3(config-router)# R3(config-router)#interface Serial0/0.301 point-to-point R3(config-subif)#ip ospf authentication message-digest R3(config-subif)#ip ospf message-digest-key 1 md5 cisco R4(config)#router ospf 100 R4(config-router)#auto-cost reference-bandwidth 1000 R5(config)#router ospf 100 R5(config-router)#auto-cost reference-bandwidth 1000 |
Again, pretty basic. We change the reference bandwidth for OSPF and configure authentication between R1 and R3.
That’s it for this one. Please post any thought or mistakes you’ve noticed.
Here’s the .net file:
The Dynagen/GNS3 .net file
(you will need to change the paths to make it work)
Related Posts:
| Print article | This entry was posted by Colby on May 13, 2010 at 7:22 am, and is filed under Labs. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |







about 1 year ago
How can there Loopback on R5 exist in area 0?
I think this is wrong and it should be in area 45. Also area 45 is NSSA so we cant configure virtual link to resolve that problem.