Load a Configuration from a File To a Router
Purpose
You can create a file, copy the file to the local router, and then load the file into the CLI. After you have loaded the file, you can commit it to activate the configuration on the router, or you can edit the configuration interactively using the CLI and commit it at a later time.
Action
To load a configuration from a file, follow these steps:
- Create the configuration in a file using a text editor such as Notepad, making sure that the syntax of the configuration file is correct. See JUNOS Internet Software Protocols, Class of Service, Chassis, and Management Command Reference, for information about testing the syntax of a configuration file.
- In the text file, use an option to perform the required action. The following table lists and describes some options. For an example of a text file, see "What It Means."
Table 12: Options for the load Command
- Enter
Ctrl+ato select all the text, andCtrl+cto copy the contents of the text file to the clipboard.- On the router, enter configuration mode:
user@host>cli[edit]user@host#- Load the configuration file:
user@host> load merge terminal- At the prompt, paste the contents of the clipboard using the mouse and the paste icon.
[edit]user@host#load merge terminal[Type ^D at a new line to end input]>Paste the contents of the clipboard here<- Hit
Enter.- Enter
Ctrl+d.- Commit the configuration to activate it on the router, or you can edit the configuration interactively using the CLI and commit it at a later time.
Sample Output
The following is an example of a text file with the
replaceoption:interfaces {replace:so-0/0/0 {unit 0 {family inet {address 10.1.34.1/30;}}}protocols {replace:isis {interface so-0/0/1.0 {level 1 metric 10;level 2 disable;}interface fxp0.0 {disable;}interface lo0.0;}}The following output is for Step 4 through Step 8:
[edit]user@R1#load merge terminal[Type ^D at a new line to end input]interfaces {replace:so-0/0/0 {unit 0 {family inet {address 10.1.34.1/30;}}}protocols {replace:isis {interface so-0/0/1.0 {level 1 metric 10;level 2 disable;}interface fxp0.0 {disable;}interface lo0.0;}}load completeWhat It Means
The sample output shows a configuration loaded from a text file with the
replaceoption. For more information about loading a configuration, see the JUNOS System Basics Configuration Guide.