request vmhost remote-file-copy
Syntax
request vmhost remote-file-copy interface { (in-band | out-of-band); } source source-path; destination destination-path;
Description
Enable remote file copy between the hypervisor and a remote fileserver. The configuration allows creating an external network interface directly on the hypervisor and associating an IPv4 address with it.
The remote file copy feature allows upload or download operations from or into the NFX device. These operations are initiated from the NFX device, not from the remote fileserver.
Options
-
in-band—Enable external network access through one of the front panel revenue ports.
-
out-of-band—Enable external network access through the front panel management interface.
-
source source-path—Name of the source path from which the file is to be copied. The source path should refer to a specific filename, not a directory, and without any wild cards. If the source-path is local, the file-copy is an upload operation. If the source-path is remote, the file-copy is a download operation.
-
destinationdestination-path—Name of the destination path to which the host file is copied. The destination path must refer to a specific filename.
Additional Information
Either source-path or destination-path must be remote while the other should be local. Consider the following guidelines while creating a local path:
-
Local path should refer to a file under /var/public/ directory.
-
Avoid special characters. You can include alphanumeric characters, hyphen, underscore, and dot.
-
Avoid relative path components .. and /./
-
Avoid ending the path with /.
Following are the examples of a local path:
-
/var/public/myfile
-
/var/public/mydir/my_file
-
/var/public/12-hours.data
Consider the following guidelines while creating a local path:
A remote path must be in the following format: [<remote_user>[:<remote_user_pwd>]@]<protocol>://<remote_ip>[:<remote_port>]:<remote_path>
The protocols supported are, SCP, HTTP, HTTPS, and FTP.-
remote_user
is optional, depending on protocol and the remote fileserver configuration.For example,
remote_user
is required when scp protocol is used whereasremote_user
is unnecessary when HTTP protocol is used. -
Depending on the protocol and the remote fileserver configuration, when
remote_user
is specified, you might have to specifyremote_user_pwd
.For example, when ftp is used, username and password are required.
-
remote_port
is optional and could be skipped if the remote fileserver is reachable on a standard port for the specified protocol.
Following are the examples of a remote path:
user@scp://10.10.10.2:22:/home/user/myfile user@scp://10.10.10.2:/home/user/myfile http://10.10.10.2:80:/myfile https://10.10.10.2:80:/myfile user:user@ftp://10.10.10.2:21:/home/user/myfile user@ftp://10.10.10.2:21:/home/user/myfile
Required Privilege Level
Maintenance
Sample Output
- request vmhost remote-file-copy (To upload a file from an NFX device to remote fileserver using an in-band interface and scp protocol, with user interaction)
- request vmhost remote-file-copy (To upload a file from an NFX device to remote fileserver using an out-of-band interface and scp protocol, with user interaction)
- request vmhost remote-file-copy (To download a file from the remote fileserver to an NFX device using an in-band interface and http protocol)
- request vmhost remote-file-copy (To download a file from the remote fileserver to an NFX device using an in-band interface and https protocol)
- request vmhost remote-file-copy (To upload a file from an NFX device to the remote fileserver using an in-of-band interface and ftp protocol, with user interaction)
- request vmhost remote-file-copy (To upload a file from an NFX device to the remote fileserver using an in-band interface and ftp protocol, without user interaction)
request vmhost remote-file-copy (To upload a file from an NFX device to remote fileserver using an in-band interface and scp protocol, with user interaction)
user@host> request vmhost remote-file-copy interface in-band source /var/public/1G.dat destination root@scp://10.10.10.11:22:/var/www/html/1G.dat The authenticity of host '10.10.10.11 (10.10.10.11)' can't be established. ECDSA key fingerprint is SHA256:1ldwJbrMb47DBsf+wwG4W06a00yfXt9hAS6ozIVAPVc. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '10.10.10.11' (ECDSA) to the list of known hosts. user@host@10.10.10.11's password: 1G.dat 100% 1024MB 42.8MB/s 00:23
request vmhost remote-file-copy (To upload a file from an NFX device to remote fileserver using an out-of-band interface and scp protocol, with user interaction)
user@host> request vmhost remote-file-copy interface out-of-band source /var/public/1G.dat destination root@scp://10.204.103.43:22:/var/www/html/1G.dat user@host@10.204.103.43's password: 1G.dat 100% 1024MB 34.9MB/s 00:29
request vmhost remote-file-copy (To download a file from the remote fileserver to an NFX device using an in-band interface and http protocol)
user@host> request vmhost remote-file-copy interface in-band source http://10.10.10.11:80:/1G.dat destination /var/public/1G.dat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1024M 100 1024M 0 0 77.5M 0 0:00:13 0:00:13 --:--:-- 75.0M
request vmhost remote-file-copy (To download a file from the remote fileserver to an NFX device using an in-band interface and https protocol)
user@nhost> request vmhost remote-file-copy interface in-band source https://10.10.10.11:/1G.dat destination /var/public/1G.dat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1024M 100 1024M 0 0 22.9M 0 0:00:44 0:00:44 --:--:-- 23.4M
request vmhost remote-file-copy (To upload a file from an NFX device to the remote fileserver using an in-of-band interface and ftp protocol, with user interaction)
user@host> request vmhost remote-file-copy interface in-band source /var/public/1G.dat destination user1@ftp://10.10.10.11:21:/home/user1/1G.dat Enter host password for user 'user1': % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1024M 0 0 100 1024M 0 105M 0:00:09 0:00:09 --:--:-- 110M
request vmhost remote-file-copy (To upload a file from an NFX device to the remote fileserver using an in-band interface and ftp protocol, without user interaction)
user@host> request vmhost remote-file-copy interface in-band source /var/public/1G.dat destination user1:user1@ftp://10.10.10.11:21:/home/user1/1G.dat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1024M 0 0 100 1024M 0 106M 0:00:09 0:00:09 --:--:-- 111M
Release Information
Command introduced in Junos OS Release 24.2R1 for NFX150, NFX250, and NFX350 devices.