.. _example_protocols_bgp_neighbor_remove-private-as: ################# Remove-Private-As ################# Test BGP **remove-private-as** functionality. When a router receives routes from a neighbor using a private AS number (64512-65534 for 16-bit or 4200000000-4294967294 for 32-bit), those private AS numbers appear in the AS-path. The remove-private-as command strips these private AS numbers from the AS-path before advertising routes to an eBGP peer. This is commonly used when a network uses private AS numbers internally (for example, with customers or branch offices) but needs to advertise routes to the internet without exposing those private AS numbers. The command only works on eBGP sessions and only affects outbound advertisements to that neighbor. .. image:: remove-private-as.svg :width: 800 ************************************************************** Test eBGP - Without remove-private-as shows private AS in path ************************************************************** Description =========== Baseline test showing default behavior where private AS numbers are visible in the AS-path. DUT1 uses private AS 65001 and originates route 192.168.100.0/24. DUT0 (AS 100) receives the route and forwards it to DUT2 (AS 200). Without remove-private-as, DUT2 should see the full AS-path including the private AS number. Scenario ======== .. include:: remove-private-as/testebgp-withoutremove-private-asshowsprivateasinpath .. raw:: html
********************************************************* Test eBGP - Remove-private-as strips private AS from path ********************************************************* Description =========== Test BGP remove-private-as which strips private AS numbers from the AS-path before advertising to eBGP peers. DUT1 uses private AS 65001 and originates route 192.168.100.0/24. DUT0 (AS 100) receives the route and has remove-private-as configured toward DUT2. When DUT0 advertises the route to DUT2, the private AS is stripped from the AS-path, so DUT2 sees only the public AS numbers. Scenario ======== .. include:: remove-private-as/testebgp-remove-private-asstripsprivateasfrompath .. raw:: html