peer connect-interface (BGP multi-instance view)

Function

The peer connect-interface command specifies a source interface from which BGP packets are sent, and a source address used for initiating a connection.

The undo peer connect-interface command restores the default setting.

By default, the outbound interface of a BGP packet serves as the source interface of a BGP packet.

Format

peer ipv4-address connect-interface { interface-name | ipv4-source-address | interface-type interface-number | interface-name ipv4-source-address | interface-type interface-number ipv4-source-address }

undo peer ipv4-address connect-interface

Parameters

Parameter Description Value
ipv4-address

Specifies the IPv4 address of a peer.

The value is in dotted decimal notation.

interface-name

Specifies an interface name.

The value is a string of 1 to 63 case-sensitive characters, spaces not supported.

ipv4-source-address

Specifies an IPv4 source address used for establishing a connection.

The value is in dotted decimal notation.

interface-type

Specifies an interface type and number.

-

interface-number

Specifies an interface type and number.

The value is a string of 1 to 63 case-sensitive characters, spaces not supported.

Views

BGP multi-instance view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

Running the peer connect-interface command to establish multiple peer relationships between two devices by using multiple links is recommended.

If the physical interface has multiple IP addresses, the parameter ipv4-source-address must be in the command peer connect-interface.

Prerequisites

Peer relationships have been established using the peer as-number command.

Configuration Impact

Running the peer connect-interface command causes the teardown and re-establishment of peer relationships.

NOTE:

Because the BGP peer relationships in various address families on the same device share one TCP connection, connect-interface configured in the BGP view can be inherited in either the IPv4 unicast address family or the VPNv4 address family.

Precautions

To enable a device to send BGP packets even if its physical interface fails, you can configure the device to use a loopback interface as the source interface of the BGP packets. When configure a device to use a loopback interface as the source interface of BGP packets, note the following points:

  • The loopback interface of the device's BGP peer must be reachable.
  • In the case of an EBGP connection, the peer ebgp-max-hop command needs to be run to enable the two devices to establish an indirect peer relationship.

    NOTE:

    If the specified interface borrows the IP address of another interface and then the IP address of the specified interface is changed, BGP still uses the borrowed IP address to keep the connection if no connection reestablishment is triggered, and data receiving and sending is not affected; if connection reestablishment is triggered, BGP uses the new IP address to reestablish the connection.

Example

# Specify a source interface for sending BGP packets for initiating a connection.
<HUAWEI> system-view
[~HUAWEI] interface LoopBack 0
[*HUAWEI-LoopBack0] ip address 10.1.1.1 32
[*HUAWEI-LoopBack0] quit
[*HUAWEI] bgp 100 instance a
[*HUAWEI-bgp-instance-a] peer 10.1.1.1 as-number 100
[*HUAWEI-bgp-instance-a] peer 10.1.1.1 connect-interface LoopBack 0
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >