Specifying the source address of TCP connections

By default, BGP uses the primary IPv4/IPv6 address of the output interface in the optimal route to a peer or peer group as the source address of TCP connections to the peer or peer group.

Change the source address in the following scenarios:

To specify the source address of 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 IPv4 address of TCP connections to a peer or peer group.

peer ipv4-address [ mask-length ] source-address source-ipv4-address

peer group-name source-address source-ipv4-address

The peer source-address command is available in Release 1121 and later.

By default, BGP uses the primary IPv4 address of the output interface in the optimal route to a peer or peer group as the source address of TCP connections to the peer or peer group.

4. Specify the source interface of TCP connections to a peer or peer group.

peer { group-name | ip-address [ mask-length ] } connect-interface interface-type interface-number

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 IPv6 address of TCP connections to a peer or peer group.

peer ipv6-address [ prefix-length ] source-address source-ipv6-address

peer group-name source-address source-ipv6-address

The peer source-address command is available in Release 1121 and later.

By default, BGP uses the primary IPv6 address of the output interface in the optimal route to a peer or peer group as the source address of TCP connections to the peer or peer group.

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

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