bgp

Function

The bgp command enables BGP and enter the BGP view or displays the BGP view directly.

The undo bgp command disables BGP.

By default, the BGP is disabled.

Format

bgp as-number

undo bgp [ as-number ]

Parameters

Parameter Description Value
as-number

Specifies a destination AS number.

For an integral AS number, the value is an integer ranging from 1 to 4294967295.

For an AS number in dotted notation, the value is in the format of x.y, where x and y are integers ranging from 1 to 65535 and from 0 to 65535, respectively.

Views

Command template view, System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

BGP is an inter-AS dynamic routing protocol. BGP running within an AS is called Internal BGP (IBGP), and BGP running between ASs is called External BGP (EBGP).

Whether to apply BGP to inter-AS routing information transmission depends on the following conditions:

  • If at least one of the following conditions is met, BGP can be used:
  • Data packets are allowed to be transmitted from one AS to another.
  • Multiple connections to external ISPs and the Internet exist in ASs.
  • Data flows entering or leaving ASs need to be controlled.
  • If one of the following conditions is met, BGP does not need to be used:
  • Users are connected to only one ISP network.
  • The ISP does not need to provide Internet access services for users.
  • ASs adopt default routes between each other.

    Configurations in different views may be identical. To simplify the configurations, create a configuration template, define configurations that are duplicate in different views in it, and apply the configuration template to specified views.

    Each device can run only in one AS. Therefore, only one local AS number can be specified in the command, which cannot simplify configuration. For details about other usage of the command, see the bgp command in the system view.

Prerequisites

Before running the bgp command in the configuration template view, ensure that a configuration template has been created and the configuration template view has been displayed using the command group command.

Configuration Impact

After the bgp command is run, BGP is enabled.

Follow-up Procedure

Run the peer as-number command to establish BGP peer relationships between devices on a BGP network.

Run the apply-command-group command in a desired view to apply the configurations in the configuration template.

Precautions

Each device runs in only one AS; therefore, each device can be specified with only one local AS number.

By default, an AS number must be specified when you run the undo bgp command. If the re-confirmation function is disabled for undo commands using the configuration prevent-misoperation disable command, an AS number is optional when you run the undo bgp command.

Exercise caution when using the undo bgp command because it will delete all BGP configurations from a device.

After performing the configurations to be delivered in the template, run the end-group command to end configuration, commit the configurations, and exit the configuration template view.

To prevent a configuration in the configuration template from being applied, you can run the undo command-string command in the configuration template view to delete the configuration from the template.

If the BGP AS number is changed, the route calculation result of the local or remote OSPF VPN process may be affected. Because the tag value of the LSAs of the OSPF VPN process is calculated based on the BGP AS number, the local tag value of the OSPF VPN process and the tag value carried in the LSA advertised by the OSPF VPN process change. After receiving an LSA, the local or remote OSPF process checks the tag of the LSA. If the local tag of the OSPF process is the same as the tag of the received LSA, the LSA is not used for OSPF route calculation.

Example

# Create a configuration template named g1 and configure an IPv4 BGP peer (with IP address of 1.1.1.1 and AS number of 100) in the template.
<HUAWEI> system-view
[~HUAWEI] command group g1
[~HUAWEI-group-g1] bgp 100
[~HUAWEI-group-g1-bgp] peer 1.1.1.1 as-number 100
[~HUAWEI-group-g1-bgp] quit
[~HUAWEI-group-g1] end-group
# Enable BGP and enter the BGP view.
<HUAWEI> system-view
[~HUAWEI] bgp 100
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >