Lab Objective:
The focus of this lab is to understand OSPF implementation and configuration in Cisco IOS routers. Additional technologies tested include summarization and path control.
Lab Topology:
The lab network topology is illustrated below:
|
IMPORTANT NOTE If you are using the www.howtonetwork.net racks, please bring up the LAN interfaces connected to the routers by issuing the no shutdown command on the connected switches. If you are using a home lab with no interface fastethernet 0/0 Alternately, you can simply connect the interfaces to a hub or switch if you have one available in your own lab. |
Task 1
Configure hostnames and IP addressing on all routers as illustrated in the network topology.
Task 2
Using either inter-based or legacy ‘network‘ statement configuration, configure the OSPF backbone on the LAN segment between R1 and R4.
Task 3
Using either inter-based or legacy ‘network‘ statement configuration, configure OSPF area 1 between R1, R2 and R3. Do NOT advertise the 150.3.3.0/24 subnet on R3 via OSPF.
Task 4
Using either inter-based or legacy ‘network‘ statement configuration, configure OSPF area 2 between R1, R3 and R4. Do NOT advertise the 150.3.3.0/24 subnet on R3 via OSPF.
Task 5
Configure the following secondary subnets on the LAN interface of R3:
- 172.16.12.0/24
- 172.16.13.0/24
- 172.16.14.0/24
- 172.16.15.0/24
Next, inject the 150.3.3.0/24 subnet as a Type 2 External LSA. The 172.16.x.x/24 subnets should be injected into OSPF as Type 1 External LSAs. You can use only ONE prefix list or ACL in your solution. Verify your configuration using the appropriate commands.
Task 6
Advertise a single route for the 172.16.x.x/24 subnets connected to the LAN interface on R3. This single route should be assigned a route tag of 3333. This summary address should NOT be present in OSPF area 0; however, it should be in OSPF areas 1 and 2. Verify your configuration.
Task 7
Configure OSPF so that R3 prefers the path via R2 to reach the OSPF backbone, i.e. 10.0.1.0/24. R1 should also be configured to prefer the path via R2 to reach the 150.3.3.0/24 subnet. This should be completed without modifying interface bandwidths. Verify this configuration using the appropriate commands.
Lab Validation
Task 1
| Router(config)#hostname R1 R1(config)#interface fastethernet 0/0 R1(config-if)#no shutdown R1(config-if)#ip address 10.0.1.1 255.255.255.0 R1(config-if)#exit R1(config)#interface serial 0/0 R1(config-if)#no shutdown R1(config-if)#ip address 10.0.0.1 255.255.255.252 R1(config-if)#clock rate 2000000 R1(config-if)#exit R1(config)#interface serial 0/1 R1(config-if)#no shutdown R1(config-if)#ip address 10.0.0.5 255.255.255.252 R1(config-if)#exit |
| Router(config)#hostname R2 R2(config)#interface fastethernet 0/0 R2(config-if)#no shutdown R2(config-if)#ip address 150.2.2.2 255.255.255.0 R2(config-if)#exit R2(config)#interface serial 0/0 R2(config-if)#no shutdown R2(config-if)#ip address 10.0.0.2 255.255.255.252 R2(config-if)#exit R2(config)#interface serial 0/0 R2(config-if)#no shutdown R2(config-if)#ip address 10.0.0.9 255.255.255.252 R2(config-if)#exit |
| Router(config)#hostname R3 R3(config)#interface fastethernet 0/0 R3(config-if)#no shutdown R3(config-if)#ip address 150.3.3.3 255.255.255.0 R3(config-if)#exit R3(config)#interface serial 1/0 R3(config-if)#no shutdown R3(config-if)#ip address 10.0.0.6 255.255.255.252 R3(config-if)#clock rate 128000 R3(config-if)#exit R3(config)#interface serial 1/1 R3(config-if)#no shutdown R3(config-if)#ip address 10.0.0.10 255.255.255.252 R3(config-if)#clock rate 128000 R3(config-if)#exit R3(config)#interface serial 1/2 R3(config-if)#no shutdown R3(config-if)#ip address 10.0.0.13 255.255.255.252 R3(config-if)#clock rate 128000 R2(config-if)#exit |
| Router(config)#hostname R4 R4(config)#interface fastethernet 0/0 R4(config-if)#no shutdown R4(config-if)#ip address 10.0.1.4 255.255.255.0 R4(config-if)#exit R4(config)#interface serial 0/0 R4(config-if)#no shutdown R4(config-if)#ip address 10.0.0.14 255.255.255.252 R4(config-if)#exit |
Task 2
| R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 10.0.1.1 0.0.0.0 area 0 R1(config-router)#exit |
| R4(config)#router ospf 4 R4(config-router)#router-id 4.4.4.4 R4(config-router)#network 10.0.1.4 0.0.0.0 area 0 R4(config-router)#exit |
Verify your configuration using the show ip ospf neighbor command:
| R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
Task 3
| R1(config)#interface serial 0/0 R1(config-if)#ip ospf 1 area 0 R1(config-if)#exit |
| R2(config)#router ospf 2 R2(config-router)#router-id 2.2.2.2 R2(config-router)#exit R2(config)#interface fastethernet 0/0 R2(config-if)#ip ospf 2 area 1 R2(config-if)#exit R2(config)#interface serial 0/0 R2(config-if)#ip ospf 2 area 1 R2(config-if)#exit R2(config)#interface serial 0/1 R2(config-if)#ip ospf 2 area 1 R2(config-if)#exit |
| R3(config-if)#router ospf 3 R3(config-router)#router-id 3.3.3.3 R3(config-router)#network 10.0.0.10 0.0.0.0 area 1 R3(config-router)#exit |
Verify your configuration using the show ip ospf neighbor command:
| R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
| R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
| R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
Task 4
| R1(config)#interface serial 0/1 R1(config-if)#ip ospf 1 area 2 R1(config-if)#exit |
| R3(config)#interface serial 1/0 R3(config-if)#ip ospf 3 area 2 R3(config-if)#exit R3(config)#interface serial 1/2 R3(config-if)#ip ospf 3 area 2 R3(config-if)#exit |
| R4(config)#router ospf 4 R4(config-router)#network 10.0.0.14 0.0.0.0 area 2 R4(config-router)#exit |
Verify your configuration using the show ip ospf neighbor command:
| R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
| R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
| R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
| R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
Task 5
This task has two requirements. The first requirement is simple and entails configuring the LAN interface with the specified secondary subnets. This is completed as follows:
| R3(config)#interface fastethernet 0/0 R3(config-if)#ip address 172.16.12.3 255.255.255.0 secondary R3(config-if)#ip address 172.16.13.3 255.255.255.0 secondary R3(config-if)#ip address 172.16.14.3 255.255.255.0 secondary R3(config-if)#ip address 172.16.15.3 255.255.255.0 secondary R3(config-if)#exit |
The second part of this task requires redistribution into OSPF using a route map. This route map can match against an ACL or IP prefix list. This task is completed as follows:
| R3(config)#ip prefix-list PRIMARY seq 5 permit 150.3.3.0/24 R3(config)#route-map CONNECTED permit 10 R3(config-route-map)#match ip address prefix-list PRIMARY R3(config-route-map)#exit R3(config)#route-map CONNECTED permit 20 R3(config-route-map)#set metric-type type-1 R3(config-route-map)#exit R3(config)#router ospf 3 R3(config-router)#redistribute connected subnets route-map CONNECTED R3(config-router)#exit |
Verify your configuration by looking at the Link State Database or simply by looking at the IP routing tables of any other routers in the domain:
| R4#show ip route ospf | include E1|E2 O E1 172.16.12.0 [110/84] via 10.0.0.13, 00:01:56, Serial0/0 O E1 172.16.13.0 [110/84] via 10.0.0.13, 00:01:56, Serial0/0 O E1 172.16.14.0 [110/84] via 10.0.0.13, 00:01:56, Serial0/0 O E1 172.16.15.0 [110/84] via 10.0.0.13, 00:01:56, Serial0/0 O E2 150.3.3.0 [110/20] via 10.0.0.13, 00:01:56, Serial0/0 |
Task 6
The first part of this task requires summarization. Because the 172.16.x.x/24 subnets have been redistributed into OSPF, the summary-addresscommand must be used on the ASBR to generate the summary route for these subnets. The first part of the task is completed as follows:
| R3(config)#router ospf 3 R3(config-router)#summary-address 172.16.12.0 255.255.252.0 tag 3333 R3(config-router)#exit |
Verify your configuration using the show ip ospf database command:
| R3#show ip ospf database external self-originate
OSPF Router with ID (3.3.3.3) (Process ID 3) Type-5 AS External Link States [Truncated Output]LS age: 66 |
To complete the second part of this task, you need to configure distribute lists so that the prefix will not be present in area 0. This task is completed as follows:
| R1(config)#route-map TAG-3333 deny 10 R1(config-route-map)#match tag 3333 R1(config-route-map)#exit R1(config)#route-map TAG-3333 permit 20 R1(config-route-map)#exit R1(config)#router ospf 1 R1(config-router)#distribute-list route-map TAG-3333 in R1(config-router)#exit |
| R4(config)#route-map TAG-3333 deny 10 R4(config-route-map)#match tag 3333 R4(config-route-map)#exit R4(config)#route-map TAG-3333 permit 20 R4(config-route-map)#exit R4(config)#router ospf 4 R4(config-router)#distribute-list route-map TAG-3333 in R4(config-router)#exit |
Verify your configuration by looking at the routing tables on R1, R2 and R4. Only R2 should have a route for the 172.16.12.0/22 prefix:
| R4#show ip route ospf 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O IA 10.0.0.8/30 [110/129] via 10.0.1.1, 00:00:52, FastEthernet0/0 O IA 10.0.0.0/30 [110/65] via 10.0.1.1, 00:00:52, FastEthernet0/0 O 10.0.0.4/30 [110/845] via 10.0.0.13, 00:00:52, Serial0/0 150.2.0.0/24 is subnetted, 1 subnets O IA 150.2.2.0 [110/66] via 10.0.1.1, 00:00:52, FastEthernet0/0 150.3.0.0/24 is subnetted, 1 subnets O E2 150.3.3.0 [110/20] via 10.0.0.13, 00:00:52, Serial0/0 |
| R2#show ip route ospf 172.16.0.0/22 is subnetted, 1 subnets O E1 172.16.12.0 [110/84] via 10.0.0.10, 00:12:01, Serial0/1 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O IA 10.0.0.12/30 [110/909] via 10.0.0.1, 00:20:02, Serial0/0 O IA 10.0.1.0/24 [110/65] via 10.0.0.1, 00:20:02, Serial0/0 O IA 10.0.0.4/30 [110/128] via 10.0.0.1, 00:20:02, Serial0/0 150.3.0.0/24 is subnetted, 1 subnets O E2 150.3.3.0 [110/20] via 10.0.0.10, 00:19:52, Serial0/1 |
| R4#show ip route ospf 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O IA 10.0.0.8/30 [110/129] via 10.0.1.1, 00:00:52, FastEthernet0/0 O IA 10.0.0.0/30 [110/65] via 10.0.1.1, 00:00:52, FastEthernet0/0 O 10.0.0.4/30 [110/845] via 10.0.0.13, 00:00:52, Serial0/0 150.2.0.0/24 is subnetted, 1 subnets O IA 150.2.2.0 [110/66] via 10.0.1.1, 00:00:52, FastEthernet0/0 150.3.0.0/24 is subnetted, 1 subnets O E2 150.3.3.0 [110/20] via 10.0.0.13, 00:00:52, Serial0/0 |
NOTE: As described in the ROUTE guide, filtering using distribute lists prevents the prefix from being accepted by the router and installed into the RIB; however, the Link State Advertisement (LSA) for the prefix will still be present in the Link State Database (LSDB). Consider, for example, the LSDB on R1, which still shows the LSA for the 172.16.12.0/22 prefix even though the prefix itself is filtered via the distribute list:
| R1#show ip ospf database external
OSPF Router with ID (1.1.1.1) (Process ID 1) Type-5 AS External Link States Routing Bit Set on this LSA Routing Bit Set on this LSA |
Task 7
This task is completed by modifying the default interface OSPF costs using the ip ospf cost interface configuration command. You can complete this task by increasing the cost of the R3-R1 and R3-R4 links OR lowering the cost of the R1-R2 and R2-R3 links. Either option will be ok:
| R1(config)#interface serial 0/0 R1(config-if)#ip ospf cost 1 R1(config-if)#exit |
| R2(config)#interface serial 0/0 R2(config-if)#ip ospf cost 1 R2(config-if)#exit R2(config)#interface serial 0/1 R2(config-if)#ip ospf cost 1 R2(config-if)#exit |
| R3(config)#interface serial 1/1 R3(config-if)#ip ospf cost 1 R3(config-if)#exit |
Verify your configuration by looking at the routing tables of R1 and R3:
| R1#show ip route ospf 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O 10.0.0.8/30 [110/2] via 10.0.0.2, 00:00:35, Serial0/0 O 10.0.0.12/30 [110/845] via 10.0.0.6, 00:15:05, Serial0/1 150.2.0.0/24 is subnetted, 1 subnets O 150.2.2.0 [110/2] via 10.0.0.2, 00:00:35, Serial0/0 150.3.0.0/24 is subnetted, 1 subnets O E2 150.3.3.0 [110/20] via 10.0.0.2, 00:00:35, Serial0/0 |
| R3#show ip route ospf 172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks O 172.16.12.0/22 is a summary, 00:23:36, Null0 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O 10.0.0.0/30 [110/2] via 10.0.0.9, 00:00:42, Serial1/1 O IA 10.0.1.0/24 [110/3] via 10.0.0.9, 00:00:42, Serial1/1 150.2.0.0/24 is subnetted, 1 subnets O 150.2.2.0 [110/2] via 10.0.0.9, 00:00:42, Serial1/1 |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1081 bytes R1# |
R2
|
R2#term len 0 Current configuration : 948 bytes R2# |
R3
|
R3#term len 0 Current configuration : 1774 bytes R3# |
R4
|
R4#term len 0 Current configuration : 1032 bytes R4# |
