Description

Juniper Apstra Freeform config syntax is not checked before committing a change from the UI. However, users can use a command that will run a Junos OS "commit check" and highlight any potential syntax misconfiguration before they apply the syntax to the device from the Juniper Apstra UI.

This article explains how to verify your Junos-OS-based configurations that are created in Juniper Apstra Freeform using the above command before committing the changes by using apstra-cli.

Note: This command will help users to check the configuration syntax. However, users are responsible for verifying the configuration semantics.

Solution

Before starting, make sure that you have installed the latest apstra-cli 4.1.1 version. You can find information about this release and how to install it in KB36747 - [Juniper Apstra] Installing and using the Apstra-CLI (AOS-CLI) utility [juniper.net]

The command works on devices that are in "Deploy" Mode, are "Internal" (they are not generic systems), and are in a "Freeform" type blueprint.

  1. From apstra-cli, run the blueprint freeform-system config-syntax-check command. For the "--blueprint" option, use Tab completion and the arrow keys to select the A blueprint.

config_check_1.png

config_check_2.png

  1. Select the optional parameter "system" if you would like to run the command for a specific device only. If you do not include this parameter, the command will run for all the devices that meet the condition described above. Use the "--system" option and use Tab completion and the arrow keys to select the system.

config_check_3.png

  1. Include the mandatory options "--username" followed the device username; "--password" followed by the password for this username; then press Enter. 

config_check_4.png

The output will show an "OK" result if no syntax errors were found, or a "Please check config" message followed by the error from the device, which then needs to be fixed.

Example of an output by using the optional parameter "system":

config_check_5.png

Example of an output without using the optional parameter "system" and containing a syntax error in some devices:

config_check_6.png

If the command shows no syntax error or after correcting any syntax errors, users can proceed to commit the change from the Juniper Apstra UI.

Modification History

Revision 1