5.1.5.1. Configuring interface activation scripts

Interface activation scripts can be useful for scenarios where special procedures are required to initialize networking.

For example, changing the Media Access Control (MAC) address of a network card before bringing it up can be done with a pre-up script. Such scripts should also be used for configuring bridge interfaces.

The following types of activation scripts can be set:

  1. post-up scripts are executed after the interface is activated.

  2. post-down scripts are executed after the interface is deactivated.

5.1.5.1.1. Procedure – Creating interface activation scripts

Purpose: 

To create an interface activation script for an interface, complete the following steps.

Steps: 

  1. Navigate to Networking > Interfaces and select the interface to configure.

  2. To add a new option to the interface, click New.

    Configuring interface options

    Figure 5.6. Configuring interface options

  3. From the Option field, select the type of the script (post-up, post-down).

  4. Enter the command to be executed to the Script field under Attributes. Use full path name, for example, /sbin/ifdown.

    Defining interface scripts

    Figure 5.7. Defining interface scripts

  5. To execute multiple commands, repeat Steps 2-4.

  6. To set the order of commands, use the arrow buttons below the list of options.

    Tip

    If you have to use complex scripts, create a script file on the PNS host using a text editor, and add an option to run it when needed.