Setting MED (?) for a specific BGP route

Michal Ludvig mludvig at logix.net.nz
Mon Apr 2 05:26:51 CEST 2012


Hi guys

I've got a network with two BGP routers (60.234.a.b and 121.98.a.b) with 
a single upstream ISP for both. I also have an OSPF setup between the 
routers. Both runing Bird 1.3.4.

Each router has a "local" directly attached DMZ subnet (60.234.x.224/28 
and 121.98.x.208/28) and exports that to BGP. It also receives the other 
router's DMZ address through OSPF and re-exports that to BGP as well.

I'm not very familiar with BGP but it seems to work pretty well. From 
outside the traffic to DMZ 60 goes straight to router 60 and the traffic 
to DMZ 121 goes straight to router 121.

Now I moved part of the 60 subnet (one /32 for now) to the 121 DMZ and 
here's what the routers export:

router 60 birdc> show route export bgp_orcon
60.234.x.224/28   dev eth1 [direct1 Mar13] * (240)
60.234.x.236/32   via 172.31.253.2 on tunO2Oorc4 [ospf_eit Mar16] * E2 
(150/10/10000) [121.98.a.b]
121.98.x.208/28   via 172.31.253.2 on tunO2Oorc4 [ospf_eit Mar13] * E2 
(150/10/10000) [121.98.a.b]

router 121 birdc> show route export bgp_orcon
60.234.x.224/28   via 172.31.253.1 on tunO2Oorc4 [ospf_eit Mar13] * E2 
(150/10/10000) [60.234.a.b]
60.234.x.236/32   via 121.98.x.221 on vlan121 [kernel1 Mar20] * (10)
121.98.x.208/28   dev vlan121 [direct1 Mar13] * (240)

The ISP is happy to accept /32's from us but for some reason traceroute 
to 60.234.x.236/32 still goes to the router 60 instead of router 121. 
The ISP suggested to alter MED or prepend our ASN once again to the /32 
announcements on the router 60 to give precedence to the router 121.

I tried prepending the ASN on router 60 with:
     export filter {
             if source = RTS_OSPF then {
                 bgp_path.prepend(64526);
             }
             [...]
     }
But that didn't make any difference.

Now I've got these questions:
1. How do I alter MED for a specific route on one of the routers?
2. How can I get more details about the exported routes? Like the MED, 
BGP path, etc? Just to make sure my filters do what I want them to do.

Thanks for any pointers!

Michal







More information about the Bird-users mailing list