cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
302
Views
0
Helpful
1
Replies

OSPF Redistribution specifying different metrics to routes.

bhaskarkss
Level 1
Level 1

Dear Sir,

I have around 10 routers connected with point to point partial mesh running with OSPF. My requirement is to redistribute the static routes into ospf with each route having different metric. By default if I use the command "ROUTER-A(config-router)# redistribute static metric-type 1 metric 10 subnet

Example. I have 10 static routes at "Router-A" need to be redistributed into OSPF type E1 routes but the condition is among these 10 routes one or multiple routes to get different metric cost after redistribution. i.e. route-1 with metric 10, route-2 with metric 20 route-3 to 10 with metric 40. please suggest me.

Regards,

Zakir

1 Reply 1

Hello Zakir,

here is how you do it:

--> these are example static routes, I just use 3 instead of 10, but the procedure is the same for all:

ip route 192.168.1.0 255.255.255.0 serial0

ip route 192.168.2.0 255.255.255.0 serial0

ip route 192.168.3.0 255.255.255.0 serial0

Now create an access list for every static route:

access-list 1 permit 192.168.1.0

access-list 2 permit 192.168.2.0

access-list 3 permit 192.168.3.0

Now create a route-map entry for each route:

route-map STATIC permit 10

match ip address 1

set metric 10

route-map STATIC permit 20

match ip address 2

set metric 20

route-map STATIC permit 30

match ip address 3

set metric 30

Now redistribute the routes into OSPF:

redistribute static metric-type 1 subnets route-map STATIC

I hope this is what you are looking for :)

Regards,

Georg