5.4. Configuring BGP with CLI

This section provides information to configure BGP using the command line interface.

5.5. BGP Configuration Overview

5.5.1. Preconfiguration Requirements

Before BGP can be implemented, the following entities must be configured:

  1. The autonomous system (AS) number for the router.
    An ASN is a globally unique value which associates a router to a specific autonomous system. This number is used to exchange exterior routing information with neighboring ASs and as an identifier of the AS itself. Each router participating in BGP must have an ASN specified.
    To implement BGP, the ASN must be specified in the config>router context.
  2. Router ID — The router ID is the IP address of the local router. The router ID identifies a packet’s origin. The router ID must be a valid host address.

5.5.2. BGP Hierarchy

BGP is configured in the config>router>bgp context. Three hierarchical levels are included in BGP configurations:

  1. Global level
  2. Group level
  3. Neighbor level

Commands and parameters configured on the global level are inherited to the group and neighbor levels although parameters configured on the group and neighbor levels take precedence over global configurations.

5.5.3. Internal and External BGP Configurations

A BGP system is comprised of ASs which share network reachability information. Network reachability information is shared with adjacent BGP systems neighbors. Further logical groupings are established within BGP systems within ASs. BGP supports two types of routing information exchanges:

  1. External BGP (EBGP) is used between ASs.
    EBGP speakers peer to different ASs and typically share a subnet. In an external group, the next hop is dependent upon the interface shared between the external peer and the specific neighbor. The multihop command must be specified if an EBGP peer is more than one hop away from the local router. The next hop to the peer must be configured so that the two systems can establish a BGP session.
  2. Internal BGP (IBGP) is used within an AS.
    An IBGP speaker peers to the same AS and typically does not share a subnet. Neighbors do not have to be directly connected to each other. Since IBGP peers are not required to be directly connected, IBGP uses the IGP path (the IP next-hop learned from the IGP) to reach an IBGP peer for its peering connection.

5.6. Basic BGP Configuration

This section provides information to configure BGP and configuration examples of common configuration tasks. The minimal BGP parameters that need to be configured are:

  1. An autonomous system number for the router.
  2. A router ID - Note that if a new or different router ID value is entered in the BGP context, then the new valued takes precedence and overwrites the router-level router ID.
  3. A BGP peer group.
  4. A BGP neighbor with which to peer.
  5. A BGP peer-AS that is associated with the preceding peer.

The BGP configuration commands have three primary configuration levels: bgp for global configurations, group name for BGP group configuration, and neighbor ip-address for BGP neighbor configuration. Within the different levels, many of the configuration commands are repeated. For the repeated commands, the command that is most specific to the neighboring router is in effect, that is, neighbor settings have precedence over group settings which have precedence over BGP global settings.

The following is a sample configuration that includes the preceding parameters. The following parameters are optional.

info
#--------------------------------------------------
echo "IP Configuration"
#--------------------------------------------------
...
        autonomous-system 200
        router-id 10.10.10.103
#--------------------------------------------------
...
#--------------------------------------------------
echo "BGP Configuration"
#--------------------------------------------------
        bgp
            exit
            
            export "direct2bgp"
            router-id 10.0.0.12
            group "To_AS_10000"
                connect-retry 20
                hold-time 90
                keepalive 30
                local-preference 100
                remove-private
                peer-as 10000
                neighbor 10.0.0.8
                    description "To_Router B - EBGP Peer"
                    connect-retry 20
                    hold-time 90
                    keepalive 30
                    local-address 10.0.0.12
                    passive
                    preference 99
                    peer-as 10000
                exit
            exit
            group "To_AS_30000"
                connect-retry 20
                hold-time 90
                keepalive 30
                local-preference 100
                remove-private
                peer-as 30000
                neighbor 10.0.3.10
                    description "To_Router C - EBGP Peer"
                    connect-retry 20
                    hold-time 90
                    keepalive 30
                    peer-as 30000
                exit
            exit
            group "To_AS_40000"
                connect-retry 20
                hold-time 30
                keepalive 30
                local-preference 100
                peer-as 65206
                neighbor 10.0.0.15
 
 description "To_Router E - Sub Confederation AS 65205"
                    connect-retry 20
                    hold-time 90
                    keepalive 30
                    local-address 10.0.0.12
                    peer-as 65205
                exit
            exit
        exit
#--------------------------------------------------
....
A:ALA-48>config>router#
 

5.7. Common Configuration Tasks

This section provides a brief overview of the tasks that must be performed to configure BGP and provides the CLI commands. To enable BGP, one AS must be configured and at least one group must be configured which includes neighbor (system or IP address) and peering information ASN.

Configure BGP hierarchically, the global level (applies to all peers), the group level (applies to all peers in peer-group), or the neighbor level (only applies to specified peer). By default, group members inherit the group’s configuration parameters although a parameter can be modified on a per-member basis without affecting the group-level parameters.

Many of the hierarchical BGP commands can be used on different levels. The most specific value is used. That is, a BGP group-specific command takes precedence over a global BGP command. A neighbor-specific statement takes precedence over a global BGP or group-specific command.

All BGP instances must be explicitly created on each node. When created, BGP is administratively enabled.

Configuration planning is essential to organize ASs and the 7210 nodes within the ASs, and determine the internal and external BGP peering.

To configure a basic autonomous system, perform the following tasks:

  1. Prepare a plan detailing the autonomous system, the 7210 SAS node belonging to each group, group names, and peering connections.
  2. Associate each 7210 SAS node with an autonomous system number.
  3. Configure each 7210 SAS node with a router ID.
  4. Associate each 7210 SAS node with a peer group name.
  5. Specify the local IP address that will be used by the group or neighbor when communicating with BGP peers.
  6. Specify neighbors.
  7. Specify the autonomous system number associated with each neighbor.

5.7.1. Creating an Autonomous System

Before BGP can be configured, the autonomous system must be configured first. In BGP, routing reachability information is exchanged between autonomous systems (ASs). An AS is a group of networks that share routing information. The autonomous-system command associates an autonomous system number to the router being configured. A 7210 SAS device can only belong to one AS. The autonomous-system command is configured in the config>router context.

Use the following syntax to associate a 7210 SAS device to an autonomous system.

CLI Syntax:
config>router# autonomous-system autonomous-system

The 7210 SAS devise supports 4 bytes AS numbers by default. This means autonomous-system can have any value from 1 to 4294967295. The following shows the command usage to configure the autonomous system.

Example:
config>router# autonomous-system 100

The following is a sample autonomous system configuration output.

 
ALA-B>config>router# info
#------------------------------------------
# IP Configuration
#------------------------------------------
        interface "system"
            address 10.10.10.104/32
        exit
        interface "to-103"
            address 10.0.0.104/24
            port 1/1/1
        exit
        autonomous-system 100
 
#------------------------------------------
ALA-B>config>router#

5.7.2. Configuring a Router ID

In BGP, routing information is exchanged between autonomous systems. The BGP router ID, expressed like an IP address, uniquely identifies the router. It can be set to be the same as the loopback address.

Note that if a new or different router ID value is entered in the BGP context, then the new router ID value is used instead of the router ID configured on the router level, system interface level, or inherited from the MAC address. The router-level router ID value remains intact. A router ID can be derived by:

  1. Defining the value in the config>router router-id context.
  2. Defining the system interface in the config>router>interface ip-int-name context.
  3. Inheriting the last four bytes of the MAC address.
  4. The BGP protocol level. The router ID can be defined in the config>router>bgp router-id context and is only used within BGP.

When configuring a new router ID, protocols are not automatically restarted with the new router ID. The next time a protocol is (re) initialized the new router ID is used. An interim period of time can occur when different protocols use different router IDs. To force the new router ID, issue the shutdown and no shutdown commands for each protocol that uses the router ID or restart the entire router. Use the following CLI syntax to configure the router ID:

CLI Syntax:
config>router# router-id router-id

The following shows the command usage to configure router ID.

Example:
config>router# router-id 10.10.10.104

The following is a sample router ID configuration output.

ALA-B>config>router# info
----------------------------------------------
# IP Configuration
#------------------------------------------
        interface "system"
            address 10.10.10.104/32
        exit
        interface "to-103"
            address 10.0.0.104/24
            port 1/1/1
        exit
        autonomous-system 100
        router-id 10.10.10.104
#------------------------------------------
...
ALA-B>config>router# 

5.7.3. BGP Components

The following section describes the syntax used to configure the BGP components.

5.7.4. Configuring BGP

When the BGP protocol instance is created, the no shutdown command is not required since BGP is administratively enabled upon creation. Minimally, to enable BGP on a router, you must associate an autonomous system number for the router, have a preconfigured router ID or system interface, create a peer group, neighbor, and associate a peer ASN. There are no default groups or neighbors. Each group and neighbor must be explicitly configured.

All parameters configured for BGP are applied to the group and are inherited by each peer, but a group parameter can be overridden on a specific basis. BGP command hierarchy consists of three levels:

  1. The global level
  2. The group level
  3. The neighbor level
CLI Syntax:
config>router# bgp (global level)
group (group level)
neighbor (neighbor level)
Note:

Careful planning is essential to implement commands that can affect the behavior of global, group, and neighbor levels. Because the BGP commands are hierarchical, analyze the values that can disable features on a particular level.

The following is a sample basic BGP configuration output.

ALA-B>config>router# info 
#------------------------------------------
# BGP Configuration
#------------------------------------------
#------------------------------------------
# BGP
#------------------------------------------
 
        bgp
        exit
 
#------------------------------------------
ALA-B>config>router# 

5.7.5. Configuring Group Attributes

A group is a collection of related BGP peers. The group name should be a descriptive name for the group. Follow your group, name, and ID naming conventions for consistency and to help when troubleshooting faults.

All parameters configured for a peer group are applied to the group and are inherited by each peer (neighbor), but a group parameter can be overridden on a specific neighbor-level basis.

The following is a sample BGP group configuration output.

ALA-B>config>router>bgp# info
----------------------------------------------
...
            group "headquarters1"
                description "HQ execs"
                local-address 10.0.0.104
                disable-communities standard extended
                ttl-security 255
                exit
            exit
...
----------------------------------------------
ALA-B>config>router>bgp#
 

5.7.6. Configuring Neighbor Attributes

After you create a group name and assign options, add neighbors within the same autonomous system to create IBGP connections and/or neighbors in different autonomous systems to create EBGP peers. All parameters configured for the peer group level are applied to each neighbor, but a group parameter can be overridden on a specific neighbor basis.

The following is a sample output for neighbors configured in group “headquarters1”.

ALA-B>config>router>bgp# info
----------------------------------------------
...
            group "headquarters1"
                description "HQ execs"
                local-address 10.0.0.104
                disable-communities standard extended
                ttl-security 255
                neighbor 10.0.0.5
                    passive
                    peer-as 300
                exit
                neighbor 10.0.0.106
                    peer-as 100
                exit
                neighbor 17.5.0.2
                    hold-time 90
                    keepalive 30
                    min-as-origination 15
                    local-preference 170
                    peer-as 10701
                exit
                neighbor 17.5.1.2
                    hold-time 90
                    keepalive 30
                    min-as-origination 15
                    local-preference 100
                    min-route-advertisement 30
                    preference 170
                    peer-as 10702
                exit
            exit
...
----------------------------------------------
ALA-B>config>router>bgp#

5.7.7. Configuring AIGP

The AIGP metric is an optional, non-transitive attribute that can be attached to selected routes using route policies. In networks that use AIGP, BGP paths with a lower end-to-end IGP cost are preferred, even if the compared paths span more than one AS or IGP instance.

AIGP is supported only in the base router BGP instance and only for label-IPv4 and 6PE routes. The AIGP attribute is only sent to peers configured using the configure>router>bgp>group>aigp and configure>router>bgp>group>neighbor>aigp commands.

The following is a sample BGP policy configuration output with AIGP attribute information included.

*A:Dut-C>config>router>policy-options# info 
----------------------------------------------
            policy-statement "AIGP_ADD"
                description "Policy From bgp To bgp"
                entry 10
                    description "Entry 10 - From Prot. bgp To bgp"
                    from
                        protocol bgp
                    exit
                    to
                        protocol bgp
                    exit
                    action accept
                        aigp-metric add 555
                    exit
                exit
            exit
            policy-statement "AIGP_EXPORT_PLCY"
                description "Policy From bgp To bgp"
                entry 10
                    description "Entry 10 - From Prot. bgp To bgp"
                    from
                        protocol bgp
                    exit
                    to
                        protocol bgp
                    exit
                    action accept
                        next-hop 10.20.1.3
                    exit
                exit
            exit
----------------------------------------------

The following is a sample BGP instance configuration output with AIGP attribute information included.

*A:Dut-C>config>router>bgp# info 
----------------------------------------------
            min-route-advertisement 1
            router-id 10.20.1.3
            group "PEER_TO_A"
                neighbor 10.10.1.1
                    local-address 10.10.1.3
                    peer-as 200
                    advertise-label ipv4
                exit
            exit
            group "PEER_RR_TO_D_E_B"
                cluster 10.20.1.3
                aigp
                neighbor 10.20.1.2
                    local-address 10.20.1.3
                    med-out 100
                    import "AIGP_ADD" 
                    peer-as 300
                    advertise-label ipv4
                exit
                neighbor 10.20.1.4
                    local-address 10.20.1.3
                    med-out 100
                    peer-as 300
                    advertise-label ipv4
                exit
                neighbor 10.20.1.5
                    local-address 10.20.1.3
                    export "AIGP_EXPORT_PLCY" 
                    peer-as 300
                    advertise-label ipv4
                exit
            exit
            no shutdown
----------------------------------------------

5.8. BGP Configuration Management Tasks

This section describes the BGP configuration management tasks.

5.8.1. Modifying an ASN

You can modify an ASN on a 7210 SAS but the new ASN will not be used until the BGP instance is restarted either by administratively disabling or enabling the BGP instance or by rebooting the system with the new configuration.

Since the ASN is defined in the config>router context, not in the BGP configuration context, the BGP instance is not aware of the change. Re-examine the plan detailing the autonomous system the SRs belonging to each group, group names, and peering connections. Changing an ASN on a 7210 SAS could cause configuration inconsistencies if associated peer-as values are not also modified as required. At the group and neighbor levels, BGP will re-establish the peer relationships with all peers in the group with the new ASN.

Use the following syntax to change an ASN.

CLI Syntax:
config>router# autonomous-system autonomous-system
CLI Syntax:
config>router# bgp
group name
neighbor ip-addr
peer-as asn
Example:
config>router# autonomous-system 400
config>router# bgp
config>router>bgp# group headquarters1
config>router>bgp>group# neighbor 10.10.10.103
config>router>bgp>group# peer-as 400
config>router>bgp>group# exit

5.8.2. Modifying the BGP Router ID

Changing the router ID number in the BGP context causes the new value to overwrite the router ID configured on the router level, system interface level, or the value inherited from the MAC address. Changing the router ID on a router could cause configuration inconsistencies if associated values are not also modified.

When configuring a new router ID, protocols are not automatically restarted with the new router ID. The next time BGP is (re) initialized the new router ID is used. To force the new router ID, issue the shutdown and no shutdown commands for BGP or restart the entire router.

Example:
config>router>bgp# router-id 10.0.0.104
config>router>bgp# shutdown
config>router>bgp# router-id 10.0.0.123
config>router>bgp# no shutdown

The following is a sample BGP configuration output with the BGP router ID specified.

ALA-B>config>router>bgp# info detail
----------------------------------------------
no shutdown
no description
no always-compare-med
ibgp-multipath load-balance
. . . 
router-id 10.0.0.123
----------------------------------------------
ALA-B>config>router>bgp#

5.8.3. Modifying the Router-Level Router ID

Changing the router ID number in the config>router context causes the new value to overwrite the router ID configured on the protocol level, system interface level, or the value inherited from the MAC address. Changing the router ID on a router could cause configuration inconsistencies if associated values are not also modified.

When configuring a new router ID, protocols are not automatically restarted with the new router ID. The next time a protocol is (re) initialized the new router ID is used. An interim period of time can occur when different protocols use different router IDs. To force the new router ID, issue the shutdown and no shutdown commands for each protocol that uses the router ID or restart the entire router.

Use the following syntax to change a router ID.

CLI Syntax:
config>router# router-id router-id
Example:
config>router# router-id 10.10.10.104
config>router# no shutdown
config>router>bgp# shutdown
config>router>bgp# no shutdown

The following is a sample router ID configuration output.

 
ALA-A>config>router# info
#------------------------------------------
# IP Configuration
#------------------------------------------
        interface "system"
            address 10.10.10.104/32
        exit
        interface "to-103"
            address 10.0.0.104/24
            port 1/1/1
        exit
        autonomous-system 100
        router-id 10.10.10.104
 
#------------------------------------------
ALA-B>config>router#

5.8.4. Deleting a Neighbor

To delete a neighbor, you must shut down the neighbor before issuing the no neighbor ip-addr command.

Use the following syntax to delete a neighbor.

CLI Syntax:
config>router# bgp
group name
no neighbor ip-address
shutdown
no peer-as asn
shutdown
Example:
config>router# bgp
config>router>bgp# group headquarters1
config>router>bgp>group# neighbor 10.0.0.103
config>router>bgp>group>neighbor# shutdown
config>router>bgp>group>neighbor# exit
config>router>bgp>group# no neighbor 10.0.0.103

The following is a sample of the “headquarters1” configuration output with the neighbor 10.0.0.103 removed.

ALA-B>config>router>bgp# info
----------------------------------------------
            group "headquarters1"
description “HQ execs”
                local-address 10.0.0.104
                neighbor 10.0.0.5
                    passive
                    peer-as 300
                exit
 exit
----------------------------------------------
ALA-B>config>router>bgp#

5.8.5. Deleting Groups

To delete a group, the neighbor configurations must be shut down first. After each neighbor is shut down, you must shut down the group before issuing the no group name command.

Use the following syntax to shut down a peer and neighbor and then delete a group.

CLI Syntax:
config>router# bgp
no group name
shutdown
no neighbor ip-address
shutdown
shutdown
Example:
config>router# bgp
config>router>bgp# group headquarters1
config>router>bgp>group# neighbor 10.0.0.105
config>router>bgp>group>neighbor# shutdown
config>router>bgp>group>neighbor# exit
config>router>bgp>group# neighbor 10.0.0.103
config>router>bgp>group# shutdown
config>router>bgp>group# exit
config>router>bgp# no headquarters1

If you try to delete the group without shutting down the peer-group, the following message appears.

ALA-B>config>router>bgp# no group headquarters1
MINOR: CLI BGP Peer Group should be shutdown before deleted. BGP Peer Group not 
deleted.

5.8.6. Editing BGP Parameters

You can change existing BGP parameters in the CLI. The changes are applied immediately.

CLI Syntax:
config>router# bgp
group name
. . .
  neighbor ip-address
. . .
Example:
config>router# bgp

See BGP Components for a complete list of BGP parameters.