< Home

peer connect-interface

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 the BGP packet.

Format

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

peer { group-name | ipv6-address } connect-interface interface-type interface-number [ ipv6-source-address ]

undo peer { group-name | ipv4-address | ipv6-address } connect-interface

Parameters

Parameter Description Value
group-name Specifies the name of a peer group. The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.
ipv4-address Specifies the IPv4 address of a peer. It is in dotted decimal notation.
interface-type interface-number Specifies the type and number of an interface. -
ipv6-address Specifies the IPv6 address of a peer. The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.
ipv4-source-address Specifies an IPv4 source address used for establishing a connection. It is in dotted decimal notation.
ipv6-source-address Specifies an IPv6 source address used for establishing a connection. The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.
  • ipv4-address is valid only in the BGP view and BGP-VPN instance IPv4 address family view.

  • ipv6-address is valid only in the BGP view and BGP-VPN instance IPv6 address family view.

Views

BGP view, BGP-VPN instance IPv4 address family view, BGP-VPN instance IPv6 address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The command is used in the following scenarios:
  • To establish a BGP peer connection between two indirectly connected physical interfaces, the peer connect-interface command must be run on both sides.

    To establish a BGP peer connection between a local loopback interface and a remote interface, the loopback interface must be specified as the source interface in the command. To establish a BGP peer connection between a local physical interface and a remote interface, the physical interface must be specified as the source interface in the command.

  • If multiple IP addresses are configured for the physical interface that needs a BGP peer connection established with a remote interface, the peer connect-interface command must be run, with ipv4-source-address or ipv6-source-address set to the source IP address.
  • If two devices need multiple BGP peer connections established through different interfaces, the peer connect-interface command must be run for each BGP peer connection, with the source interface specified.

Prerequisites

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

Precautions

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

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 the IPv4 unicast address family.

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 configuring 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.

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 and a source address for initiating a connection.

<HUAWEI> system-view
[HUAWEI] bgp 100 
[HUAWEI-bgp] peer 10.16.2.3 as-number 100 
[HUAWEI-bgp] peer 10.16.2.3 connect-interface vlanif 100
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >