interface (Command template view)

Function

The interface command associates an interface with a configuration template.

By default, this type of port is not created.

Format

interface ifname

Parameters

Parameter Description Value
ifname

Specifies the type and number of an interface.

The parameter value can be a regular expression. For example, run the interface <Loopback[1-9]> command to enter the interface view and associate loopback1 to loopback9 with the current configuration template.

The value is a string of 1 to 63 case-insensitive characters, spaces not supported.

Views

Command template view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
interface-mgr write

Usage Guidelines

Usage Scenario

Configurations in different views may be identical. To simplify the configurations, create a configuration template, define configurations that are duplicate in different views in it, and apply the configuration template to specified views. Run the interface interface-group-name command to enter the interface view and associate the interface with the current configuration template. Then, configurations can be performed based on service requirements.

Prerequisites

The command group command has been used to create a configuration template and enter the configuration template view.

Follow-up Procedure

Run the end-group command to submit the configuration and run the interface command to create the interface.

Run the apply-command-group command to apply the configuration template to a specific view.

If a interface view instance does not need configurations in a configuration template, run the undo command-string command in the configuration template view to delete the specified interface view instance.

If redundant or incorrect configurations exist in a interface view instance, access the specified instance in the configuration template view and run the undo command-string command to delete the configurations.

The command specified in the undo command-string command can only be a interface view instance that is associated with the configuration template or the command that has been run in that interface view instance. If a interface view instance is deleted, all configurations in the configuration template that applies to the instance are also deleted.

Example

# Create the configuration template named g1, associate loopback1 to loopback9 with the template, and enable IPv6.
<HUAWEI> system-view
[~HUAWEI] command group g1
[~HUAWEI-group-g1] interface <Loopback[1-9]>
[~HUAWEI-group-g1-<Loopback[1-9] >] ipv6 enable
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >