In Cisco IOS Release 12.2(33)SXH, support for BGP dynamic neighbors was introduced. Perform this task to implement the dynamic creation of BGP neighbors using subnet ranges.
In this task, a BGP peer group is created on Router B in the figure below, a global limit is set on the number of dynamic BGP neighbors, and a subnet range is associated with a peer group. Configuring the subnet range enables the dynamic BGP neighbor process. The peer group is added to the BGP neighbor table of the local router, and an alternate autonomous system number is also configured. The peer group is activated under the IPv4 address family.
The next step is to move to another router--Router E in the figure below--where a BGP session is started and the neighbor router, Router B, is configured as a remote BGP peer. The peering configuration opens a TCP session and triggers Router B to create a dynamic BGP neighbor because the IP address that starts the TCP session (192.168.3.2) is within the configured subnet range for dynamic BGP peers. The task moves back to the first router, Router B, to run three show commands that have been modified to display dynamic BGP peer information.
Figure 1 |
BGP Dynamic Neighbor Topology |
Before You Begin
This task requires Cisco IOS Release 12.2(33)SXH, or a later release, to be running.
Note |
This task supports only IPv4 BGP peering.
|
SUMMARY STEPS
1. enable
2. configure terminal
3. router bgp autonomous-system-number
4. bgp log-neighbor-changes
5. neighbor peer-group-name peer-group
6. bgp listen [limit max-number]
7. bgp listen [limit max-number | range network / length peer-group peer-group-name]
8. neighbor {ip-address | ipv6-address | peer-group-name} ebgp-multihop [ ttl]
9. neighbor peer-group-name remote-as autonomous-system-number [alternate-as autonomous-system-number...]
10. address-family ipv4 [mdt | multicast | unicast [vrf vrf-name]]
11. neighbor {ip-address| peer-group-name} activate
12. end
13. Move to another router that has an interface within the subnet range for the BGP peer group configured in this task.
14. enable
15. configure terminal
16. router bgp autonomous-system-number
17. neighbor {ip-address| peer-group-name} remote-as autonomous-system-number[alternate-as autonomous-system-number...]
18. Return to the first router.
19. show ip bgp summary
20. show ip bgp peer-group [peer-group-name] [summary]
21. show ip bgp neighbors [ip-address]
DETAILED STEPS
|
Command or Action |
Purpose |
|
enable
Example:
RouterB> enable
|
Enables privileged EXEC mode.
-
Enter your password if prompted.
-
The configuration is entered on router B.
|
|
configure terminal
Example:
RouterB# configure terminal
|
Enters global configuration mode. |
|
router bgp autonomous-system-number
Example:
RouterB(config)# router bgp 45000
|
Enters router configuration mode for the specified routing process. |
|
bgp log-neighbor-changes
Example:
RouterB(config-router)# bgp log-neighbor-changes
|
(Optional) Enables logging of BGP neighbor status changes (up or down) and neighbor resets.
-
Use this command for troubleshooting network connectivity problems and measuring network stability. Unexpected neighbor resets might indicate high error rates or high packet loss in the network and should be investigated.
|
|
neighbor peer-group-name peer-group
Example:
RouterB(config-router)# neighbor group192 peer-group
|
Creates a BGP peer group.
-
In this example, a peer group named group192 is created. This group will be used as a listen range group.
|
|
bgp listen [limit max-number]
Example:
RouterB(config-router)# bgp listen limit 200
|
Sets a global limit of BGP dynamic subnet range neighbors.
-
Use the optional limit keyword and max-number argument to define the maximum number of BGP dynamic subnet range neighbors that can be created.
Note |
Only the syntax applicable to this task is used in this example. For the complete syntax, see Step 7. |
|
|
bgp listen [limit max-number | range network / length peer-group peer-group-name]
Example:
RouterB(config-router)# bgp listen range 192.168.0.0/16 peer-group group192
|
Associates a subnet range with a BGP peer group and activates the BGP dynamic neighbors feature.
-
Use the optional limit keyword and max-number argument to define the maximum number of BGP dynamic neighbors that can be created.
-
Use the optional range keyword and network / length argument to define a prefix range to be associated with the specified peer group.
-
In this example, the prefix range 192.168.0.0/16 is associated with the listen range group named group192.
|
|
neighbor {ip-address | ipv6-address | peer-group-name} ebgp-multihop [ ttl]
Example:
RouterB(config-router)# neighbor group192 ebgp-multihop 255
|
Accepts and attempts BGP connections to external peers residing on networks that are not directly connected. |
|
neighbor peer-group-name remote-as autonomous-system-number [alternate-as autonomous-system-number...]
Example:
RouterB(config-router)# neighbor group192 remote-as 40000 alternate-as 50000
|
Adds the IP address or peer group name of the neighbor in the specified autonomous system to the IPv4 multiprotocol BGP neighbor table of the local router.
-
Use the optional alternate-as keyword and autonomous-system-number argument to identify up to five alternate autonomous system numbers for listen range neighbors.
-
In this example, the peer group named group192 is configured with two possible autonomous system numbers.
Note |
The alternate-as keyword is used only with the listen range peer groups, not with individual BGP neighbors. |
|
|
address-family ipv4 [mdt | multicast | unicast [vrf vrf-name]]
Example:
RouterB(config-router)# address-family ipv4 unicast
|
Enters address family configuration mode to configure BGP peers to accept address-family-specific configurations. |
|
neighbor {ip-address| peer-group-name} activate
Example:
RouterB(config-router-af)# neighbor group192 activate
|
Activates the neighbor or listen range peer group for the configured address family.
-
In this example, the neighbor 172.16.1.1 is activated for the IPv4 address family.
Note |
Usually BGP peer groups cannot be activated using this command, but the listen range peer groups are a special case. |
|
|
end
Example:
RouterB(config-router-af)# end
|
Exits address family configuration mode and returns to privileged EXEC mode. |
|
Move to another router that has an interface within the subnet range for the BGP peer group configured in this task.
|
-- |
|
enable
Example:
RouterE> enable
|
Enables privileged EXEC mode.
-
Enter your password if prompted.
-
The configuration is entered on Router E.
|
|
configure terminal
Example:
RouterE# configure terminal
|
Enters global configuration mode. |
|
router bgp autonomous-system-number
Example:
RouterE(config)# router bgp 50000
|
Enters router configuration mode for the specified routing process. |
|
neighbor {ip-address| peer-group-name} remote-as autonomous-system-number[alternate-as autonomous-system-number...]
Example:
RouterE(config-router)# neighbor 192.168.3.1 remote-as 45000
|
Adds the IP address or peer group name of the neighbor in the specified autonomous system to the IPv4 multiprotocol BGP neighbor table of the local router.
-
In this example, the interface (192.168.3.2 in the figure above) at Router E is with the subnet range set for the BGP listen range group, group192. When TCP opens a session to peer to Router B, Router B creates this peer dynamically.
|
|
Return to the first router.
|
-- |
|
show ip bgp summary
Example:
RouterB# show ip bgp summary
|
(Optional) Displays the BGP path, prefix, and attribute information for all connections to BGP neighbors.
-
In this step, the configuration has returned to Router B.
|
|
show ip bgp peer-group [peer-group-name] [summary]
Example:
RouterB# show ip bgp peer-group group192
|
(Optional) Displays information about BGP peer groups. |
|
show ip bgp neighbors [ip-address]
Example:
RouterB# show ip bgp neighbors 192.168.3.2
|
(Optional) Displays information about BGP and TCP connections to neighbors.
-
In this example, information is displayed about the dynamically created neighbor at 192.168.3.2. The IP address of this BGP neighbor can be found in the output of either the show ip bgp summary or the show ip bgp peer-group command.
Note |
Only the syntax applicable to this task is used in this example. For more details, see the Cisco IOS IP Routing: BGP Command Reference. |
|
Examples
The following output examples were taken from Router B in the figure above after the appropriate configuration steps in this task were completed on both Router B and Router E.
The following output from the show ip bgp summary command shows that the BGP neighbor 192.168.3.2 was dynamically created and is a member of the listen range group, group192. The output also shows that the IP prefix range of 192.168.0.0/16 is defined for the listen range named group192.
Router# show ip bgp summary
BGP router identifier 192.168.3.1, local AS number 45000
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
*192.168.3.2 4 50000 2 2 0 0 0 00:00:37 0
* Dynamically created based on a listen range command
Dynamically created neighbors: 1/(200 max), Subnet ranges: 1
BGP peergroup group192 listen range group members:
192.168.0.0/16
The following output from the show ip bgp peer-group command shows information about the listen range group, group192 that was configured in this task:
Router# show ip bgp peer-group group192
BGP peer-group is group192, remote AS 40000
BGP peergroup group192 listen range group members:
192.168.0.0/16
BGP version 4
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP neighbor is group192, peer-group external, members:
*192.168.3.2
Index 0, Offset 0, Mask 0x0
Update messages formatted 0, replicated 0
Number of NLRIs in the update sent: max 0, min 0
The following sample output from the show ip bgp neighbors command shows that the neighbor 192.168.3.2 is a member of the peer group, group192, and belongs to the subnet range group 192.168.0.0/16, which shows that this peer was dynamically created:
Router# show ip bgp neighbors 192.168.3.2
BGP neighbor is *192.168.3.2, remote AS 50000, external link
Member of peer-group group192 for session parameters
Belongs to the subnet range group: 192.168.0.0/16
BGP version 4, remote router ID 192.168.3.2
BGP state = Established, up for 00:06:35
Last read 00:00:33, last write 00:00:25, hold time is 180, keepalive intervals
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 0 0
Keepalives: 7 7
Route Refresh: 0 0
Total: 8 8
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1/0
Output queue size : 0
Index 1, Offset 0, Mask 0x2
1 update-group member
group192 peer-group member
.
.
.