[j-nsp] Set MED in BGP to IGP metric for iBGP NEXT-HOP router

Paul Zugnoni paul.zugnoni at onlive.com
Tue Feb 21 19:25:28 EST 2012


Hey all.

I'm looking to set the MED on routes exported to eBGP peers to reflect the IGP metric to the BGP protocol next-hop of the iBGP router from which the route was learned. If you're familiar with the "then metric igp" configuration, you know that it takes the IGP metric of the route. This works for an OSPF-learned route, for example, but what I'm seeking is to add an MED to a BGP-learned route, and use the metric to the iBGP router, which is representative of the "distance" to the route. If there was a command for this it would look like so:

[ policy-statement EBGP-EXPORT ]
term advertise-routes-from-ibgp-neighbors {
   from {
      protocol bgp;
   }
   then {
      metric {
         igp-metric-to-the-bgp-next-hop-router;    <---- Want this command
      }
   }
}

The use case and result is this:

     WEST         EAST

     +--+         +--+
     |R1|---------|R3|\
     +--+         +--+ \
      |  AS65000    |   \
     +--+         +--+   \
     |R2|---------|R4|\  +-+
     +--+         +--+ \ |R| AS65002
       /                 +-+
     +-+
     |R| AS65001
     +-+

In my AS (65000), I learn a route on my R2 from AS65001 on the West coast. R2 advertises this to iBGP neighbors R1, R3, and R4 with next-hop-self. Each iBGP router gets an identical copy of the route in AS65001, with the next-hop set to the loopback IP of R2. Now, before I have R3 and R4 advertise that route out to AS65002 on the East coast, I want them to set the MED to the IGP metric R3 and R4 have to R2. So let's say all my internal links have an IGP metric of 10: I'd expect R3 to advertise the route with an MED of 20 and R4 with an MED of 10.

Is this possible in JunOS?

I happen to be running MPLS/RSVP among all the ibgp routers which offers traffic engineering itself, but considering that R3 and R4 are still PE routers, I think the solution to influence AS65002 to use R4 for the AS65001 route is one better addressed by BGP policy.

Thanks in advance!
Paul Zugnoni




More information about the juniper-nsp mailing list