Description

This article describes various methods used to add the configuration on formatted / newly deployed switches. 

Solution

  • When we receive a new switch or the switch is formatted, the switch loads with the default configuration. 

  • There are 2 ways one can load the already available / existing configuration on the switch. 

  • If the config is saved in the form of set commands, then the set commands can be directly loaded on switch via the terminal. 

Please follow the below steps for the same:

{master:0}
root@lab> edit
Entering configuration mode
  • Delete the default config that is available on the switch and do not commit 

{master:0}[edit]
root@lab# delete
This will delete the entire configuration
Delete everything under this level? [yes,no] (no) yes
  • Post all the default config is deleted, run the below command to load the config

{master:0}[edit]
root@lab# load set terminal
[Type ^D at a new line to end input]
  • Paste the set command and press control+D to complete the loading of the config and hit the commit option to complete the installation. 

  • Second method is using the same set commands but saving it in .txt file and loading the config file on the switch. The configuration of the device can be saved with the following command:

root@lab# show | display set | no-more | save /var/tmp/config.txt
  • To check that the file is created, the following command is used:

{master:0}
root@lab> file list /var/tmp/

/var/tmp/:
.snap/
LOCK_FILE*
config.txt >>>>> configuration is created.
  • Then this file can be saved in a USB or into a PC using FTP.

  • Once the file is transfer to another device in the /var/tmp directory, we can use the following command to load it and commit the configuration.

root@lab# load override /var/tmp/config.txt
  • Third method is adding the config which is saved as hierarchical format in {} brackets using the override option. Please use below command to load the configuration which is saved in hierarchical format and then commit the configuration.

root@lab# load override terminal 

For more details on the keywords used to push the configuration, you can refer the below documentation.

https://www.juniper.net/documentation/us/en/software/junos/cli/topics/topic-map/junos-config-files-loading.html

Modification History

20-04-2024: Validated the article.

Related Information

https://www.juniper.net/documentation/us/en/software/junos/cli/topics/topic-map/junos-config-files-loading.html