---
title: Port Group Configuration
slug: routing/port-group-configuration
createdAt: 2025-12-04T04:30:21.233Z
---

## <font color="#1d50a2">Port Group Configuration</font>

### <font color="#1d50a2">port-group ethernet interface *range*</font>

**\[Command]**
**port-group ethernet *interface range***

**\[Purpose]**
Create port group

**\[View]**
System configuration view

**\[Usage Scenario]**
When users need to apply the same configuration to multiple Ethernet interfaces, configuring each interface individually can be error-prone and result in significant repetitive work. Creating interface groups can resolve this issue.

**\[Notes]**
This function can be used for batch configuration of interfaces, such as batch adding interfaces to the same VLAN, etc. (provided that the interface is a layer 2 interface)

**\[Use Cases]**

```plaintext
sonic(config)# port-group ethernet 1-10
sonic(config-port-group-1-10)# switchport access vlan 10
```

### <font color="#1d50a2">port-group lag *lag range*</font>

**\[Command]**
**port-group lag *lag range***

**\[Purpose]**
Create lag group

**\[View]**
System configuration view

**\[Usage Scenario]**
When users need to configure multiple lag ports with the same configuration, it is easy to make errors and cause a lot of repetitive work if each lag is configured one by one. Creating lag groups can solve this problem.

**\[Notes]**
This function can be used for batch configuration of lag groups.

**\[Use Cases]**

```plaintext
sonic(config)# port-group lag 1-3
sonic(config-lag-group-1-3)#switchport access vlan 10
```

