4 mins read

BGP – as-override

1. Intro

Compare the AS path of an route with the AS number of the BGP peer in the group, and replace all occurrences of the peer AS number in the AS path with its own AS number before re-advertising the route to the peer.

This is essentially an alternate solution to the advertise-peer-as and loops combo that we’ve seen in the previous post. So, we will use the same setup.

We can see that as-override is more straightforward, and only R7 needs to be configured. Instead of configuring 2 routers: R7 with advertise peer as, and R6 with loops. Now it is enough to add as-override to R7.

2. New setup

Let’s put more routers and more ASs in our test topology. In fact, this is the same setup from the previous post:

This time, we want to advertise the prefixes originated by R4 and R5 to R1.

By default, R2 will advertised the prefixes to R1, but R1 will discard the prefixes because of the as-path loop (you can check the previous post if not clear why).

Let’s configure as-override knob and see the impact:

### Configuring as-override: 

root@R2# set protocols bgp group AS65535 as-override 

[edit]
root@R2# show | compare 
[edit protocols bgp group AS65535]
+    as-override;

[edit]
root@R2# commit 
commit complete

[edit]
root@R2# run show route advertising-protocol bgp 17.8.0.1 

inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 192.168.40.0/26         Self                                    65002 65001 I
* 192.168.50.0/26         Self                                    65002 65001 64003 I

### On R1, the prefixes are no longer hidden: 

root@R1# run show route receive-protocol bgp 17.8.0.2 hidden extensive 

inet.0: 26 destinations, 26 routes (26 active, 0 holddown, 0 hidden)

### Remove 'hidden' from the command: 

root@R1# run show route receive-protocol bgp 17.8.0.2 extensive          

inet.0: 26 destinations, 26 routes (26 active, 0 holddown, 0 hidden)
* 192.168.40.0/26 (1 entry, 1 announced)
     Accepted
     Nexthop: 17.8.0.2
     AS path: 65001 65002 65001 I 

* 192.168.50.0/26 (1 entry, 1 announced)
     Accepted
     Nexthop: 17.8.0.2
     AS path: 65001 65002 65001 64003 I 

3. Closing remarks

  • As already mentioned in the previous post, this is a useful feature in common setups like MPLS L2VPNs.
  • Configuring as-override is more straightforward, and doesn’t require two routers to be configured.

Note: enabling the AS as-override feature may result in routing loops. Use this feature only for specific applications that require this type of behavior, and in situations with strict network control.


External Resources: