Sub Interface

Sub Interface

Sub interfaces divide the parent interface into two or more virtual interfaces on which you can assign unique Layer 3 parameters such as IP addresses and dynamic routing protocols. The IP address for each sub interface should be in a different subnet from any other sub interface on the parent interface.  

 

Tested model & firmware version: 

  • Switch model name: 

Accton-AS5712-54X 

  • Community sonic version: 

202211.2 

 

NOTE: 

  • There is no L2 bridging across these subport interfaces; each subport interface is regarded to be in its own bridge domain. 

  • The MTU of the sub-interface will not be configured; instead, it will inherit the value of the parent interface. 

  • Parent interface is not a router port and should be a physical port or a port-channel. 

  • The VLAN cannot be utilised for a standard VLAN if the sub-interface is using it. 

 

SUB INTERFACE WITH IP: 

TOPOLOGY: 

\

Configuration commands (sonic configurations): 

Note: Commands are to be executed in sudo mode. 

           Configure an IP address for sub interfaces as per topology. 

Router1:  

root@sonic:/home/admin# config interface ip add Ethernet48.1 10.1.1.1/24 

Router2: 

root@sonic:/home/admin# config interface ip add Ethernet48.1 10.1.1.2/24 

 

VALIDATION (SONIC SHOW OUTPUTS) 

  • Subinterfaces and IP information. 

Router1: 

root@sonic:/home/admin# show subinterfaces status 

  Sub port interface    Speed    MTU    Vlan    Admin                  Type 

--------------------  -------  -----  ------  -------  -------------------- 

        Ethernet48.1      10G   9100       1       up  802.1q-encapsulation 

 

root@sonic:/home/admin# show ip interfaces 

  

Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP 

-----------  --------  -------------------  ------------  --------------  ------------- 

Ethernet48.1           10.1.1.1/24          up/up         N/A             N/A 

Loopback1              2.2.2.2/32           up/up         N/A             N/A 

docker0                240.127.1.1/24       up/down       N/A             N/A 

eth0                   172.26.1.81/24       up/up         N/A             N/A 

lo                     127.0.0.1/16         up/up         N/A             N/A 

 

 

Router2: 

root@sonic:/home/admin# show subinterfaces status 

  Sub port interface    Speed    MTU    Vlan    Admin                  Type 

--------------------  -------  -----  ------  -------  -------------------- 

        Ethernet48.1      10G   9100       1       up  802.1q-encapsulation 

 

root@sonic:/home/admin# show ip interfaces 

  

Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP 

-----------  --------  -------------------  ------------  --------------  ------------- 

Ethernet48.1           10.1.1.2/24          up/up         N/A             N/A 

Loopback1              2.2.2.2/32           up/up         N/A             N/A 

docker0                240.127.1.1/24       up/down       N/A             N/A 

eth0                   172.26.1.82/24       up/up         N/A             N/A 

lo                     127.0.0.1/16         up/up         N/A             N/A 

 

 

  • Ping Router1(Ethernet48.1) to Router2(Ethernet48.1). 

root@sonic:/home/admin# ping 10.1.1.2 

PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data. 

64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=0.480 ms 

  

--- 10.1.1.2 ping statistics --- 

1 packets transmitted, 1 received, 0% packet loss, time 0ms 

rtt min/avg/max/mdev = 0.480/0.480/0.480/0.000 ms 

root@sonic:/home/admin# show arp 

Address       MacAddress         Iface         Vlan 

------------  -----------------  ------------  ------ 

10.1.1.2      04:f8:f8:81:da:8c  Ethernet48.1  - 

 

 

SUB INTERFACE WITH IP and VLAN: 

TOPOLOGY: 

Configuration commands (sonic configurations): 

Note: Commands are to be executed in sudo mode. 

Router1:  Configure an IP address for sub interfaces as per topology. 

root@sonic:/home/admin# config interface ip add Ethernet48.1 10.1.1.1/24 

 

Router2: Add the Ethernet ports in a VLAN and configure an IP address for VLAN.  

 

VALIDATION (SONIC SHOW OUTPUTS) 

  • Subinterfaces , IP and vlan information. 

Router1: 

root@sonic:/home/admin# show subinterfaces status 

  Sub port interface    Speed    MTU    Vlan    Admin                  Type 

--------------------  -------  -----  ------  -------  -------------------- 

       Ethernet48.10      10G   9100      10       up  802.1q-encapsulation 

 

root@sonic:/home/admin# show ip interfaces 

  

Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP 

-----------  --------  -------------------  ------------  --------------  ------------- 

Ethernet48.10          10.1.1.1/24          up/up         N/A             N/A 

Loopback1              2.2.2.2/32           up/up         N/A             N/A 

docker0                240.127.1.1/24       up/down       N/A             N/A 

eth0                   172.26.1.81/24       up/up         N/A             N/A 

lo                     127.0.0.1/16         up/up         N/A             N/A 

 

 

Router2: 

root@sonic:/home/admin# show ip interfaces 

  

Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP 

-----------  --------  -------------------  ------------  --------------  ------------- 

Vlan10                 10.1.1.2/24          up/up         N/A             N/A 

Loopback1              2.2.2.2/32           up/up         N/A             N/A 

docker0                240.127.1.1/24       up/down       N/A             N/A 

eth0                   172.26.1.82/24       up/up         N/A             N/A 

lo                     127.0.0.1/16         up/up         N/A             N/A 

 

root@sonic:/home/admin# show vlan brief 
+-----------+-----------------+---------------+----------------+-----------------------+ 
|   VLAN ID | IP Address      | Ports         | Port Tagging   | DHCP Helper Address   | 
+===========+=================+===============+================+=======================+ 
|        10 | 10.1.1.2/24     | Ethernet48    | tagged         |                       | 
+-----------+-----------------+---------------+----------------+-----------------------+ 

 

  • Ping Router1(Ethernet48.10) to Router2(Vlan10). 

root@sonic:/home/admin# ping 10.1.1.2 

PING 10.1.1.2 (20.1.1.2) 56(84) bytes of data. 

64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=0.320 ms 

  

--- 10.1.1.2 ping statistics --- 

1 packets transmitted, 1 received, 0% packet loss, time 0ms 

rtt min/avg/max/mdev = 0.320/0.320/0.320/0.000 ms 

Router1 : 

root@sonic:/home/admin# show arp 

Address       MacAddress         Iface          Vlan 

------------  -----------------  -------------  ------ 

10.1.1.2      04:f8:f8:81:da:8c  Ethernet48.10  - 

Router2: 

root@sonic:/home/admin# show arp 

Address       MacAddress         Iface         Vlan 

------------  -----------------  ------------  ------ 

10.1.1.1      68:21:5f:9c:fc:7b  Ethernet48    10 

 

SUB INTERFACE WITH PORTCHANNEL: 

TOPOLOGY: 

 

Configuration commands (sonic configurations): 

Note: Commands are to be executed in sudo mode. 

Router1:  

  • Configure a Portchannel and add the Ethernet Ports in Portchannel. 

  • Add the portchannel in a VLAN and assign the IP address. 

  • Configure IP for subinterface in a portchannel. 

root@sonic:/home/admin# config interface ip add PortChannel1.20 20.1.1.1/24 

 

Router2: 

  • Configure a Portchannel and add the Ethernet Ports in Portchannel. 

  • Add the portchannel in a VLAN and assign the IP address. 

 

VALIDATION (SONIC SHOW OUTPUTS) 

  • Subinterfaces information. 

Router1: 

root@sonic:/home/admin# show subinterfaces status 

  Sub port interface    Speed    MTU    Vlan    Admin                  Type 

--------------------  -------  -----  ------  -------  -------------------- 

     PortChannel1.20      10G   9100      20       up  802.1q-encapsulation 

 

root@sonic:/home/admin# show ip interfaces 

  

Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP 

-----------  --------  -------------------  ------------  --------------  ------------- 

PortChannel1.20        20.1.1.1/24          up/up         N/A             N/A 

Loopback1              2.2.2.2/32           up/up         N/A             N/A 

docker0                240.127.1.1/24       up/down       N/A             N/A 

eth0                   172.26.1.82/24       up/up         N/A             N/A 

lo                     127.0.0.1/16         up/up         N/A             N/A 

 

root@sonic:/home/admin# show vlan brief 
+-----------+-----------------+---------------+----------------+-----------------------+ 
|   VLAN ID | IP Address      | Ports         | Port Tagging   | DHCP Helper Address   | 
+===========+=================+===============+================+=======================+           |        10 | 10.1.1.1/24     | PortChannel1  | tagged         |                       | 
+-----------+-----------------+---------------+----------------+-----------------------+ 

 

Router2: 

root@sonic:/home/admin# show ip interfaces 

  

Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP 

-----------  --------  -------------------  ------------  --------------  ------------- 

Vlan10                    10.1.1.2/24          up/up         N/A             N/A 

Vlan20                    20.1.1.2/24          up/up         N/A             N/A 

docker0                240.127.1.1/24       up/down       N/A             N/A 

eth0                   172.26.1.83/24       up/up         N/A             N/A 

lo                     127.0.0.1/16         up/up         N/A             N/A 

 

root@sonic:/home/admin# show vlan brief 

 
+-----------+-----------------+---------------+----------------+-----------------------+ 
|   VLAN ID | IP Address      | Ports         | Port Tagging   | DHCP Helper Address   | 
+===========+=================+===============+================+=======================+ 
|        10 | 10.1.1.2/24     | PortChannel1 | tagged         |                       | 
+-----------+-----------------+---------------+----------------+-----------------------+ 
|        20 | 20.1.1.2/24     | PortChannel1 | tagged         |                       | 
+-----------+-----------------+---------------+----------------+-----------------------+ 

 

 

  • Ping Router1(Vlan10) to Router2(Vlan10). 

  • Ping Router1(PortChannel1.20) to Router2(Vlan20). 

root@sonic:/home/admin# ping 10.1.1.2 

PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data. 

64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=0.631 ms 

  

--- 10.1.1.2 ping statistics --- 

1 packets transmitted, 1 received, 0% packet loss, time 0ms 

rtt min/avg/max/mdev = 0.631/0.631/0.631/0.000 ms 

 

root@sonic:/home/admin# ping 20.1.1.2 

PING 20.1.1.2 (20.1.1.2) 56(84) bytes of data. 

64 bytes from 20.1.1.2: icmp_seq=1 ttl=64 time=0.516 ms 

  

--- 20.1.1.2 ping statistics --- 

1 packets transmitted, 1 received, 0% packet loss, time 0ms 

rtt min/avg/max/mdev = 0.516/0.516/0.516/0.000 ms 

 

Router1: 

root@sonic:/home/admin# show arp 

Address       MacAddress         Iface            Vlan 

------------  -----------------  ---------------  ------ 

10.1.1.2      68:21:5f:9c:fc:7b  PortChannel1     10 

20.1.1.2      68:21:5f:9c:fc:7b  PortChannel1.20  - 

 

Router2: 

root@sonic:/home/admin# show arp 

Address       MacAddress         Iface          Vlan 

------------  -----------------  -------------  ------ 

10.1.1.1      04:f8:f8:81:da:8c  PortChannel1   10 

20.1.1.1      04:f8:f8:81:da:8c  PortChannel1   20