Configure BGP4 Dynamic Neighbors

The peer group is added to the BGP neighbor table of the local device and an alternate ASN is configured.
  1. Access global configuration mode.
    device# configure terminal
  2. Access BGP configuration mode.
    device(config)# router bgp
  3. Specify the autonomous system in which your device resides.
    device(config-bgp-router)# local-as 65520
  4. Create a peer group.
    device(config-bgp-router)# neighbor mypeergroup1 peer-group
    This example creates a peer group called mypeergroup1.
  5. Specify an autonomous system for the peer-group.
    device(config-bgp-router)# neighbor mypeergroup1 remote-as 80
  6. Associate a subnet range with the BGP peer group.
    device(config-bgp-router)# listen-range 150.1.0.0/16 peer-group mypeergroup1 limit 20 
    This example specifies the 150.1.0.0/16 subnet range and uses the limit keyword to set the maximum number of BGP dynamic neighbors that can be created.
  7. Specify an alternate autonomous system for listen range neighbors in the configured peer group.
    device(config-bgp-router)# neighbor mypeergroup1 alternate-as add 101

The following example summarizes the commands in this procedure.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# local-as 65520
device(config-bgp-router)# neighbor mypeergroup1 peer-group
device(config-bgp-router)# neighbor mypeergroup1 remote-as 80
device(config-bgp-router)# listen-range 150.1.0.0/16 peer-group mypeergroup1 limit 20
device(config-bgp-router)# neighbor mypeergroup1 alternate-as add 101