No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Configuration Guide - Basic Configuration

S7700 and S9700 V200R010C00

This document describes methods to use command line interface and to log in to the device, file operations, and system startup configurations.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Managing Files When the Device Functions as an FTP Client

Managing Files When the Device Functions as an FTP Client

Pre-configuration Tasks

Before connecting to a device as an FTP client to manage files, complete the following tasks:

  • Ensure that routes are reachable between the current device and the FTP server.
  • Obtain the host name or IP address of the FTP server, FTP user name, and password.
  • Obtain the listening port number of the FTP server if the default listening port number is not used.

Configuration Process

The FTP protocol brings security risks. The SFTPv2, SCP, or FTPS mode is recommended.

Table 7-36 describes the procedure for managing files when the device functions as an FTP client.

Table 7-36  Procedure for managing files when the device functions as an FTP client
No. Task Description Remarks
1 (Optional) Configure the FTP client source address

Configure the FTP client source address. To ensure communication security, the source address can be set to a source IP address or source interface.

Perform steps 1 and 2 in sequence. After the FTP connection is established, perform steps 3 and 4 in any sequence. To disconnect from the FTP server, perform step 5.
2 Run FTP commands to connect to the FTP server

-

3 Run FTP commands to perform file-related operations

Run FTP commands to perform file-related operations including performing operations on directories and files, configuring the file transfer mode, and viewing the online help about FTP commands.

4 (Optional) Change the login user

-

5 Disconnect the FTP client from the FTP server

-

Procedure

  • (Optional) Configure the FTP client source address.

    When specifying the source address in an ACL, use the address of an interface in stable state, such as a loopback interface. This simplifies the ACL rule and security policy configuration. After the client source address is configured as the source or destination address in the ACL rule, IP address differences and interface status impacts are shielded, and incoming and outgoing packets are filtered.

    The FTP client source address must be set to the loopback interface IP address or loopback interface.

    Table 7-37  Configuring the FTP client source address
    Operation Command Description
    Enter the system view. system-view -
    Configure the FTP client source address. ftp client-source { -a source-ip-address | -i interface-type interface-number }

    You are advised to use the loopback interface IP address.

    When the FTP client source address is set to loopback interface, configure an IP address for the loopback interface for establishing FTP connections.

  • Run FTP commands to connect to the FTP server.

    Run the appropriate command in the user view or FTP client view to connect to the FTP server.

    Perform the following operations based on the server IP address types.

    Table 7-38  Running FTP commands to connect to the FTP server (with an IPv4 address)
    Operation Command Description

    Connect to the FTP server in the user view when the server uses an IPv4 address.

    ftp [ -a source-ip-address | -i interface-type interface-number ] host-ip [ port-number ] [ public-net | vpn-instance vpn-instance-name ]

    Select one of them.

    To enter the FTP client view, run the ftp command.

    Connect to the FTP server in the FTP client view when the server uses an IPv4 address.

    ftp
    open [ -a source-ip-address | -i interface-type interface-number ] host-ip [ port-number ] [ public-net | vpn-instance vpn-instance-name ]
    NOTE:
    • Before connecting to the FTP server, run the set net-manager vpn-instance command to set the VPN instance to the default VPN instance.

    • The source address specified in the ftp command has a higher priority than that specified in the ftp client-source command on an IPv4 network. If you specify different source addresses in the ftp client-source and ftp commands, the source address specified in the ftp command takes effect. The source address specified in the ftp client-source command applies to all TFTP connections. The source address specified in the ftp command applies only to the current TFTP connection.

    Table 7-39  Running FTP commands to connect to the FTP server (with an IPv6 address)
    Operation Command Description

    Connect to the FTP server in the user view when the server uses an IPv6 address.

    ftp ipv6 host-ipv6 [ port-number ]

    Select one of them.

    To enter the FTP client view, run the ftp command.

    Connect to the FTP server in the FTP client view when the server uses an IPv6 address.

    ftp
    open ipv6 host-ipv6 [ port-number ]

    Users must enter the correct user name and password to connect to the server.

  • Run FTP commands to perform file-related operations.

    After connecting to the FTP server, users can run FTP commands to perform file-related operations including performing operations on directories and files, configuring the file transfer mode, and viewing the online help about FTP commands.

    NOTE:

    User rights are configured on the FTP server.

    The file system has a restriction on the number of files in the root directory. Therefore, if more than 50 files exist in the root directory, creating new files in this directory may fail.

    Users can perform the following operations in any sequence.

    Table 7-40  Running FTP commands to perform file-related operations
    Operation Command Description
    Change the working directory on the server. cd remote-directory -
    Change the current working directory to its parent directory. cdup -
    Display the working directory on the server. pwd -
    Display or change the local working directory. lcd [ local-directory ]

    The lcd command displays the local working directory on the client, and the pwd command displays the working directory on the remote server.

    Create a directory on the server. mkdir remote-directory

    The directory name can consist of letters and digits. The following special characters are not supported: < > ? \ :

    Delete a directory from the server. rmdir remote-directory -
    Display information about the specified directory or file on the server. dir/ls [ remote-filename [ local-filename ] ]
    • The ls command displays only the directory or file name, and the dir command displays detailed directory or file information such as name, size, and date when the directory or file is created.
    • If no directory is specified in the command, the system searches for the file in user's authorized directories.
    Delete a file from the server. delete remote-filename -

    Upload one or more files.

    put local-filename [ remote-filename ]

    Or

    mput local-filenames

    • To upload a file, run the put command.
    • To upload multiple files, run the mput command.

    Download one or more files.

    get remote-filename [ local-filename ]

    Or

    mget remote-filenames

    • To download a file, run the get command.
    • To download multiple files, run the mget command.
    Set the file transfer mode to ASCII or Binary. ascii

    Or

    binary

    Select one of them.

    • The default file transfer mode is ASCII.

    • The ASCII mode is used to transfer text files, and the binary mode is used to transfer programs, system software(such as files with name extension .cc, .bin, and .pat.), and database files.

    Set the data transmission mode to passive or active. passive

    Or

    undo passive

    Select one of them.

    The default data transmission mode is active.

    View the online help about FTP commands. remotehelp [ command ] -
    Enable the system prompt function. prompt By default, the prompt function is disabled.
    Enable the verbose function. verbose

    After the verbose function is enabled, all FTP response messages are displayed on the FTP client.

  • (Optional) Change the login user.

    The current user can switch to another user in the FTP client view. The new FTP connection is the same as that established by running the ftp command.

    Operation Command Description

    Change the current user in the FTP client view.

    user user-name [ password ]

    When the login user is switched to another user, the original user is disconnected from the FTP server.

  • Disconnect the FTP client from the FTP server.

    Users can run different commands in the FTP client view to disconnect the FTP client from the FTP server.

    Operation Command Description

    Disconnect the FTP client from the FTP server and return to the user view.

    bye or quit Select one of them.

    Disconnect the FTP client from the FTP server and return to the FTP client view.

    close or disconnect

Checking the Configurations

  • Run the display ftp-client command to check source interface of the FTP client.
Translation
Download
Updated: 2019-04-18

Document ID: EDOC1000141895

Views: 51811

Downloads: 210

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next