You are here
Home > Firewall > Save Load Modify

Save Load Modify

How do you Saving, Modifying, and Loading Configuration Files

The JUNOS CLI provides tools that give you the option to save, modify, and load configuration files to and from different locations.

Files can be uploaded and downloaded from an FTP server or stored locally on the router . The files can be saved in whole or in part.

The JUNOS CLI also offers some useful tools for modifying and annotating the configuration files.

Saving Configuration Files

As in the operational mode, in configuration mode you can display the configuration and use the <save | > option to save the configuration to the router or to an FTP server.

You do this with the save command.

[edit]

root@sysadmin# savetestfile

Wrote 103 lines of configuration to 'sysadminfile’

Here the file is saved to an FTP server:

[edit]

root@sysadmin# save ftp://10.10.10.20/sysadminfile

Modifying Configuration Files

When working in the CLI, you have the ability to annotate, copy, delete, rename, and insert configuration changes on a per-line or per-command basis.

In addition to these editing features, you also have the ability to deactivate and activate specific sections of the configuration.

This feature is especially useful for testing and for making changes ahead of time that may be enabled during a scheduled maintenance window. The following commands are arranged in logical order .

Annotate

The annotate feature lets you store a note in the configuration. This annotation is a way to describe a section of the configuration.

[editsystem login]

root@sysadmin# annotateuser <user name>< annotate name >

root@sysadmin# annotateuser sysadminSuperUser

/* SuperUser */

usersysadmin {

uid 2006;

classadminclass;

}

The copy feature can be quite useful. If you need to add many users, instead of typing each one in individually, you could use the copy command to create new entries.

[edit]

root@sysadmin# copy system login user sysadmin to user systemuser

delete

[edit]

root@sysadmin# delete user sysadminSuperUser

rename

The rename parameter does exactly that—it allows you to change the name of a particular parameter without having to delete it. The example below renames the user labcopy to labcopy2:

[edit system login]

root@sysadmin# rename user labcopy to user labcopy2

root@sysadmin# rename user sysadmin to user smartadmin

insert

[edit policy-options policy-statement sample]

root@sysadmin # show

policy 1 {

from protocol static;

then accept;

}

policy2 {

from protocol bgp;

then accept;

}

policy 3 {

from protocol ospf;

then accept;

}

root@sysadmin# insertpolicy 3 before policy 2

[edit policy-options policy-statement sample]

root@sysadmin# show

policy 1 {

from protocol static;

then accept;

}

policy 3 {

from protocol ospf;

then accept;

}

policy 2 {

from protocol bgp;

then accept;

}
 

Leave a Reply

one × 2 =

Top