I have a lab EX-2200 that has a config on it that I now want to replicate onto four more EX-2200's... I'm sure there's probably an easy way to do this, but couldn't find it on the Juniper KB or by (a minimum amount of) Googling. Anyone here know?

  • I don't know what you're doing with them, but would a Virtual Chassis be more appropriate? – bahamat Dec 16 '13 at 7:15
  • No - these are going to be used for DMZs off a firewall; just trying to quickly put a base config on them. I am pleasantly surprised to see that even with the EX2200 you can do virtual chassis - Juniper rocks :) – Will Dennis Dec 17 '13 at 15:13

you can copy the configuration from the 'source' switch like this (assuming you've got a domestic software release supporting SSH):

show configuration | save user@otherswitch:myconfig

And then on 'otherswitch' in edit-mode:

load replace myconfig
  • That sounds great for config transfers to another switch that's already online, but this case is to configure a new blank switch from another configured switch's setup... Good to know tho! – Will Dennis Dec 12 '13 at 1:18

You can, of course, also in config mode just:

save somefilename

And then you move that file to the other switch someway, usign ftp, sftp, scp WinSCP, etc., to the other switch, where you

load replace somefilename

Another option is to just view the config in the normal way

show config

and then copy it in your client (clipboard). Then on the new switch, type

load patch terminal

and paste in the config there. Once done, press and .

  • 2
    Be aware that you can run into problems with pastebuffer sizes when pasting large configurations resulting in partially copied configurations. – Teun Vink Dec 11 '13 at 8:14
up vote 2 down vote accepted

I followed the directions in this Juniper document: http://kb.juniper.net/InfoCenter/index?page=content&id=KB12022

Briefly, I backed up the configured switch's config file to a USB key, and then mounted the USB key on the new switch, and did a load override /mnt/juniper.conf.gz as per the document's "restore" section. Worked like a champ!

You can use a script to share parts of the config quite easily.

I use the script share-data. You can create your config like this on the switch/router:

groups {
    juniper-distro {
        apply-macro share-data {
            device3;
            device2;
            device1;
        }
        system {
            domain-name mydomain.com;
            domain-search [ mydomain.com anotherdomain.com ];
...........................................
        }
    }
}
apply-groups [ juniper-distro ];
...........................................

You can then use the script to copy the group config to the other devices:

{master:1}
root@device1> op share-data group juniper-distro ?
Possible completions:
              Execute this command
                 Argument name
  database             Database for configuration ('candidate' or 'committed')
  detail               Display detailed output
  target               Target for transfer (one or space-delimited list)
  |                    Pipe through a command

This isn't very helpful for the initial config of the switch as you still need to be able to access it and be able to set the apply-group. The previous posters suggestion of scp the config file over would be my suggestion.

For four devices applying a default configuration by hand is a good option. However if you'd like to upgrade or downgrade and apply a default configuration to multiple devices then Zero Touch Provisioning (ZTP) might be a more convenient solution for Juniper hardware.

KB27327 has some good information regarding the process as well the Configuring Zero Touch Provisioning article.

Requires;

  • DHCP server which provides the location of the software image and configuration files on the network
  • Anonymous FTP, HTTP or TFTP server where the software image and configuration files are stored.
  • DNS
  • NTP (optional)
  • Syslog (optional)

Let us say that SWA has the config you want to copy and SWB is the new switch. Follow these steps to replicate the configs

  1. user@SWA>show configuration|display set
  2. copy the set commands from this display
  3. user@SWB#load set terminal
  4. Press Enter
  5. Right Click to paste the copied set commands
  6. Press ctrl-D
  7. Commit check
  8. Commit.

I do not think I saw anyone mention it, another piece of good knowledge to have are the two commands: commit confirm overwrite and commit confirm merge.

These two commands help with similar things the main difference being that
the commit confirm merge copies content from another configuration that contains data you want to integrate to your current candidate configuration. I generally copy it from notepad++ Or copy it out of the configuration with the copy button in secureCRT. This command does not overwrite any of your current configuration.

Commit confirm overwrite does as it sounds and overwrites the current configuration with the new configuration. A rollback would be necessary to revert from this operation.

Lastly, when committing any new configuration data, its always good practice to use the commit check command prior to confirming.

  • 1
    Although this is nice advice, this isn't an answer to the question. – Teun Vink Sep 14 '16 at 13:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.