Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Example: Limit the Number of E1 Interfaces

This commit script example limits the number of E1 interfaces configured on a Channelized STM1 Intelligent Queuing (IQ) PIC to avoid contention issues with per-unit-schedulers.


This example uses a device running Junos OS with a Channelized STM1 Intelligent Queuing (IQ) PIC.

Overview and Commit Script

The following script ensures that there are no more than 16 E1 interfaces configured on a channelized STM1 IQ interface. For each channelized STM1 interface (cstm1-), the set of corresponding E1 interfaces is selected. The number of those interfaces, as determined by the built-in Extensible Stylesheet Language Transformations (XSLT) count() function, cannot exceed the limit set by the global parameter limit. If there are more E1 interfaces 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



Step-by-Step Procedure

To download, enable, and test the script:

  1. Copy the script into a text file, name the file e1-limit.xsl or e1-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 e1-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. Commit the configuration.


Verifying the Commit Script Execution


Verify that the script behaves as expected.


Review the output of the commit command. The sample configuration stanzas channelize a cstm1-0/1/0 interface into 17 E1 interfaces, so the script generates an error, and the commit operation fails. The following output appears after issuing a commit command: