Juniper – configuration basics.

By | 25.05.2019

Short article about juniper configuration basics. This can be helpful for network engineers who are new to Juniper.

On Junos, the configuration is stored in a shared database called a shared or global configuration database.
When editing the config, a candidate configuration is created, which after editing and checking for errors is applied as a working one.
The configuration can be edited at the same time by up to 32 users.

Configuration modes.

There are 3 configuration modes:

-configure
In this mode, everyone can edit config at the same time.
When configuration is committed by any user, all changes are applied.
If several users have changed same data, the latest changes will be applied.

-configure exclusive
Exclusive configuration. Other users cannot change anything.

-configure private
Each user can make changes independently.
If someone made changes during the configuration, you need to use the “update” command to renew the current version of the shared config database.

Commiting configuration.

After you have done changes in the configuration, to apply it, you need run command:

rtr3-msk# commit 

Also, before commit, you can check the configuration for errors:

rtr3-msk# commit check
configuration check succeeds

View the changes made before committing:

rtr3-msk# show | compare 

You can add a comment to commit:

rtr3-msk# commit comment "adding as-path prepend to peer"

For delayed commit, for example, at 14-00, you can use timer:

rtr3-msk# commit at 14:00:00

To cancel scheduled commit:

rtr3-msk> clear system commit
Pending commit cleared

To check changes in pending commit:

rtr3-msk> start shell
% su
Password:
root@rtr3-msk:/var/home/remote # cd /config/
root@rtr3-msk:/config #zcat juniper.conf.gz > 0 ; zcat juniper.conf+.gz > 1 ; diff -rupP 0 1 ; rm 0 1
--- 0   2021-10-14 13:14:24.523453000 +0300
+++ 1   2021-10-14 13:14:24.529945000 +0300
@@ -1,4 +1,4 @@
-## Last changed: 2021-10-13 13:40:41 +03
+## Last changed: 2021-10-14 13:02:59 +03
 version 19.4R3-S3.3;
 system {
     host-name rtr3-msk;
@@ -8,7 +8,7 @@ system {
     commit synchronize;
     login {
         class remote {
-            idle-timeout 30;
+            idle-timeout 28;
             permissions all;
         }
root@rtr3-msk:/config # exit
exit
% exit
exit

{master}
@rtr3-msk> 

To test configuration, if you are not sure in results, you can use the automatic rollback function with the specified interval. In this case, the config will be canceled and rolled back after 5 minutes, if it is not confirmed by the commit command.

rtr3-msk# commit confirmed 5

Rollback configuration and comparison.

To rollback the configuration, you can use the rollback functionality. Junos stores the last 49 changes.

rtr3-msk> show system commit 
0   2019-05-25 15:41:17 GMT-3 by root via cli commit synchronize
1   2019-05-25 15:36:45 GMT-3 by root via cli commit synchronize
2   2019-05-25 15:30:43 GMT-3 by root via cli commit synchronize
3   2019-05-25 14:23:45 GMT-3 by root via cli commit synchronize

You can roll back the configuration to any aviable point.

rtr3-msk# rollback 3
load complete

You can also compare any rollback point to other rollback point.
For example, to compare the current configuration and rollback 3:

rtr3-msk> show configuration | compare rollback 3   

To compare rollback 3 and rollback 5:

rtr3-msk> show system rollback compare 3 5

Subscribe
Notify of

0 комментариев
Inline Feedbacks
View all comments