[ Pobierz całość w formacie PDF ]
.210.1.0/242.Use the show command to verify that the se interface was added to the configuration (In thefollowing example, only the added statements are shown; your configuration file should havemore data than shown):[edit]mike@juniper1# showinterfaces {se-1/0/0 {unit 0 {family inet {address 10.210.1.0/24;}}}}}3.Delete the interface using the following delete command:[edit]mike@juniper1# delete interfaces se-1/0/04.Use the show command to verify that the se interface is now removed from yourconfiguration file. 48 Day One: Exploring the JUNOS CLIMORE? When you need to remove large common pieces of the configurationfrom the device, wildcards can save you time.The device can searchthrough the entire candidate configuration looking for a string anddelete every line that contains that string.To learn more about wild-cards, go to the online JUNOS Software CLI User Guide at www.juniper.net/techpubs/ and refer to the section on Advanced Features.The Annotate CommandThe JUNOS CLI lets you leave comments about the configuration as apart of its listing.The comments can be quite handy when you or otherteam members are trying to troubleshoot a problem or need to makeconfiguration changes.Issue the annotate command followed by yournote when you want to include comments:[edit]mike@juniper1# annotate system this device is for training newJUNOS usersWhen you add comments in configuration mode, they are associatedwith a statement at the current level.Each statement can have onesingle-line comment associated with it.To delete a comment, use theannotate command with an empty string:[edit]mike@juniper1# annotate system ""Committing the Candidate ConfigurationThe JUNOS CLI provides multiple features that help users to catch andcorrect typos, omissions, and other errors before they become a prob-lem.In addition to candidate configurations, these features includeproviding file comparisons, checking candidate syntax and context,enabling fast rollback, and restoring working configurations onsystems that become isolated after activation of a new configuration.Figure 4.2 provides a detailed view of the file management of thedevice configuration.The active (running) configuration is the opera-tional file of the device.It is also the configuration that the deviceloads during a boot sequence.The candidate configuration is theworking copy storing configuration updates.The commit commandscause the following transitions by the device (for candidates whichpass the validation checks): Chapter 4: Discovering Configuration Mode 491.Copies the candidate configuration to the active configuration.At this point, the active and the candidate configurations areidentical.2.Decrements all rollback configuration files by one and saves the ac-tive configuration as rollback 0.textfile rollback scp or ftp save loadactiveVersions 4 to 49 commitheld in (running) candidatehistoric/var/db/configconfig configconfigon hard diskCLI or client(rollback 0)(rollback 1)v2 application system archivev3Versions 0 to 3 on commit or everyv4held in /config minuteson hard diskv 49 Send SNMPtrap/syslog event oncommit, or run commit Network Managementor event scriptSystemFigure 4.2 JUNOS Configuration File ManagementThe active (running) configuration file and the last three rollbackconfiguration files are saved in the /config directory.The device savesthe remainder of the archived configuration files in the /var/db/configdirectory.NOTE The active configuration file is named juniper.conf.gz, and therollback configuration files are named from juniper.conf.1.gz tojuniper.conf.49.gz (providing an archive of 50 active configurations). 50 Day One: Exploring the JUNOS CLIThe Compare CommandConfiguration mode conveniently provides a way to display theconfigured differences between two configurations with the show |compare command.The following example modifies a candidate configuration by enablingTelnet access and removing SSH and J-Web access:[edit system]mike@juniper1# set services telnet[edit system]mike@juniper1# delete services web-management[edit system]mike@juniper1# delete services sshNow display the resulting changes in the candidate compared to theactive configuration:[edit system services]mike@juniper1# show | compare- ssh;+ telnet;- web-management {- http {- port 8080;- }- }The command interface indicates new lines in the candidate with a plus(+) sign and those removed with a minus (-) sign.SHORT CUT The operational mode command show configuration displays thecurrent active (running) configuration.You can perform this commandin configuration mode by adding the keyword run:[edit]mike@juniper1# run show configurationThe Commit Check CommandThe CLI also provides a command to check that the system can processyour candidate configuration.The commit check command validatesthe logic and completeness of the candidate without activating any Chapter 4: Discovering Configuration Mode 51changes.These are the same validations that run when you commit acandidate.If the system finds a problem in the candidate configuration,it lets you know:[edit]mike@juniper1# commit check[edit interfaces lo0 unit 0 family inet]'address 192.168.69.1/24'Loopback addresses' prefix must be 32 bitserror: configuration check-out failedBEST PRACTICE Before activating a candidate as the running configuration, alwayscheck your work.Use the show | compare command to ensure all ofthe expected configuration elements and parameters are a part of thecandidate.Enter the commit check command to have the systemvalidate your candidate configuration without activating the changes.The Commit CommandThe candidate file is only the proposed configuration, and your devicedoes not use any of this configuration until you issue a commit com-mand.After you have entered all desired changes and you have double-checked your work, you are ready to activate your candidate as theactive (running) configuration.To activate the candidate configuration, enter the commit command:[edit]mike@juniper1# commitcommit completeBefore actually activating the candidate configuration, JUNOS Soft-ware checks basic syntax and semantics.For example, the softwaremakes sure that a policy has been defined before it is referenced
[ Pobierz całość w formacie PDF ]