Route Filtering Mechanism

Categories

Routing

We can filter routes based on various method.We can use below route filtering methods to filter route.
1. ACL
2. IP Prefix-list
3. Distribute List
4. Route-map
5. Filter List

1. ACL :  Link needs to be added

2. Prefix-List

  • Prefix-List is used for route filtering.
  • Prefix list is a list of statements where each statement provides a condition either permit or denies which are processed sequentially or in a top-down manner..
  • Prefix-list uses the same concept of permit/deny where permit means matched and deny means not matched. There is an implicit “deny all” at the end of every prefix list.
    Syntax:
    ip prefix-list list-name [seq seq-value] {deny | permit network/length} [ge ge-value] [le le-value]
    ip prefix-list EVA_FILTER_TEST seq 10 deny 192.168.11.0/24
    ip prefix-list EVA_FILTER_TEST seq 20 deny 192.168.10.0/24 ge 27 le 32
    ip prefix-list EVA_FILTER_TEST seq 30 permit 0.0.0.0/0 le 32
  • If we didn’t have a le or ge parameter then our prefix-list would match the prefix, and the subnet mask exactly means 192.168.11.0/24 is exactly matched in above 1st statement. The second statement says that the first 24 bits of the prefix must match (192.168.10.0), and the subnet mask must be between 27 to 32 bits (or equal to).
    Third statement means all permitted.Means we are not going to advertise 192.168.11.0/24 and anything starting with 192.168.10.X and prefix is in between 27 to 32 rest all is permitted.

3. Distribute List :
We use distribute-list to filter routing update out/in direction in particular IGP. we can call ACL or Prefix-list or route-map to perform routing update filtering using Distribute List.

Before Distribute list we are receiving routes at eva-wr01 and eva-wr02 as below:

Distribute-list with ACL:

Distribute-list with Prefix-list:

4. Route-map: Route-map is a list of statements where the list is processed sequentially or in a top-down manner. Route-maps are similar to a scripting language as it provide if/then/else logic like programming languages.

The common uses of route maps are as follow:
1. Controlling redistribution between routing protocols.
2. Implementing Policy Based Routing (PBR).
3. Controlling routing update means route filtering.

The route maps have below characteristics:
Ø Route-map is a list of statements where the list is processed sequentially or in a top-down manner. Route-maps are similar to a scripting language as it provide if/then/else logic like programming languages.
Ø If the route map is applied in the policy routing environments, the packets which don’t meet a match criteria are forwarded based on a routing table.We use the route maps to deny or permit the information is true by match statements. There is an implicit “deny all” at the end of every route-map.


 

 

  • A single route-map statement can contain multiple match commands as below:

route-map EVA_TEST permit 10
match ip address 1 2  –> OR Logical  means atleast one statement has to match
!
route-map  EVA_TEST permit 20
match 1                                              
match interface fastethernet0/0  —> AND logic means both match statement has to match.

** when we create route-map without sequence number than it will use sequence
number 10 but remember if we are continuously giving the line without sequence number it will override with same sequence number therefore if we want to add second line then we have to explicitly need to define the sequence number.

Diagram for route-map config:

Diagram Needs to be corrected and show output with normal redistribution

we have configured EIGRP and OSPF and now we are redistributing according below requirement:
1. Redistribute all route from eigrp to ospf except 20.0.3.0/24.
2. Redistribute all route from ospf to eigrp except a route which is starting with 192.168.0.0 and subnet mask is in between 27 to 32 bits (or equal to).

1. Create ACL or Prefix list using below command:
access-list 10 permit 20.0.3.0 0.0.0.255
2. Create route-map using below command:
route-map EIGRP_TO_OSPF deny 10
match ip address 10
route-map EIGRP_TO_OSPF permit 20
3. Attach/Apply the route map while redistributing:
router ospf 1
log-adjacency-changes
redistribute eigrp 1 subnets route-map EIGRP_TO_OSPF

Checked output at eva-wr01 and found we are receiving all route except 20.0.3.0/24. Please find the below output

 

Leave a Reply

Your email address will not be published. Required fields are marked *

TOP
error: