---
title: Logical Interfaces
slug: aidc/logical-interfaces
createdAt: 2025-12-01T11:05:36.000Z
---

# <font color="#1d50a2">VLAN Interface</font>

Please refer to [VLAN](https://v1.docs.asternos.com/aidc/vlan#vlan-config).

# <font color="#1d50a2">LAG Interface</font>

Please refer to [LAG](https://v1.docs.asternos.com/aidc/lag#lag-config) .

# <font color="#1d50a2">Sub-interface</font>

## <font color="#1d50a2">**Sub-interface Status View**</font>

<font color="#1d05a2">Table 1 Sub-interface Status View</font>

| **Command**                                                                    | **Purpose**                                            |
| ------------------------------------------------------------------------------ | ------------------------------------------------------ |
| **show sub-interface** \[**ethernet** *interface\_name*.*subinterface-number*] | Display information about the status of subinterfaces. |
| **show** \{**ip**\|**ipv6**} **interfaces**                                    | Display IP address configuration of subinterfaces.     |

### <font color="#1d50a2">show sub-interface \[ethernet *interface\_name*.*subinterface-number*\]</font>

**\[Command]**
**show sub-interface** \[**ethernet** *interface\_name*.*subinterface-number*]

**\[Purpose]**
Display information about the status of subinterfaces.

**\[Parameters]**

| **Parameter**         | **Description**                 |
| --------------------- | ------------------------------- |
| *interface\_name*     | Parent interface name. (eg.0/1) |
| *subinterface-number* | Subinterface number.            |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show sub-interface
  Sub port interface    Speed    MTU    vlan    Admin                  Type
--------------------  -------  -----  ------  -------  --------------------
              0/0.2       25G   9100       2       up  802.1q-encapsulation
```

### <font color="#1d50a2">show \{ip|ipv6\} interfaces</font>

**\[Command]**
**show** \{**ip**|**ipv6**} **interfaces**

**\[Purpose]**
Display IP address configuration of subinterfaces.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ip interfaces
Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
-----------  --------  -------------------  ------------  --------------  -------------
0/0.2                  2.0.0.1/24           up/down       N/A             N/A
0/48                   199.0.3.1/24         up/up         N/A             N/A
0/52                   199.0.7.1/24         up/up         N/A             N/A
loopback0              10.1.0.34/32         up/up         N/A             N/A
mgmt                   10.250.0.138/24      up/up         N/A             N/A
```

## <font color="#1d50a2">**Sub-interface Config**</font>

<font color="#1d05a2">Table 2 Subinterface Config</font>

| **Command**                                                                       | **Purpose**                                   |
| --------------------------------------------------------------------------------- | --------------------------------------------- |
| **interface \{ethernet\|link-aggregation}** *interface\_name.subinterface-number* | Create a subinterface.                        |
| **mtu** *mtu*                                                                     | Configure the MTU value on a subinterface.    |
| **shutdown**                                                                      | Bring the subinterface down administratively. |
| **ip address** \{*A.B.C.D/M*\|*A\::B/M*} \[**secondary**]                         | Configure IP address for the subinterface.    |
| **mac\_address** *HH\:HH\:HH\:HH\:HH\:HH*                                         | Specify a MAC address to the subinterface.    |

### interface \{ethernet|link-aggregation} *interface\_name.subinterface-number*

**\[Command]**
**interface \{ethernet|link-aggregation}** *interface\_name.subinterface-number*

**\[Purpose]**
Create a subinterface.

**\[Parameters]**

| **Parameter**         | **Description**                 |
| --------------------- | ------------------------------- |
| *interface\_name*     | Parent interface name. (eg.0/1) |
| *subinterface-number* | Subinterface number.            |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no interface \{ethernet|link-aggregation}** *interface\_name.subinterface-number*
to delete the subinterface.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/1.1
sonic(config-if-0/1.1)# show this
!
interface ethernet 0/1.1
sonic(config)# no interface ethernet 0/1.1
```

### mtu *mtu*

**\[Command]**
**mtu** *mtu*

**\[Purpose]**
Configure the MTU value on a subinterface.

**\[Parameters]**

| **Parameter** | **Description**                                                                       |
| ------------- | ------------------------------------------------------------------------------------- |
| *mtu*         | Maximum Transmission Unit, the range is from 1312 to 9216. The default is 9216 Bytes. |

**\[View]**
Subinterface Configuration View

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/1.1
sonic(config-if-0/1.1)# mtu 2000
sonic(config-if-0/1.1)# show this
!
interface ethernet 0/1.1
 mtu 2000
```

### <font color="#2166ae">shutdown</font>

**\[Command]**
**shutdown**

**\[Purpose]**
Bring the subinterface down administratively.

**\[View]**
Subinterface Configuration View

**\[Notes]**
Run command **no shutdown** to bring the sub-interface up administratively.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/1.1
sonic(config-if-0/1.1)# shutdown
sonic(config-if-0/1.1)# show this
!
interface ethernet 0/1.1
 shutdown
```

### <font color="#2166ae">ip address \{*A.B.C.D/M*|*A\:\:B/M*\} \[secondary\]</font>

**\[Command]**
**ip address** \{*A.B.C.D/M*|*A\::B/M*} \[**secondary**]

**\[Purpose]**
Configure IP address for the subinterface.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| *A.B.C.D/M*   | IPv4 address with prefix length.                                                                                                                                         |
| *A\::B/M*     | IPv6 address with prefix length.                                                                                                                                         |
| **secondary** | The default is Primary IP, specifying this option means configuring as Secondary IP, which requires that the Secondary IP and Primary IP be in the same network segment. |

**\[View]**
Subinterface Configuration View

**\[Notes]**
IPv4 address with subnet mask /32 is not allowed to be configured. Addresses with subnet mask /31 is allowed. In other subnet masks, addresses with the host portion all-zeros or all-ones are not allowed. IPv6 address with subnet mask /127 or /128 is not allowed to be configured. In other subnet masks, addresses with the host portion all-zeros are not allowed, but all-ones are allowed.
Run command **no ip address** \{*A.B.C.D/M*|*A\::B/M*} \[**secondary**]to delete IP address configuration of the subinterface.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/2.2
sonic(config-if-0/2.2)# ip address 3.3.3.6/24
sonic(config-if-0/2.2)# show this
!
interface ethernet 0/2.2
ip address 3.3.3.6/24
```

### <font color="#2166ae">mac\_address *HH\:HH\:HH\:HH\:HH\:HH*</font>

**\[Command]**
**mac\_address** *HH\:HH\:HH\:HH\:HH\:HH*

**\[Purpose]**
Specify a MAC address to the subinterface.

**\[Parameters]**

| **Parameter**            | **Description**                  |
| ------------------------ | -------------------------------- |
| *HH\:HH\:HH\:HH\:HH\:HH* | MAC address, not case sensitive. |

**\[View]**
Subinterface Configuration View

**\[Notes]**
The default is the MAC of the switch.
Run command **no mac\_address** to restore the MAC of the sub-interface to default.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/2.2
sonic(config-if-0/2.2)# mac-address 18:17:25:37:67:af
sonic(config-if-0/2.2)# show this
!
interface ethernet 0/2.2
 mac-address 18:17:25:37:67:af
```

# <font color="#1d50a2">Loopback</font>

## <font color="#1d50a2">**Loopback View**</font>

<font color="#1d05a2">Table 3 Loopback View</font>

| **Command**                                 | **Purpose**                                              |
| ------------------------------------------- | -------------------------------------------------------- |
| **show** \{**ip**\|**ipv6**} **interfaces** | Display IP address configuration of loopback interfaces. |

### <font color="#1d50a2">show \{ip|ipv6\} interfaces</font>

**\[Command]**
**show** \{**ip**|**ipv6**} **interfaces**

**\[Purpose]**
Display IP address configuration of loopback interfaces.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ip interfaces
Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
-----------  --------  -------------------  ------------  --------------  -------------
0/48                   199.0.3.1/24         up/up         N/A             N/A
0/52                   199.0.7.1/24         up/up         N/A             N/A
0/72                   10.72.0.1/24         up/up         N/A             N/A
loopback0              10.1.0.34/32         up/up         N/A             N/A
mgmt                   10.250.0.138/24      up/up         N/A             N/A
```

## <font color="#1d50a2">**Loopback Config**</font>

<font color="#1d05a2">Table 4 Loopback Config</font>

| **Command**                              | **Purpose**                                      |
| ---------------------------------------- | ------------------------------------------------ |
| **interface loopback** *loopback-id*     | Enter Loopback Interface Configuration View.     |
| **ip address** \{*A.B.C.D/M*\|*A\::B/M*} | Configure IP address for the loopback interface. |

### <font color="#1d50a2">interface loopback *loopback-id*</font>

**\[Command]**
**interface loopback** *loopback-id*

**\[Purpose]**
Enter Loopback Interface Configuration View

**\[Parameters]**

| **Parameter** | **Description**                                               |
| ------------- | ------------------------------------------------------------- |
| *loopback-id* | Loopback interface number, integer form, range from 0 to 999. |

**\[View]**
Global Configuration View

**\[Notes]**
Loopback0 has been created by default and cannot be deleted.
Run command **no interface loopback** *loopback-id* to delete loopback interface.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface loopback 1
sonic(config-loif-1)# show this
!
interface loopback 1
```

### <font color="#1d50a2">ip address \{*A.B.C.D/M*|*A\:\:B/M*\}</font>

**\[Command]**
**ip address** \{*A.B.C.D/M*|*A\::B/M*}

**\[Purpose]**
Configure IP address for the loopback interface.

**\[Parameters]**

| **Parameter** | **Description**                  |
| ------------- | -------------------------------- |
| *A.B.C.D/M*   | IPv4 address with prefix length. |
| *A\::B/M*     | IPv6 address with prefix length. |

**\[View]**
Loopback Interface Configuration View

**\[Notes]**
Run command **no ip address** \{*A.B.C.D/M*|*A\::B/M*} to delete IP address configuration of the loopback interface.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface loopback 2
sonic(config-loif-2)# ip address 3.3.3.6/24
sonic(config-loif-2)# show this
!
interface loopback 2
ip address 3.3.3.6/24
```

