Specifying the source IP address for SFTP packets

As a best practice, specify the IP address of the loopback interface as the source address of SFTP packets for the following purposes:

To specify the source IP address for SFTP packets:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Specify the source address for SFTP packets.

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

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

By default, the source IP address for SFTP packets is not configured. For IPv4 SFTP packets, the device uses the primary IPv4 address of the output interface specified in the routing entry as the source address of the packets. For IPv6 SFTP packets, the device automatically selects an IPv6 address as the source address of the packets in compliance with RFC 3484.