Setting MED (?) for a specific BGP route

Ondrej Zajicek santiago at crfreenet.org
Sat Apr 7 14:10:00 CEST 2012


On Tue, Apr 03, 2012 at 10:58:20AM +1200, Michal Ludvig wrote:
> On 04/03/2012 10:38 AM, Michal Ludvig wrote:
>> Is there any way to autogenerate MED from IGP? For instance in my case  
>> I've got:
>>         if source = RTS_OSPF then {
>>                 bgp_med = 200;
>>         }
>>
>> That works for now with this hardcoded value. However we're going to  
>> add one more POP with OSPF+BGP and then I want the MED to reflect the  
>> internal distance to the given subnet.
>>
>> Like this:
>> [POP1] --- [POP2] --- [POP3]
>>
>> The prefix local to POP1 should be announced from all POPs to our BGP  
>> upstream with the lowest MED from POP1, higher from POP2 and the  
>> highest MED from POP3. Can I somehow do that automatically?
>
> Just found one way:
>         if source = RTS_OSPF_EXT2 then {
>                 bgp_med = ospf_metric1;
>         }
>
> It seems to work but is it a good idea?

This is a good way (assuming that you are aware that you use metric _1_
for EXT _2_ routes, which is probably not officially documented, but it
contains OSPF metric to the router originating that EXT2 route,
regardless of its ospf_metric2 value).

One possible problem is that local prefix is probably from static
protocol, so you would need a separate case.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20120407/41c67a69/attachment-0001.asc>


More information about the Bird-users mailing list