Specifying the source interface for TCP connections

By default, BGP uses the output interface of the optimal route to a peer or peer group as the source interface for establishing TCP connections to the peer or peer group, and it uses the IP address/IPv6 address of the output interface as the source IP address/IPv6 address of TCP connections. You can change the source interface in the following scenarios:

To specify the source interface for TCP connections (IPv4):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP view or BGP-VPN instance view.

  • Enter BGP view:bgp as-number

  • Enter BGP-VPN instance view:

    1. bgp as-number

    2. ip vpn-instance vpn-instance-name

N/A

3. Specify the source interface for establishing TCP connections to a peer or peer group.

peer { group-name | ip-address } connect-interface interface-type interface-number

By default, BGP uses the outbound interface of the best route to the BGP peer or peer group as the source interface for establishing a TCP connection to the peer or peer group.

To specify the source interface for TCP connections (IPv6):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP view or BGP-VPN instance view.

  • Enter BGP view:bgp as-number

  • Enter BGP-VPN instance view:

    1. bgp as-number

    2. ip vpn-instance vpn-instance-name

N/A

3. Specify the source interface for establishing TCP connections to a peer or peer group.

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

By default, BGP uses the outbound interface of the best route to the BGP peer or peer group as the source interface for establishing a TCP connection to the peer or peer group.