The rule command command creates a rule in a task group to allow a command or multiple commands to be executed in a specific view.
The undo rule command command cancels the configuration.
By default, no rule is configured in a task group.
Parameter | Description | Value |
---|---|---|
rule-name |
Specifies the name of a rule. |
The value is a string of 1 to 15 case-insensitive characters. |
permit |
Allows a command to be executed in a specific view. |
- |
view view-name |
Specifies the name of a view. |
The value can be any view supported by the system. |
expression command-string |
Specifies a command or a batch of commands with the same prefix. |
The value can be any command supported by the system.The value is a string of 1 to 1604 characters. |
Usage Scenario
To provide granular management and flexible configuration and allow a command or a batch of commands with the same prefix to be executed in a view, run the rule command command.In the same task group, the priority of the rule command command is higher than that of the task command. When the rule command command configuration conflicts with the task command configuration, the rule command command configuration takes effect preferentially.
Precautions
In the same task group, two rules with the same view and keyword cannot be configured. For example, if the sysname command is allowed to be executed in the system view in rule 1, the sysname command cannot be configured in a second rule.
If the rule command command is run several times, the latest configuration overrides the previous one.
<HUAWEI> system-view [~HUAWEI] aaa [~HUAWEI-aaa] task-group group1 [*HUAWEI-aaa-task-group-group1] rule command command1 permit view system expression sysname
<HUAWEI> system-view [~HUAWEI] aaa [~HUAWEI-aaa] task-group group1 [*HUAWEI-aaa-task-group-group1] rule command command2 permit view system expression hwtacacs