Huawei switch, router device batch configuration port method steps

How to configure ports in batches on Huawei switches and routers

In real work, if you want to perform the same configuration on multiple ports, and perform the same configuration on each interface one by one, it is easy to make mistakes and cause a lot of repetitive work.

Configuring the port group function can solve this problem. You only need to add these Ethernet interfaces to the same port group. In the port group view, you only need to enter a service command once, and all the Ethernet interfaces in the port group will be configured with this function, which quickly completes the interface batch configuration and reduces duplication. Configuration works.

There are two types of port groups: temporary port group and permanent port group.

If you want to temporarily distribute configurations to multiple specified interfaces in batches, you can choose to configure a temporary port group. After the configuration commands are delivered in batches, once the port group view is exited, the temporary port group will be automatically deleted by the system.

If you need to issue configuration commands in batches multiple times, you can choose to configure a permanent port group. Even after exiting the port group view, the port group and the corresponding port members still exist, which is convenient for the next batch configuration delivery.

If you want to delete a permanent port group, you need to delete it manually.

The experiment is as follows:
insert image description here

1. Configure a temporary port group

1. Restart the ten interfaces from GE1/0/1 to GE1/0/0. However, due to the inconsistent configuration of these interfaces, they need to be configured separately. Then you can choose a temporary port group

[SW]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/10 // Add interfaces GE1/0/1~GE1/0/10 to the temporary port group; it is equivalent to executing the command interface range gigabitethernet1 /0/1 to gigabitethernet 1/0/10

2. Shut down the ports in the port group first, then undo shutdown

[SW-port-group]shutdown

[SW-port-group]undo shutdown

[SW-port-group]quit //After exiting the temporary port group, the temporary port group will be automatically deleted

Second, configure a permanent port group

1. Ten interfaces from GE/0/1 to GE0/0/10 need to be configured as access interfaces, and the configuration information of these interfaces is relatively fixed and consistent, so you can choose a permanent port group

[SW]vlan 10 //Create vlan10

[SW]port-group vlan10 //Create a permanent port group named vlan10

[SW-port-group-vlan10]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/10 //Add ports from GE0/0/1 to GE0/0/10 to the port group of vlan10

[SW-port-group-vlan10]port link-type access //Configure the port as an access port

[SW-port-group-vlan10]port default vlan 10 //Add the ports under the port group to vlan 10

2. Use the command display port-group all to view the permanent port group information

3. Delete the permanent port group

[SW]undo port-group vlan10 //directly undo the corresponding port group name to delete

Guess you like

Origin blog.csdn.net/qq_33292195/article/details/128661241