announcing BGP prefixes from the same AS at different sites?

Thomas Johnson tommyj27 at gmail.com
Fri Aug 29 23:52:05 CEST 2014


I am trying to sort out a chicken-and-egg problem is probably more of a
network design question than bird-specific.

I am using bird to announce prefixes from two geographically-separate
locations (A and B). I am announcing different prefixes at each, but with
the same AS. The problem I am having is how to get these locations to add
each other's routes.

At location A, I have a pair of bird routers (X and Y), each connected to a
different provider. Both routers announce the prefixes for this site over
eBGP. These routers have an iBGP session between them.

At location B, there is a single router (Z), connected to one ISP. It
announces its own prefixes upstream.

Since both sites announce with the same AS, they don't import the other's
prefixes. An iBGP full-mesh seems to be the _correct_ solution, but I am
having trouble getting this implemented correctly.

If I configure the inter-site iBGP sessions to connect between the
addresses on the WAN interfaces, I get partial success. At site A, router X
correctly adds routes for site B. Router Y establishes a connection to
router Z (site B), but adds the B prefixes as unreachable. The difference
is that the Y->Z BGP connection (A->B direction) is routed via router X
(shorter AS path via X ISP). My configuration files for this setup are
below.

If I attempt to establish the inter-site iBGP between the loopbacks on the
routers, I have no success, since the loopback addresses fall with the
subnets I announce at each site.

Is there some bit of configuration I am missing? Am I going about this the
wrong way? Any thoughts are appreciated.

#
# router Y
# site A
#

protocol bgp bgp_he {
    local as 12345;
    neighbor 1.1.2.69 as 6939;

    # Export exactly what prefixes we want advertised. No surprises.
    export filter {
        if proto = "static_bgp" then accept;
        if proto = "portable_bgp" then accept;
        reject;
    };
    # Import filtered routes from upstream.
    import filter bgp_in_he;
}

protocol bgp ibgp_border {
    local 6.9.5.212 as 12345;
    neighbor 6.9.5.213 as 12345;
    multihop 2;
    import filter { accept; };
    export filter {
        if source != RTS_BGP then { reject; }
        if proto = "ibgp_border" then { reject; }
        accept;
    };
}

protocol bgp ibgp_1b {
    local 1.1.2.70 as 12345;
    neighbor 7.4.2.132 as 12345;
    multihop 10;
    import filter { accept; };
    export filter {
        if proto = "static_bgp" then accept;
        if proto = "portable_bgp" then accept;
        reject;
    };
}


protocol ospf {
    # *snip*
}

#
# router X
# site A
#

protocol bgp bgp_cogent {
    local as 12345;
    neighbor 3.8.1.105 as 174;

    # Export exactly what prefixes we want advertised. No surprises.
    export filter {
        if proto = "static_bgp" then accept;
        if proto = "portable_bgp" && net.len <= 24 then accept;
        reject;
    };
    # Import filtered routes from upstream.
    import filter bgp_in_cogent;
}

protocol bgp ibgp_border {
    local 6.9.5.213 as 12345;
    neighbor 6.9.5.212 as 12345;
    multihop 2;

    # Send all routes learnt via BGP
    import filter { accept; };
    export filter {
        if source != RTS_BGP then { reject; }
        if proto = "ibgp_border" then { reject; }
        accept;
    };
}

protocol bgp ibgp_1b {
    local 3.8.1.106 as 12345;
    neighbor 7.4.2.132 as 12345;
    multihop 10;
    import filter { accept; };
    export filter {
        if proto = "static_bgp" then accept;
        if proto = "portable_bgp" && net.len <= 24 then accept;
        reject;
    };
}

protocol ospf {
    # *snip*
}

#
# router Z
# site B
#

template bgp ibgp_A {
    debug all;
    local 7.4.2.132 as 12345;
    multihop 10;
    import filter { accept; };
    export filter {
        if proto = "static_bgp" then accept;
        if proto = "standby_bgp" then accept;
        if proto = "portable_bgp" then accept;
        reject;
    };
}

protocol bgp ibgp_Y from ibgp_A { neighbor 1.1.2.70 as 12345; };
protocol bgp ibgp_X from ibgp_A { neighbor 3.8.1.106 as 12345; };

template bgp B {
    # Set our local AS.
    local as 12345;

    # Export exactly what prefixes we want advertised. No surprises.
    export filter {
        if proto = "static_bgp" then accept;
        if proto = "standby_bgp" then accept;
        if proto = "portable_bgp" && net.len <= 24 then accept;
        reject;
    };
    # Import filtered routes from upstream.
    import filter bgp_in_B;
}

protocol bgp bgp_B from B { neighbor 7.4.2.130 as 1212; };
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20140829/5976a69c/attachment.html>


More information about the Bird-users mailing list