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

BGP adv. prefix with specific metric

I have the route in OSPF normally with a cost of 1050. If a certain node in the network goes down, the cost increased to 2100. I only want to advertise the network out of BGP if the cost/metric in OSPF is 1050.

I tried setting up a route-map to match a prefix-list and a metric value of 1050 +- 10, but when I do:

show ip bgp route-map <name>

it still shows the prefixes with a metrix of 2100. Will this route-map work and I'm just testing it wrong?

Ideal solution would be to stop the redistribution from OSPF to BGP when the metric is two high.

Alternate solution would be to allow redistribution and carry over the OSPF cost into the BGP metric. Then don't advertise the network if the BGP metric is to high. Advertise at 1050, don't advertise at 2100.

Thanks for the help.

---John Holmes...


Re: BGP adv. prefix with specific metric

Hi John!

In BGP config do you have something like :

neighbor route-map your_route_map_metric_match out


If yes, did you clear the BGP peering (soft or hard)?

If you do not have done this yet, please try and let me know how it is working.

Good luck!



New Member

Re: BGP adv. prefix with specific metric

No, I haven't added it to the outboudn route-map yet. Was hoping to show that it matches correctly before I added it.

New Member

Re: BGP adv. prefix with specific metric

I tried to add the route-map, but was told I couldn't match metric on an outbound route-map.

I tried adding it to the OSPF to BGP redistribution route-map, but not sure if it's working or not. Waiting for the node to go down.

The issue I have with doing it further up the chain is caused by aggregation. I aggregate the smaller subnets into a /24, but then the metric goes away on the /24.

CreatePlease to create content