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@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."