Copy a File on a Routing Engine
Purpose
When you configure one Routing Engine and another Routing Engine needs to have a similar configuration, or when you upgrade the Junos OS version on one Routing Engine, you can simplify the process by copying files from one Routing Engine to another.
To copy a file, follow these steps:
- Copy a File from One Routing Engine to Another
- Copy Files between the Local Router and a Remote System
Copy a File from One Routing Engine to Another
Purpose
When you have a dual Routing Engine configuration, you can copy a configuration file from Routing Engine 0 to Routing Engine 1 or vice versa.
Action
To copy a configuration file from Routing Engine 0 to Routing Engine 1, use the following Junos OS command-line interface (CLI) operational mode command:
Sample Output
user@host> file copy /config/juniper.conf
re1:/var/tmp/copied-juniper.conf Meaning
In this case, source is the name of the configuration file on Routing Engine 0. Configuration files are stored in the directory /config. The active configuration is /config/juniper.conf, and older configurations are in /config/juniper.conf {1...9 }. destination is a file on Routing Engine 1.
![]() | Note: Refer to Maintain a Single Configuration File for Both Routing Engines for details about naming the Routing Engines correctly. |
Copy Files between the Local Router and a Remote System
Action
You can copy a configuration file from a Routing Engine to a remote system in the network using the File Transfer Protocol (FTP) or secure copy protocol (scp) in any one of the following ways:
- To use anonymous FTP to copy a local file to a remote
system, enter the following command:root@host> file copy filename ftp://hostname/filename
In the following example, /config/juniper.conf is the local file and hostname is the FTP server:
root@host> file copy /config/juniper.confftp://hostname/juniper.confReceiving ftp: //hostname/juniper.conf (2198 bytes): 100% 2198 bytes transferred in 0.0 seconds (2.69 MBps)
- To use FTP where a valid username and password are required,
enter the following command:root@host> file copy filename ftp://user:password@hostname/filename
In the following example, /config/juniper.conf is the local file, user is the username, testing123 is the password, and hostname is the FTP server:
root@host> file copy /config/juniper.conf ftp://user:testing123@hostname/juniper.conf Receiving ftp: //user:testing123@hostname/juniper.conf (2198 bytes): 100% 2198 bytes transferred in 0.0 seconds (2.69 MBps)
- To use FTP where you require more privacy and are prompted
for a password, enter the following command:root@host> file copy filename ftp://user@hostname/filename
In the following example, /config/juniper.conf is the local file, user is the username, and hostname is the FTP server:
root@host> file copy /config/juniper.conf ftp://user@hostname/juniper.conf Password for user@hostname: ****** Receiving ftp: //user@hostname/juniper.conf (2198 bytes): 100% 2198 bytes transferred in 0.0 seconds (2.69 MBps)
- To use scp to copy a local file to a remote system, enter
the following command:root@host> file copy filename scp://user@hostname/path/filename
In the following example, /config/juniper.conf is the local file, user is the username, and ssh-host is the scp server:
root@host> file copy /config/juniper.conf scp://user@ssh-host/tmp/juniper.conf user@ssh-host's password: ****** juniper.conf 100% |*********************************************************************************| 2198 00:00
![]() | Note: You cannot use scp or ssh to copy a file in the worldwide version of the Junos OS. |
Hide Navigation Pane
Show Navigation Pane
SHA1
