Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

OSPF Redistribution specifying different metrics to routes.

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.



VIP Purple

Re: OSPF Redistribution specifying different metrics to routes.

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 serial0

ip route serial0

ip route serial0

Now create an access list for every static route:

access-list 1 permit

access-list 2 permit

access-list 3 permit

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 :)



CreatePlease to create content