device# configure terminal
device(config)# router bgp
device(config-bgp-router)# local-as 65520
device(config-bgp-router)# neighbor leaf-group peer-group
device(config-bgp-router)# listen-limit 30
device(config-bgp-router)# neighbor leaf-group remote-as 65550
device(config-bgp-router)# listen-range 150.1.0.0/16 peer-group leaf-group limit 20
device(config-bgp-router)# neighbor leaf-group alternate-as add 1210
device(config-bgp-router)# address-family l2vpn evpn
device(config-bgp-evpn)# neighbor leaf-group activate
The following example creates a peer group called "leaf-group" and associates it with the listen range of 150.1.0.0/16. It also sets a limit on the number of dynamic BGP neighbors that can be created. An alternate AS number of listen range neighbors in the configured peer group is set.
device# configure terminal device(config)# router bgp device(config-bgp-router)# local-as 65520 device(config-bgp-router)# neighbor leaf-group peer-group device(config-bgp-router)# listen-limit 30 device(config-bgp-router)# neighbor leaf-group remote-as 65550 device(config-bgp-router)# listen-range 150.1.0.0/16 peer-group leaf-group limit 20 device(config-bgp-router)# neighbor leaf-group alternate-as add 1210 device(config-bgp-router)# address-family l2vpn evpn device(config-bgp-evpn)# neighbor leaf-group activate