Configuring a BGP Peer

Devices can exchange BGP routing information only after the BGP peer relationship is established.

Context

Because BGP uses TCP connections, you need to configure the IP addresses of peers when configuring BGP. A BGP peer may not be a neighboring node, and the BGP peer relationship can be created through logical links. To enhance the stability of BGP connections, establish connections by using loopback interface addresses.

The devices in the same AS establish IBGP peer relationships, and the devices of different ASs establish EBGP peer relationships.

Procedure

  • Configure an IBGP peer.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run peer ipv4-address as-number as-number

      A peer IP address and the number of the AS where the peer resides are specified.

      The number of the AS where the specified peer resides must be the same as that of the local AS.

      The IP address of the peer can be one of the following types:

      • IP address of the peer's interface that is directly connected to the local device

      • IP address of a sub-interface on a directly connected peer

      • IP address of a reachable loopback interface on the peer

    4. (Optional) Run peer ipv4-address connect-interface interface-type interface-number [ ipv4-source-address ]

      A source interface and a source address used to set up a TCP connection with the BGP peer are specified.

      If the IP address of a loopback interface or a sub-interface is used to establish a BGP connection, you are advised to run the peer connect-interface command at both ends of the connection to ensure that the connection is correctly established. If this command is run on only one end, the BGP connection may not be established.

    5. (Optional) Run peer ipv4-address description description-text

      A description is configured for the peer.

      To simplify network management, you can configure a description for a specified peer.

    6. (Optional) Run peer ipv4-address tcp-mss tcp-mss-number

      A TCP MSS value used during TCP connection establishment with a peer or peer group is configured.

      This configuration ensures that TCP packets can still be segmented properly based on the specified TCP MSS in cases where the path MTU is unavailable, thereby improving network performance.

    7. Run commit

      The configuration is committed.

  • Configure an EBGP peer.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run peer ipv4-address as-number as-number

      A peer IP address and the number of the AS where the peer resides are specified.

      The number of the AS where the specified peer resides must be different from that of the local AS.

      The IP address of the peer can be one of the following types:

      • IP address of the peer's interface that is directly connected to the local device

      • IP address of a sub-interface on a directly connected peer

      • IP address of a reachable loopback interface on the peer

    4. (Optional) Run peer ipv4-address connect-interface interface-type interface-number [ ipv4-source-address ]

      A source interface and a source address used to set up a TCP connection with the BGP peer are specified.

      If the IP address of a loopback interface or a sub-interface is used to establish a BGP connection, you are advised to run the peer connect-interface command at both ends of the connection to ensure that the connection is correctly established. If this command is run on only one end, the BGP connection may not be established.

    5. (Optional) Run peer ipv4-address ebgp-max-hop [ hop-count ]

      The maximum number of hops allowed over an EBGP connection is configured.

      In most cases, EBGP peers are directly connected through a physical link. If you want to establish an EBGP peer relationship between indirectly connected peers, run the peer ebgp-max-hop command to set the maximum number of hops allowed over the EBGP connection.

      If loopback interfaces are used to establish an EBGP connection, run the peer ebgp-max-hop command, where the value of hop-count must be greater than or equal to 2. Otherwise, the EBGP peer relationship cannot be established.

    6. (Optional) Run peer ipv4-address description description-text

      A description is configured for the peer.

      To simplify network management, you can configure a description for a specified peer.

    7. (Optional) Run peer ipv4-address tcp-mss tcp-mss-number

      A TCP MSS value used during TCP connection establishment with a peer or peer group is configured.

      This configuration ensures that TCP packets can still be segmented properly based on the specified TCP MSS in cases where the path MTU is unavailable, thereby improving network performance.

    8. Run commit

      The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >