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.
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. |
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:
<HUAWEI> system-view [~HUAWEI] interface LoopBack 0 [*HUAWEI-LoopBack0] ip address 10.1.1.1 32 [*HUAWEI-LoopBack0] quit [*HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-instance-vpna] quit [*HUAWEI] bgp 100 instance a [*HUAWEI-bgp-instance-a] ipv4-family vpn-instance vpna [*HUAWEI-bgp-instance-a-vpna] peer 10.1.1.1 as-number 100 [*HUAWEI-bgp-instance-a-vpna] peer 10.1.1.1 connect-interface LoopBack 0