R3721-F3210-F3171-HP High-End Firewalls System Management and Maintenance Configuration Guide-6PW101

195
Establishing an FTP connection
Before you can access the FTP server, you must establish a connection from the FTP client to the FTP server.
You can either use the ftp command to establish the connection directly or use the open command in FTP
client view to establish the connection.
When using the ftp or ftp client source command, you can specify the source interface (such as a
loopback interface) or source IP address. The primary IP address of the specified source interface or the
specified source IP address is used as the source IP address of sent FTP packets.
The FTP client follows these rules to select the source IP address of packets sent to the FTP server:
If no source IP address is specified, the IP address of the output interface of the route to the server
is used as the source IP address.
The source IP address specified with the ftp client source or ftp command is used.
If you first use the ftp client source command to specify a source IP address and then use the ftp
command to specify another source IP address, the latter is used.
The source IP address specified with the ftp client source command applies to all FTP connections
while the one specified with the ftp command applies to the current FTP connection only.
To establish an IPv4 FTP connection:
Ste
p
Command
Remarks
1. Enter system view. system-view N/A
2. Specify the source IP
address of sent FTP
packets.
ftp client source { interface interface-type
interface-number | ip source-ip-address }
Optional.
By default, the source IP
address is determined by the
route from the FTP client to the
FTP server.
3. Return to user view. quit N/A
4. Log in to the remote
FTP server.
(Approach 1) Log in to the FTP server in user
view:
ftp [ server-address [ service-port ]
[ vpn-instance vpn-instance-name ] [ source
{ interface interface-type interface-number
| ip source-ip-address } ] ]
(Approach 2) Log in to the FTP server in FTP
client view:
a. ftp
b. open server-address [ service-port ]
Use either approach.
NOTE:
If no primary IP address is configured on the specified source interface, you cannot establish an FTP
connection.
If you use the ftp client source command to confi
g
ure a source interface and then use it to confi
g
ure a
source IP address, the source IP address overwrites the source interface, and vice versa.
To establish an IPv6 FTP connection: