Wednesday, July 20, 2011

Manipulating OSPF Routing Table - Part 1

Open Shortest Path First (OSPF) is a link-state routing protocol created in the mid-1980’s by the Internet Engineering Task Force (IETF). It is often valued as more advance protocol compared to Routing Information Protocol (RIP) and more flexible than Cisco’s Enhanced Internal Gateway Routing Protocol (EIGRP) because it is a multi-vendor protocol.

This blog assumes that you have a general understanding of the OSPF routing protocol as well as a proficiency to configure OSPF with the below features.

-OSPF LSA Types; (LSA type descriptions)

-Basic peering

-Inter-Area configuring

-OSPF authentication

-OSPF Virtual Links

-OSPF Stub Area

-OSPF Not-So-Stubby Area (NSSA)

The blog also assumes that you are familiar with configuring and performing basic troubleshooting the following technologies:

-IP Access Lists

-Route-map

The main topic for the blog is to manipulate entries for OSPF routing table, and this topic is not for a novice network engineer.

We often begin configuring the OSPF protocol by adding networks into the routing table. Then, we determine and configure which routers the routing table entries will be shared with. Finally, we may want to filter out particular networks from being advertised to certain neighbors or areas. We can achieve the final step by using a few different methods:

-Not advertise the network into OSPF routing protocol

-Use the filter-list command

-Use the area range command with the “not advertise” parameter

-Use the distribute-list command

-Use the route-maps command

-Use the prefix-suppression command

The first option is very basic and does not work if you are trying to share the network information with only a particular neighbor or an area. So, we will focus on the last five options.

---------------------------------------

use the filter-list command

---------------------------------------

-Filtering LSA Type : TYPE 3 LSA Filtering

-Performed Device Type: OSPF Area Border Router (ABR)

-Usage: This feature is used to filter out routes between different OSPF areas (inter-areas)

-Command:

-area x filter-list prefix name1 [in | out]

-ip prefix-list name1 seq x [deny | permit] A.B.C.D/y

-Caveat: Filtering routes into area 0 prevents the advertised network from propagating into all OSPF areas in the routing domain except the originating area.

-Condition: The basic connectivity as well as OSPF routing protocols have been already configured. Use filter-list command to prevent R4’s loopback address from propagating into R3’s routing table.

-Procedure: Configure R1_ABR to filter R4’s loopback address into OSPF Area 10.

R1_ABR#configure terminal

R1_ABR(config)#ip prefix-list From_R4_Loop seq 10 deny 4.4.4.4/32

R1_ABR(config)#ip prefix-list From_R4_Loop seq 20 permit 0.0.0.0/0 le 32

R1_ABR(config)#router ospf 1

R1_ABR(config-router)#area 10 filter-list prefix From_R4_Loop in

-With the above configuration, R1_ABR will remove 4.4.4.4/32 network from its OSPF Link-State database (LSD) under Area 10 while permitting any addresses that has a subnet mask of 32 or lower. It is important that you add the le 32 parameter at the end of the 3rd line to ensure that it allows all addresses.


---------------------------------------

Use the area range command with the “not advertise” parameter

---------------------------------------

-Filtering LSA Type : TYPE 3 LSA Filtering

-Performed Device Type: OSPF Area Border Router (ABR)

-Usage: This feature is used to filter out routes between different OSPF areas

-Command:

-area x range ip-address mask [advertise | not-advertise] [cost cost]

-Caveat: Ensure that the command is entered from an ABR.

-Condition: The basic connectivity as well as OSPF routing protocols have been already configured. Use area x range command with “not-advertise” parameter to prevent R4’s loopback address from being advertised outside of Area 20.

-Procedure: Configure R2_ABR to not advertise R4’s loopback address outside of Area 20.

R2_ABR#configure terminal

R2_ABR (config)# router ospf 1

R2_ABR (config-router)#area 20 range 4.4.4.4 255.255.255.255 not-advertise

-With the above configuration, R2_ABR will not advertise R4’s loopback address beyond OSPF Area 20.


---------------------------------------

Use the prefix suppression command

---------------------------------------

-Filtering LSA Type : TYPE 3 LSA Filtering

-Performed Device Type: Any OSPF routers

-Usage: This feature is used to filter out routes between different OSPF areas. This command is a new feature to IOS version 12.4(15)T to suppress IP prefixes propagation to Type 3 LSA database table from OSPF-enabled interfaces but excludes prefixes associated with loopbacks, secondary IP addresses, and passive interfaces.

-Command:

-(config-router)#prefix-suppression

-(config-if)#ip ospf prefix-suppression {disable}

-Caveat: The command can be entered from both the global router mode (e.g. router ospf) and the interface mode. The command at the interface level will overwrite the ones from the global router mode.

-Procedure 1: Configure R2_ABR to not advertise the prefixes associated with its OSPF-enabled interfaces

R2_ABR#configure terminal

R2_ABR (config)# router ospf 1

R2_ABR (config-router)#prefix-suppression

-Procedure 2: Configure R4 to not advertise its loopback address of 4.4.4.4/32

R4#configure terminal

R4 (config)# interface loopback 1

R4 (config-if)#ip ospf prefix-suppression

-Loopback addresses can be suppressed by entering the command from the loopback interface.

-Verification: Verify that R4 has suppressed the 4.4.4.4/32 network from its OSPF LSD


-----------------------------

THE BLOG SUMMARY

-----------------------------

The main focus of this blog is to introduce methods to filter out unwanted networks from propagating or being advertised to particular areas. There are two main methods in producing the desired outcomes:

-Removing entries from LSD

-Use the filter-list command

-Use the area range command with “not-advertised” parameter

-Use the prefix suppression command

-Removing entries from Routing Tables

-Use the distribute-list command

-Use the route-maps command: This option improves the flexibility of filtering based on matching other parameters as metric, route-type, and next-hop.

In the Part 2 of the blog, I will introduce the second part of using distribute-list and route-maps.


No comments:

Post a Comment