Two tasks are common to every BGP configuration: You must enable the BGP routing process, and you must configure BGP neighbors. All other basic configuration tasks are optional.
You can configure certain BGP attributes globally, for peer groups, or for individual peers. The most specific level of configuration takes precedence. For example, if you configure an attribute both globally and for a peer group, the peer group configuration takes precedence for that peer group, but does not affect other peer groups. If you configure an attribute both for a peer group and for a peer, the peer configuration takes precedence for that peer, but does not affect other members of that peer group.
All BGP configurations require that you enable the BGP routing process on one or more routers.
router bgp
- host1(config)#router bgp 100
BGP commands can be sorted into the following categories, each of which has a different scope; that is, each configures parameters within a different area of applicability. Individual command descriptions in this chapter and in Configuring BGP-MPLS Applications, provide more information about command behavior.
Table 6: Commands Affecting BGP Globally
Table 7: Commands Affecting All Address Families in a VRF
|
distance bgp |
synchronization |
Table 8: Commands Affecting the Current Address Family
- host1(config-router)#neighbor 10.1.3.4 remote-as
1234
- host1(config-router)#neighbor 10.2.3.4 ebgp-multihop
5
- host1(config-router)#address-family ipv4 multicast
- host1(config-router-af)#neighbor 10.2.3.4
ebgp-multihop ?
- % Invalid input detected at '^' marker.
- host1(config-router-af)#exit-address-family
Table 9: Commands Affecting All Address Families for the Specified Peer or Peer Group
- host1(config-router)#neighbor 1.1.3.4 remote-as
1234
- host1(config-router)#neighbor 1.2.3.4 route-map
ucast-map in
- host1(config-router)#address-family ipv4 multicast
- host1(config-router-af)#neighbor 1.2.3.4 activate
- host1(config-router-af)#neighbor 1.2.3.4 route-map
mcast-map in
- host1(config-router-af)#exit-address-family
Table 10: Commands Affecting Only the Current Address Family for the Specified Peer or Peer Group
Peer groups inherit all configuration values that are globally configured. However, attributes configured for a peer group override inherited global configuration values. Individual peers that are members of peer groups inherit all configuration values from the peer group. However, attributes configured on a peer override values inherited from the peer group of which it is a member.
The neighbor commands enable you to control features or set parameters for individual peers or for peer groups. These commands can be classified into the four categories shown in Table 11, based on whether the command enables a feature or sets parameters, the levels at which it behaves, and how the no version of the command compares with the default version.
Table 11: Behavior of Neighbor Commands Neighbor NeighborNeighbor
Some of the commands in Table 11 inherit global values set by other commands. Table 12 describes the relationship between these commands.
Table 12: Inheritance from Other Commands
Example 1
For category A and B commands, the behavior of the no version of the command is different from the behavior of the default version of the command. The no version explicitly disables the feature:
The default version simply unconfigures the feature for the peer or peer group.
The following example illustrates this difference and the inheritance concept with the neighbor soft-reconfiguration inbound command.
- host1(config-router)#neighbor lisbon peer-group
- host1(config-router)#neighbor 10.19.7.8 peer-group
lisbon
Inbound soft-reconfiguration is disabled by default, hence it is currently disabled for both the lisbon peer group and peer 10.19.7.8.
- host1(config-router)#neighbor lisbon soft-reconfiguration
inbound
Inbound soft-reconfiguration is now enabled for the lisbon peer group. Because the peer inherits values from the peer group, inbound soft-reconfiguration is now also enabled for peer 10.19.7.8.
- host1(config-router)#no neighbor 10.19.7.8
soft-reconfiguration inbound
The no command disables inbound soft-reconfiguration for peer 10.19.7.8, overriding the configuration of the peer group to which the peer 10.19.7.8 belongs. The configuration of an individual peer takes precedence over the configuration of the peer group to which the peer belongs.
- host1(config-router)#default neighbor 10.19.7.8
soft-reconfiguration inbound
The default version returns the peer to inheriting the peer group configuration. Because inbound soft-reconfiguration is still enabled for lisbon, it is now also enabled for peer 10.19.7.8.
- host1(config-router)#default neighbor lisbon
soft-reconfiguration inbound
Finally, this last command returns the peer group configuration to the default value, disabling inbound soft-reconfiguration. The peer 10.19.7.8 inherits this value.
Example 2
For category C and D commands, the behavior of the no version of the command is the same as the behavior of the default version of the command. The following example illustrates this behavior and the inheritance concept for the neighbor timers command.
By default, the BGP global keepalive timer is 30 seconds and the global hold-time timer is 90 seconds.
- host1(config-router)#neighbor eastcoast peer-group
- host1(config-router)#neighbor 10.10.21.23
peer-group eastcoast
Peer group eastcoast and peer 10.10.21.23 both have the default timer values. The peer group inherits the global timer values; the peer is a member of eastcoast and inherits the timer values from the peer group.
- host1(config-router)#neighbor eastcoast timers
15 40
Now peer group eastcoast has a keepalive timer of 15 seconds and a hold-time timer of 40 seconds. Peer 10.10.21.23 inherits these values from the peer group.
- host1(config-router)#no neighbor 10.10.21.23
timers
Now peer 10.10.21.23 has its timers reset to the global values of 30 and 90 seconds. The configuration of an individual peer takes precedence over the configuration of the peer group to which the peer belongs, which in turn takes precedence over the global configuration.
- host1(config-router)#default neighbor 10.10.21.23
timers
Nothing changes. For commands in categories C and D, the behavior of the default version is the same as the no version. Peer 10.10.21.23 still has the global timer values.
- host1(config-router)#neighbor eastcoast timers
20 20
The eastcoast peer group now has timer values of 20 seconds. Peer 10.10.21.23 still has the global timer values.
All BGP peers that are members of the same peer group must send essentially the same updates. Accordingly, all members of a peer group must be the same kind of peer; that is, all must be internal peers, all must be external peers, or all must be confederation peers.
Outbound policies configured for peer groups are still inherited by peer group members, but you cannot override this inherited outbound policy by configuring a different outbound policy on individual members of that peer group with the following commands:
Table 13: Commands That Do Not Override Inherited Outbound Policy
![]() |
Note: This restriction does not apply to inbound policy, which you can still override per peer. |
The update messages can vary for members of a peer group as follows:
By default, the router ID of the router is used as the BGP identifier. You can use the bgp router-id command to configure an IP address as the BGP identifier.
bgp router-id
- host1(config-router)#bgp router-id 10.25.1.1
Use the neighbor remote-as command to create a BGP peering session with a given BGP peer—identified by its IP address—in a given AS. Note that the neighbor remote-as command must be issued on both routers on either side of a BGP session for the BGP session to become established.
Consider the simple network structure shown in Figure 10. Routers LA and SanJose are IBGP peers within AS 873. Router SanJose has an EBGP peer, router Boston, in AS 17.
Figure 10: Configuring Neighbors

The following commands configure router Boston with router SanJose as a peer:
- host1(config)#router bgp 17
- host1(config-router)#neighbor 10.5.5.4 remote-as
873
The following commands configure router SanJose with router LA and router Boston as peers:
- host2(config)#router bgp 873
- host2(config-router)#neighbor 10.2.2.3 remote-as
873
- host2(config-router)#neighbor 10.5.5.1 remote-as
17
The following commands configure router LA with router SanJose as a peer:
- host3(config)#router bgp 873
- host3(config-router)#neighbor 10.2.2.4 remote-as
873
neighbor remote-as