BGP not advertising to all routers


#1

Hi,

I’ve been trying to set up 2 different BGP sessions to the routers of our hosting provider to announce a /24 ( 2 sessions for redundancy )

But it seems like only the router that my vyos is using the default route from gets it advertised as when I check on their side ( I work for the same company ) I can see that on the first router it’s being advertised as best route and shows the IP of my router.

But when I check on the second one it shows the route as being ebgp and sends it throughout the network until it comes back on router 1 whereas it should show the same as on the first one, my router IP.

The strange part is that when I shutdown the session with router 1, router 2 almost immediately shows it having the best path.

Let me show some examples: ( IP’s have been changed of course )

protocols {
    bgp 1111 {
        maximum-paths {
            ebgp 2

neighbor 2.2.2.2. {
            nexthop-self
            remote-as 2222
            route-map {
                export rtr1-ipv4-out
                import rtr1-in
            }
            soft-reconfiguration {
                inbound
            }
            update-source 2.2.2.1

neighbor 2.2.2.3 {
            nexthop-self
            remote-as 2222
            route-map {
                export rtr2-ipv4-out
                import rtr2-in
            }
            soft-reconfiguration {
                inbound
            }
            update-source 2.2.2.1

parameters {
            graceful-restart {
            }
            log-neighbor-changes
            router-id 2.2.2.1
        }
        redistribute {
            static {

network 6.6.6.6/24 {

    static {
        route 6.6.6.6/24 {
            blackhole {
                distance 254
            }

I’ve created for both routers a route-map and a prefix list.

   prefix-list announce {
        description "Announced networks"
        rule 5 {
            action permit
            le 32
            prefix 6.6.6.6/24
        }
    }

    route-map rtr1-ipv4-out {
        rule 10 {
            action permit
            match {
                ip {
                    address {
                        prefix-list announce
                    }
                }
            }
            set {
                metric +5
            }

   route-map rtr1-in {
        rule 5 {
            action permit
            set {
                metric +5

The ones for rtr2 are the same only they have rtr2 in the name.

Now on the other side I see this: ( keep in mind I changed the AS and IP again, on the routers I did not use this of course )

On router 1:

sh ip bgp neighbors 2.2.2.1 received-routes 
       There are 1 received routes from neighbor 2.2.2.1
Searching for matching routes, use ^C to quit...
Status A:AGGREGATE B:BEST b:NOT-INSTALLED-BEST C:CONFED_EBGP D:DAMPED
       E:EBGP H:HISTORY I:IBGP L:LOCAL M:MULTIPATH m:NOT-INSTALLED-MULTIPATH
       S:SUPPRESSED F:FILTERED s:STALE
       Prefix             Next Hop        MED        LocPrf     Weight Status
1      6.6.6.6/24    2.2.2.1   6          100        0      BE    

While on router 2 I see this:

sh ip bgp neighbors 2.2.2.1 received-routes 
       There are 1 received routes from neighbor 2.2.2.1
Searching for matching routes, use ^C to quit...
Status A:AGGREGATE B:BEST b:NOT-INSTALLED-BEST C:CONFED_EBGP D:DAMPED
       E:EBGP H:HISTORY I:IBGP L:LOCAL M:MULTIPATH m:NOT-INSTALLED-MULTIPATH
       S:SUPPRESSED F:FILTERED s:STALE
       Prefix             Next Hop        MED        LocPrf     Weight Status
1      6.6.6.6/24    2.2.2.1   6          100        0      E 

How can I get it so that both of them show BE?

Last thing I noted was this:

# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

B>* 0.0.0.0/0 [20/10] via 2.2.2.2, eth0, 00:25:51
  *                           via 2.2.2.3, eth0, 00:25:51

As I get from both the bgp sessions a default route.
Where the 2.2.2.2 is the current active default gateway and the one currently having the BE route.

I know it’s a long story and I hope I somewhat showed what I’m having as a problem.

And OSPF is not an option here, before I get that as an answer :slight_smile:


#2

From 2.2.2.1, show the advertised-routes to both 2.2.2.2 and 2.2.2.3

All three of those routers are on the same directly connected /24 block?

From 2.2.2.2, show the received routes from 2.2.2.3
From 2.2.2.3, show the received routes from 2.2.2.2

I think that 2.2.2.2 and 2.2.2.3 (since they are in the same AS2222, and presumably doing IBGP between them) are somehow agreeing to only use one route out to your AS1111.


#3

agreed. by design iBGP will not advertise any routes it learns from its peers. if 2.2.2.1 advertises to 2.2.2.2 and 2.2.2.3, it’s a race condition to see whether 2.2.2.2 or 2.2.2.3 advertises the route first. That one will win, and the other will never advertise or inject the route to 2.2.2.1

iBGP will not advertise any routes it learns from its peers

you could use a route-map to alter weight to prefer directly connected eBGP route over the same iBGP route learned from an iBGP peer
weight is a local setting and won’t be propagated through bgp