EdgeRouter - Copy and Replace Configuration Sections
Overview
Readers will learn how to display the configuration in the set...command 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.
Displaying and Modifying the Configuration
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 modified configuration, replacing eth1 with eth2.
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
EdgeRouter - Configuration and Operational Mode
EdgeRouter - Access the CLI from the Web UI
Intro to Networking - How to Establish a Connection Using SSH