28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Discussion</strong><br />

It is generally good practice to include comments in the configuration to clarify what<br />

is included for others who read the configuration. You can add comments for statements<br />

at the current hierarchy level in the configuration. In this recipe, we add a<br />

comment for the area statement at the [edit protocols ospf] level. The comment<br />

appears immediately before the statement.<br />

To delete a comment, use the annotate command with an empty string:<br />

[edit protocols ospf]<br />

aviva@router1# annotate area 0.0.0.0 ""<br />

1.6 Checking the Syntax of the Configuration<br />

Problem<br />

You want to check the syntax of your configuration to make sure there are no errors<br />

or missing statements.<br />

Solution<br />

Check the syntax of the configuration:<br />

[edit]<br />

aviva@router1# commit check<br />

configuration check succeeds<br />

[edit]<br />

aviva@router1#<br />

<strong>Discussion</strong><br />

As you are configuring the router, if you mistype a JUNOS configuration statement<br />

or command, the CLI gives you immediate feedback and pesters you until you type it<br />

correctly. However, this does not guarantee that you have spelled all variable names<br />

correctly or that you haven’t omitted any required statements. Use the commit check<br />

command from time to time to check the syntax of the configuration. This command<br />

only checks the syntax; it does not activate the configuration.<br />

If the syntax has no errors, you see the message configuration check succeeds.<br />

If you have made any mistakes in the configuration, a message reports where in the<br />

configuration hierarchy the mistake is and describes the problem. The following<br />

example shows that a RIP neighbor router has been incorrectly configured in two<br />

RIP groups:<br />

[edit]<br />

aviva@router1# commit check<br />

[edit protocols rip group alpha-rip-group]<br />

'neighbor fe-0/0/0.0'<br />

Failed to configure neighbor fe-0/0/0.0: already in group alpha-rip-group<br />

error: configuration check-out failed<br />

Checking the Syntax of the Configuration | 21<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!