[Enterprise SONiC] Sub-Interface Follow
Multiple L3 sub port interfaces, each characterized by a VLAN id in the 802.1q tag, can be created on a physical port or a port channel. Sub port interfaces attaching to the same physical port or port channel can interface to different VRFs, though they share the same VLAN id space and must have different VLAN ids.
Tested model & firmware version:
- Switch model name:
AS7326-56X
AS4630-54PE
- Edgecore SONiC version:
202006.3
202006.4
202012.1
202012.2
202111.3
Restriction:
- There is no L2 bridging between these sub port interfaces; each sub port interface is considered to stay in a separate bridge domain.
- The MTU of the sub-interface won’t be configurated, it will follow the parent interface value.
- Parent interface should be a physical port or a port-channel, and is not a router port.
- If the VLAN is used by sub-interface, then it can’t use for normal VLAN.
- The name of the sub-interface is not greater than 15 chars(including “.”). Example, PortChannel01.100 is too long you will face the following error message.
admin@sonic:~$ sudo config interface ip add PortChannel01.100 10.1.0.2/31
Usage: config interface ip add [OPTIONS]
Try "config interface ip add -h" for help.
Error: Sub port interface name is too long!
- Known issue:
- [SONIC-3166] The mac learning of the ports which set the subinterface will fail, after doing the "config reload". The issue is fixed in 202012.3.
Topology:

Procedure:
Step 1. Down-speed Ethernet0 to 10G on SW2.(refer to Switch port attributes)
Step 2. On SW2 and SW3 bind Ethernet48 and Ethernet52 to portchannel interface(PortChannel01).(refer LAG)
Step 3.Create VLAN interface as topology(refer VLAN & Inter-VLAN Routing)
Step 4.Create sub-interface as topology
SW1:
admin@SW1:~$ sudo config interface ip add Ethernet0.10 192.168.10.2/24
SW2:
admin@SW2:~$ sudo config interface ip add PortChannel01.5 192.168.5.1/24
Result:
- Sub-interface and VLAN status
SW1:
admin@SW1:~$ show subinterfaces status
Sub port interface Speed MTU Vlan Admin Type
-------------------- ------- ----- ------ ------- --------------------
Ethernet0.10 10G 9100 10 up 802.1q-encapsulation
admin@sonic:~$ show vlan brief
+-----------+--------------+---------+----------------+-----------------------+
| VLAN ID | IP Address | Ports | Port Tagging | DHCP Helper Address |
+===========+==============+=========+================+=======================+
+-----------+--------------+---------+----------------+-----------------------+
SW2:
admin@SW2:~$ show subinterfaces status
Sub port interface Speed MTU Vlan Admin Type
-------------------- ------- ----- ------ ------- --------------------
PortChannel01.5 200G 9100 5 up 802.1q-encapsulation
admin@SW2:~$ show vlan brief
+-----------+-----------------+---------------+----------------+-----------------------+
| VLAN ID | IP Address | Ports | Port Tagging | DHCP Helper Address |
+===========+=================+===============+================+=======================+
| 10 | 192.168.10.1/24 | Ethernet0 | tagged | |
+-----------+-----------------+---------------+----------------+-----------------------+
| 20 | 192.168.20.1/24 | PortChannel01 | tagged | |
+-----------+-----------------+---------------+----------------+-----------------------+
SW3:
admin@SW3:~$ show subinterfaces status
Sub port interface Speed MTU Vlan Admin Type
-------------------- ------- ----- ------ ------- ------
admin@sonic:~$ show vlan brief
+-----------+-----------------+---------------+----------------+-----------------------+
| VLAN ID | IP Address | Ports | Port Tagging | DHCP Helper Address |
+===========+=================+===============+================+=======================+
| 5 | 192.168.5.2/24 | PortChannel01 | tagged | |
+-----------+-----------------+---------------+----------------+-----------------------+
| 20 | 192.168.20.2/24 | PortChannel01 | tagged | |
+-----------+-----------------+---------------+----------------+-----------------------+
- SW1(Ethernet0.10) ping to SW2(Vlan10) is ok.
- SW2(Vlan20) ping to SW3(Vlan20) is ok
- SW2(PortChannel01.5) ping to SW3(Vlan5) is ok
Comments
0 comments
Please sign in to leave a comment.