BGP anouncing with two peers.
Martin Mares
mj at ucw.cz
Mon Nov 26 21:48:32 CET 2001
Hello!
> I want to setup BIRD to anounce BGP routes for my AS.
> We have two backbone providers so I'll need to make two BGP
> connections. I only need to anounce routes and don't want to
> import them. I also want on the second BGP conection to prepend
> our AS several times, so this route should be less prefered.
>
> I have worked out a draft bird configuratioan, but some things
> are unclear to me.
>
> ## bird.conf ##
> protocol bgp one {
> local as 65333; # our AS (let say it is)
> neighbor peer.one.ip as [theiras]; # peer one and their AS
> multihop 20 via my.next.hop.ip; # not directly connected
> import none;
> export ; # this part is not clear to me
> # I want to export my whole a.b.c.d/19
> # network. What do I put here.
> source address x.y.z.w; # The IP address of my router
> }
First of all, you need to have the route in your routing table to
have it exported. Usually, it's a good idea to define a sink route
for your whole address block, so that packets to non-existent
destinations in your block are not sent back and forth between
your router and your provider's router. Hence:
protocol static {
route 1.2.0.0/19 reject;
}
Then you can tell the bgp's to export just this route:
protocol bgp one {
...
export where net = 1.2.0.0/19;
}
> protocol bgp one {
> local as 65333; # our AS (let say it is)
> neighbor peer.two.ip as [theiras]; # peer two and their AS
> multihop 20 via my.next.hop.ip; # not directly connected
> import none;
> export ; # Same thing as above, but prepend our AS
> # several times, so this route is less
> # prefered
Here you can use the following filter:
export {
if net != 1.2.0.0 then reject;
bgp_path.prepend(1234);
bgp_path.prepend(1234);
bgp_path.prepend(1234);
accept;
};
Have a nice fortnight
--
Martin `MJ' Mares <mj at ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Diplomacy is an art of saying "nice doggy" until you can find a rock.
More information about the Bird-users
mailing list