Logical Interfaces
VLAN Interface
Section titled “VLAN Interface”Please refer to VLAN.
LAG Interface
Section titled “LAG Interface”Please refer to LAG .
Sub-interface
Section titled “Sub-interface”Sub-interface Status View
Section titled “Sub-interface Status View”Table 1 Sub-interface Status View
| 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. |
show sub-interface [ethernet interface_name.subinterface-number]
Section titled “show sub-interface [ethernet interface_name.subinterface-number]”[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]
sonic# show sub-interface Sub port interface Speed MTU vlan Admin Type-------------------- ------- ----- ------ ------- -------------------- 0/0.2 25G 9100 2 up 802.1q-encapsulationshow {ip|ipv6} interfaces
Section titled “show {ip|ipv6} interfaces”[Command]
show {ip|ipv6} interfaces
[Purpose]
Display IP address configuration of subinterfaces.
[View]
Privileged User View
[Use Cases]
sonic# show ip interfacesInterface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP----------- -------- ------------------- ------------ -------------- -------------0/0.2 2.0.0.1/24 up/down N/A N/A0/48 199.0.3.1/24 up/up N/A N/A0/52 199.0.7.1/24 up/up N/A N/Aloopback0 10.1.0.34/32 up/up N/A N/Amgmt 10.250.0.138/24 up/up N/A N/ASub-interface Config
Section titled “Sub-interface Config”Table 2 Subinterface Config
| 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
Section titled “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]
sonic# configure terminalsonic(config)# interface ethernet 0/1.1sonic(config-if-0/1.1)# show this!interface ethernet 0/1.1sonic(config)# no interface ethernet 0/1.1mtu mtu
Section titled “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]
sonic# configure terminalsonic(config)# interface ethernet 0/1.1sonic(config-if-0/1.1)# mtu 2000sonic(config-if-0/1.1)# show this!interface ethernet 0/1.1 mtu 2000shutdown
Section titled “shutdown”[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]
sonic# configure terminalsonic(config)# interface ethernet 0/1.1sonic(config-if-0/1.1)# shutdownsonic(config-if-0/1.1)# show this!interface ethernet 0/1.1 shutdownip address {A.B.C.D/M|A::B/M} [secondary]
Section titled “ip address {A.B.C.D/M|A::B/M} [secondary]”[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]
sonic# configure terminalsonic(config)# interface ethernet 0/2.2sonic(config-if-0/2.2)# ip address 3.3.3.6/24sonic(config-if-0/2.2)# show this!interface ethernet 0/2.2ip address 3.3.3.6/24mac_address HH:HH:HH:HH:HH:HH
Section titled “mac_address HH:HH:HH:HH:HH:HH”[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]
sonic# configure terminalsonic(config)# interface ethernet 0/2.2sonic(config-if-0/2.2)# mac-address 18:17:25:37:67:afsonic(config-if-0/2.2)# show this!interface ethernet 0/2.2 mac-address 18:17:25:37:67:afLoopback
Section titled “Loopback”Loopback View
Section titled “Loopback View”Table 3 Loopback View
| Command | Purpose |
|---|---|
| show {ip|ipv6} interfaces | Display IP address configuration of loopback interfaces. |
show {ip|ipv6} interfaces
Section titled “show {ip|ipv6} interfaces”[Command]
show {ip|ipv6} interfaces
[Purpose]
Display IP address configuration of loopback interfaces.
[View]
Privileged User View
[Use Cases]
sonic# show ip interfacesInterface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP----------- -------- ------------------- ------------ -------------- -------------0/48 199.0.3.1/24 up/up N/A N/A0/52 199.0.7.1/24 up/up N/A N/A0/72 10.72.0.1/24 up/up N/A N/Aloopback0 10.1.0.34/32 up/up N/A N/Amgmt 10.250.0.138/24 up/up N/A N/ALoopback Config
Section titled “Loopback Config”Table 4 Loopback Config
| 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. |
interface loopback loopback-id
Section titled “interface loopback loopback-id”[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]
sonic# configure terminalsonic(config)# interface loopback 1sonic(config-loif-1)# show this!interface loopback 1ip address {A.B.C.D/M|A::B/M}
Section titled “ip address {A.B.C.D/M|A::B/M}”[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]
sonic# configure terminalsonic(config)# interface loopback 2sonic(config-loif-2)# ip address 3.3.3.6/24sonic(config-loif-2)# show this!interface loopback 2ip address 3.3.3.6/24