Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Limiting the Number of ATM Virtual Circuits

 

This commit script example limits the number of Asynchronous Transfer Mode (ATM) virtual circuits (VCs) configured on an ATM interface.

Requirements

This example uses a device running Junos OS with an ATM interface.

Overview and Commit Script

For each ATM interface, the set of corresponding VCs is selected. The number of those VCs, as determined by the built-in Extensible Stylesheet Language Transformations (XSLT) count() function, cannot exceed the limit set by the global variable limit. If there are more ATM VCs than limit, a commit error is generated, and the commit operation fails.

The example script is shown in both XSLT and SLAX syntax:

XSLT Syntax

SLAX Syntax

Configuration

Step-by-Step Procedure

To download, enable, and test the script:

  1. Copy the script into a text file, name the file atm-vc-limit.xsl or atm-vc-limit.slax as appropriate, and copy it to the /var/db/scripts/commit/ directory on the device.
  2. Select the following test configuration stanzas, and press Ctrl+c to copy them to the clipboard.

    If you are using the SLAX version of the script, change the filename at the [edit system scripts commit file] hierarchy level to atm-vc-limit.slax.

  3. In configuration mode, issue the load merge terminal command to merge the stanzas into your device configuration.

    1. At the prompt, paste the contents of the clipboard by using the mouse and the paste icon.

    2. Press Enter.

    3. Press Ctrl+d.

  4. Issue the commit command to commit the configuration.

Verification

Verifying the Commit Script Output

Purpose

Verify that the script behaves as expected.

Action

Review the output of the commit command. The sample configuration stanzas configure 12 virtual circuits on the ATM interface atm-1/2/3. Because the commit script only allows 10 ATM VCs to be configured on any ATM interface, the script generates an error, and the commit operation fails. The following output appears after issuing a commit command: