EdgeRouter - Copy and Replace Configuration Sections


Overview


Readers will learn how to display the configuration in the 'set' format, which allows administrators to easily copy and replace sections of the config. This method can also be used to copy over certain parts of a configuration to another EdgeRouter.

NOTES & REQUIREMENTS:
Applicable to the latest EdgeOS firmware on all EdgeRouter models. Please see the Related Articles below for more information.
 
Device used in this article:

Using the Show Configuration Commands


Back to Top

CLI: Access the command line interface (CLI). You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Run the following command from operational mode

show configuration commands | no-more

2. Copy the relevant parts of the configuration to a text editor. For example, if we want to move the VIF interfaces under eth1 to eth2.

show configuration commands | no-more
...
set interfaces ethernet eth1 vif 10 address 10.0.10.1/24
set interfaces ethernet eth1 vif 10 description VLAN10

set interfaces ethernet eth1 vif 20 address 10.0.20.1/24
set interfaces ethernet eth1 vif 20 description VLAN20

3. Enter configuration mode.

configure

4. Delete the configuration sections that you want to replace.

delete interfaces ethernet eth1 vif 10
delete interfaces ethernet eth1 vif 20

5. Add the new configuration.

set interfaces ethernet eth2 vif 10 address 10.0.10.1/24
set interfaces ethernet eth2 vif 10 description VLAN10

set interfaces ethernet eth2 vif 20 address 10.0.20.1/24
set interfaces ethernet eth2 vif 20 description VLAN20

6. Compare the differences between the old and the new configuration.

compare

7. Commit the changes and save the configuration.

commit ; save

Related Articles


Back to Top

Intro to Networking - How to Establish a Connection Using SSH

EdgeRouter - Configuration and Operational Mode


We're sorry to hear that!