Specifying a source IP address or source interface for the SFTP client

When an SFTP client accesses the SFTP server, the SFTP client uses the IP address of the outbound interface as the source IP address by default. The SFTP client determines the outbound interface based on the routing table lookup. You can change the source IP address or specify a source interface for the client.

Hewlett Packard Enterprise recommends that you specify a loopback interface as the source interface for the SFTP client for the following purposes:

To specify a source IP address or interface for the SFTP client:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Specify a source IP address or interface for the SFTP client.

  • Specify a source IPv4 address or interface for the SFTP client:sftp client source { interface interface-type interface-number | ip ip-address }

  • Specify a source IPv6 address or interface for the SFTP client:sftp client ipv6 source { interface interface-type interface-number | ipv6 ipv6-address }

Use either command.