Sunday, June 26, 2016

BGP Local AS

The Hide Local Autonomous System feature could be useful when migrating an autonomous system to a different AS number.
In this case, you may reconfigure the local BGP speakers to use the new AS number but advertise the old AS in BGP OPEN messages and BGP updates. This could be enforced on a per-eBGP peer basis using the
command  neighbor local-as [no-prepend]
The  local-as command instructs the local router to advertise the  number in BGP OPEN messages instead of the AS number specified with the router bgp command


Currently R5 is in AS 500 and R1 is in AS123

R1#show run | s bgp
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 15.1.1.5 remote-as 500
 neighbor 15.1.1.5 default-originate route-map DEFAULT-ROUTE
 no auto-summary
ip bgp-community new-format

R5#show run | s bgp
router bgp 500
 no synchronization
 bgp log-neighbor-changes
 network 5.5.5.0 mask 255.255.255.0
 neighbor 15.1.1.1 remote-as 123
 no auto-summary
ip bgp-community new-format



Now we will change the BGP AS in R5 from 500 to 1500, but will advertise AS 500 for peering, no changes on R1 side.

R5#
router bgp 1500
 no synchronization
 bgp log-neighbor-changes
 network 5.5.5.0 mask 255.255.255.0
 neighbor 15.1.1.1 remote-as 123
 neighbor 15.1.1.1 local-as 500

 neighbor 15.1.1.1 send-community
 neighbor 15.1.1.1 route-map TEST-COMMINUTY out
 no auto-summary
ip bgp-community new-format

Output from wireshark shows that the AS sent by R5 is 500



Routes learned have local as prepended, no-prepend feature applies only to inbound learned routes

R5(config-router)#neighbor 15.1.1.1 local-as 500 no-prepend

All externally advertised routes still have the local-as number prepended






No comments:

Post a Comment