Remove BGP Prepend

I need to send full routes to a peer and I currently have some of my full routes prepended. If I setup an out filter and set-bgp-prepend=0 will it remove all of the prepends that I put in with my inbound filters? If not, what is the correct way to un-prepend routes before sending them out?

Thanks,

Keefe

No, set-bgp-prepend=0 will not remove prepends. Why are you prepending AS path for incoming prefixes? You should prepend AS path only for prefixes advertised to eBGP.

I have to prepend the routes i receive from one of my upstream carriers otherwise all my outbound traffic flows over this ISP. When I prepend one of the upstream carriers I get a more even balance. Prepending is for both incoming and outgoing routes.

You should use local-pref instead of prepending for incoming routes. This way, you avoid an iBGP loop.

Is there a way to assign local pref based on BGP AS Path?

How would prepending incoming routes cause an iBGP loop?

Thanks,

Keefe

Something like this

/routing filter add chain=peer1-in as-path="^1234_" set-bgp-local-pref=90

The iBGP loop is not a loop per se, but it triggers BGP’s loop detection. Example:
Your ASN is 65530, you receive transit via AS111. An example as path could look like this:
123,444,111.
Now you have two routers, Router A and Router B with an iBGP peering between them. Router A prepends your own AS before sending the routes to Router B. Router B receives an AS path that looks like 123,444,111,65530. This causes Router B to see it’s own AS and believe it’s a loop. It will therefore drop the route. BGP’s loop detection works by checking if your own AS number is present in the update you receive from your neighbour. If you really must prepend, then prepend your upstreams AS.

@mrz - is there a way of removing set-bgp-prepend ?

The other day I need to move inbound traffic away from some specific peers to get their traffic from different peering sessions we have with them so I set-bgp-prepend=2

I now want to go back to how we were wanted to remove set-bgp-prepend but could not find a way to do it (unset line set-bgp-prepend is not an option) so I set it to 0.

It worked for most of the peers but with one peer the session is flapping, this is the message error in my logs
nov/27 10:28:19 route,bgp,error Received notification
nov/27 10:28:19 route,bgp,error UPDATE error: bad attribute length
nov/27 10:28:23 route,bgp,info Connection opened by remote host
nov/27 10:28:23 route,bgp,info RemoteAddress=a.b.c.d

my guess is that their router does not like a 0 set-bgp-prepend attribute.

Is there any way to set this back to default (unset)? Thanks

There is no such thing as BGP_PREPEND attribute. What set-bgp-prepend does is prepends your own AS number x times. If value is set to 0 then peer’s own AS is removed from AS_PATH. So this parameter should not be set to 0 if network is originated by the router, since update received from eBGP peer requires AS_PATH with at least one ASN.