The following task is configured on a spine and creates a peer group called "leaf-group" and associates it with the listen range of 150.1.0.0/16. The spine waits for the incoming TCP session initiated by a leaf node. When the TCP connection is accepted, the spine verifies whether the incoming TCP session falls under one of the configured listen ranges. If the verification is successful, a new BGP dynamic peer is created and associated with the peer group "leaf-group". This newly created BGP dynamic peer inherits the attributes associated with the peer group.
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