edit policy

edit policy filename

Description

Edits a policy text file.

Syntax Description

filename Specifies the filename of the policy text file.

Default

N/A.

Usage Guidelines

This command edits policy text files that are on the switch. All policy files use “.pol” as the filename extension, so to edit the text file for the policy boundary use boundary.pol as the filename. If you specify the name of a file that does not exist, you will be informed and the file will be created.

This command spawns a VI-like editor to edit the named file. For information on using VI, if you are not familiar with it, do a web search for “VI editor basic information”, and you should find many resources. The following is only a short introduction to the editor.

Edit operates in one of two modes; command and input. When a file first opens, you are in the command mode. To write in the file, use the keyboard arrow keys to position your cursor within the file, then press one of the following keys to enter input mode:
  • i - To insert text ahead of the initial cursor position.

  • a- To append text after the initial cursor position.

To escape the input mode and return to the command mode, press the Escape key.

There are several commands that can be used from the command mode. The following are the most commonly used:
  • dd - To delete the current line.

  • yy - To copy the current line.

  • p - To paste the line copied.

  • :w - To write (save) the file.

  • :q - To quit the file if no changes were made.

  • :q! - To forcefully quit the file without saving changes.

  • :wq - To write and quit the file.

Refresh Policy

After you have edited the text file for a policy that is currently active, you will need to refresh the policy if you want the changes to be reflected in the policy database. When you refresh the policy, the text file is read, the syntax is checked, the policy information is added to the policy manager database, and the policy then takes effect. Use the following command to refresh a policy:

refresh policy policy-name

If you just want to check to be sure the policy contains no syntax errors, use the following command:

check policypolicy-name{access-list}

Example

The following command allows you to begin editing the text file for the policy boundary:

edit policy boundary.pol

History

This command was first available in ExtremeXOS 11.0.

Platform Availability

This command is available on ExtremeSwitching X435, X440-G2, X450-G2, X460-G2, X465, X590, X620, X690, and X695 series switches.