Configuring Interfaces in a Batch
Context
If you need to perform the same operations on multiple Ethernet interfaces, configuring each interface one by one easily causes incorrect configurations and is labor-intensive.
The port group function easily solves the problem. You can add all the Ethernet interfaces to the same port group. After you run a configuration command once in the port group view, the configuration takes effect on all the Ethernet interfaces in the port group, reducing the configuration workload.
- Temporary port group: To temporarily deliver a configuration to multiple interfaces, you can create a temporary port group. After you deliver the configuration and exit from the port group view, the system automatically deletes the temporary port group.
- Permanent port group: To deliver configurations to interfaces multiple times, you can create a permanent port group. After you exit from the port group view, the port group and member interfaces in the group still exist, facilitating subsequent batch configuration for the member interfaces. To delete a permanent port group, run the undo port-group { all | port-group-name } command.
Procedure
- Configure a temporary port group.
- Run system-view
The system view is displayed.
- Run port-group group-member { interface-type interface-number1 [ to interface-type interface-number2 ] } &<1-10>
Or run interface range { interface-type interface-number1 [ to interface-type interface-number2 ] } &<1-10>
A temporary port group is created and the port group view is displayed.
- Run system-view
- Configure a permanent port group.
- Run system-view
The system view is displayed.
- Run port-group port-group-name
A permanent port group is created and the port group view is displayed.
- Run group-member { interface-type interface-number1 [ to interface-type interface-number2 ] } &<1-10>
Ethernet interfaces are added to the permanent port group.
- Run system-view
Verifying the Configuration
Run the display port-group [ all | port-group-name ] command to check member interfaces in a permanent port group.
Run the display port-group [ port-group-name ] member-configuration command to display the configuration of each member interface in a specified interface group.
The port group function allows you to configure interfaces in a batch. However, the device does not support query or saving of the port group configuration. You can run the display this command in the interface view of a member interface to check the configuration that takes effect on the interface.
Follow-up Procedure
- Configuring the Working Mode of a Combo Interface
- Switching an Interface to Layer 3 Mode
- Configuring Auto-Negotiation
- Configuring the Interface Rate
- Configuring Flow Control
- Configuring the Delay in Reporting Physical Status Changes
- Configuring Link Flapping Protection
- Configuring an Interface to Transit to the Error-Down State When the Number of Received Error Packets Exceeds the Threshold
- Setting the Jumbo Frame Length Allowed on an Interface
- Configuring Unidirectional Single-Fiber Communication
- Configuring the MDI Type
- Configuring the Duplex Mode
After a configuration command is executed in the port group view, the device will deliver the configuration to each port in the port group and display the configuration of each port.
You can configure both interface attribute commands and service commands in the port group view. For details about the service commands, see the related documentation.
A command run in the port group view takes effect only on member interfaces that support the command. Therefore, a configuration that is batch delivered may not take effect on all member interfaces. For example, a port group consists of optical and electrical interfaces. If you run the transceiver power low trigger error-down command in the port group view, the configuration will only take effect on the optical interfaces.