Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Adding T1 Interfaces to a RIP Group

 

This example shows how to use commit scripts to decrease the amount of manual configuration, specifically how to add every T1 interface configured at the [edit interfaces] hierarchy level to the [edit protocols rip group test] hierarchy level.

Requirements

This example uses a device running Junos OS with T1 interfaces.

Overview and Commit Script

If you want to enable RIP on an interface, you must make changes at both the [edit interfaces] and [edit protocols rip] hierarchy levels. This example shows how to use commit scripts to add every T1 interface configured at the [edit interfaces] hierarchy level to the [edit protocols rip group test] hierarchy level. This example includes no error, warning, or system log messages. The changes to the configuration are made silently.

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 rip-t1.xsl or rip-t1.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 rip-t1.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 Configuration

Purpose

Verify that the script behaves as expected.

Action

Issue the show protocols rip group test command. All T1 interfaces should now appear under the [edit protocols rip group test] hierarchy level.