Layer 3 interfaces forward packets to another device using static or dynamic routing protocols. You can use Layer 3 interfaces for IP routing and inter-VLAN routing of Layer 2 traffic.
You can configure a port as a Layer 2 interface or a Layer 3 interface. A routed interface is a physical port that can route IP traffic to another device. A routed interface is a Layer 3 interface only and does not support Layer 2 protocols, such as the Spanning Tree Protocol (STP).
All Ethernet ports are switched interfaces by default. You can change this default behavior with the CLI setup script or through the system default switchport command.
You can assign an IP address to the port, enable routing, and assign routing protocol characteristics to this routed interface.
You can assign a static MAC address to a Layer 3 interface. For information on configuring MAC addresses, see the Layer 2 Switching Configuration Guide for your device.
You can also create a Layer 3 port channel from routed interfaces.
Routed interfaces and subinterfaces support exponentially decayed rate counters. Cisco NX-OS tracks the following statistics with these averaging counters:
Input packets/sec
Output packets/sec
Input bytes/sec
Output bytes/sec
Subinterfaces
You can create virtual subinterfaces on a parent interface configured as a Layer 3 interface. A parent interface can be a physical port or a port channel.
Subinterfaces 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 subinterface should be in a different subnet from any other subinterface on the parent interface.
You create a subinterface with a name that consists of the parent interface name (for example, Ethernet 2/1) followed by a period and then by a number that is unique for that subinterface. For example, you could create a subinterface for Ethernet interface 2/1 named Ethernet 2/1.1 where .1 indicates the subinterface.
Cisco NX-OS enables subinterfaces when the parent interface is enabled. You can shut down a subinterface independent of shutting down the parent interface. If you shut down the parent interface, Cisco NX-OS shuts down all associated subinterfaces as well.
One use of subinterfaces is to provide unique Layer 3 interfaces to each VLAN that is supported by the parent interface. In this scenario, the parent interface connects to a Layer 2 trunking port on another device. You configure a subinterface and associate the subinterface to a VLAN ID using 802.1Q trunking.
The following figure shows a trunking port from a switch that connects to router B on interface E 2/1. This interface contains three subinterfaces that are associated with each of the three VLANs that are carried by the trunking port.
Figure 1. Subinterfaces for VLANs
VLAN Interfaces
A VLAN interface or a switch virtual interface (SVI) is a virtual routed interface that connects a VLAN on the device to the Layer 3 router engine on the same device. Only one VLAN interface can be associated with a VLAN, but you need to configure a VLAN interface for a VLAN only when you want to route between VLANs or to provide IP host connectivity to the device through a virtual routing and forwarding (VRF) instance that is not the management VRF. When you enable VLAN interface creation, Cisco NX-OS creates a VLAN interface for the default VLAN (VLAN 1) to permit remote switch administration.
You must enable the VLAN network interface feature before you can configure it. The system automatically takes a checkpoint prior to disabling the feature, and you can roll back to this checkpoint. For information about rollbacks and checkpoints, see the System Management Configuration Guide for your device.
Note
You cannot delete the VLAN interface for VLAN 1.
You can route across VLAN interfaces to provide Layer 3 inter-VLAN routing by configuring a VLAN interface for each VLAN that you want to route traffic to and assigning an IP address on the VLAN interface. For more information on IP addresses and IP routing, see the Unicast Routing Configuration Guide for your device.
The following figure shows two hosts connected to two VLANs on a device. You can configure VLAN interfaces for each VLAN that allows Host 1 to communicate with Host 2 using IP routing between the VLANs. VLAN 1 communicates at Layer 3 over VLAN interface 1and VLAN 10 communicates at Layer 3 over VLAN interface 10.
Figure 2. Connecting Two VLANs with VLAN Interfaces
Loopback Interfaces
A loopback interface is a virtual interface with a single endpoint that is always up. Any packet that is transmitted over a loopback interface is immediately received by this interface. Loopback interfaces emulate a physical interface.
You can use loopback interfaces for performance analysis, testing, and local communications. Loopback interfaces can act as a termination address for routing protocol sessions. This loopback configuration allows routing protocol sessions to stay up even if some of the outbound interfaces are down.
Licensing Requirements for Layer 3 Interfaces
Although the Cisco Nexus 6000 Series switch has Layer 3 interfaces inherent in the device, you must still install the Layer 3 Base Services Package feature licence to use basic Layer 3 features and functionality. For advanced Layer 3 features, you must install the Layer 3 Advanced Enterprise Package feature license. For a complete explanation fo the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.
After installing a Layer 3 license, the following guidelines and limitations apply to the device:
In Service Software Upgrades (ISSUs) are not supported.
Temporary Layer 3 feature licenses are not supported. (The Layer 3 Base Services Package license has a grace period of 0.)
Management Switch Virtual Interfaces (SVIs) are supported without a Layer 3 Base Services Package license, and ISSU can be performed with Management SVIs
configured.
All SVIs (whether management keyword is configured
or not) are operationally up when no Layer 3 Base Services Package license is installed. After the Layer 3 Base Services Packages feature license is installed, routed SVIs
are brought operationally down and then brought back up again. This reload happens
because the routed SVIs behave like management SVIs before a Layer 3 Base Services Packages feature
license is installed, and the interface state saved in the hardware needs to be cleared followed
by programming of the SVI routes in the Forwarding Information Base (FIB).
If you have not enabled any Layer 3 features or configured
any Layer 3 interfaces, you can clear a Layer 3 license without having to reload the device. Then, you can perform a non-disruptive ISSU.
After clearing a Layer 3 license, you must copy the running-configuration to the startup-configuration and reload the device. Then, you can perform a non-disruptive ISSU.
After clearing a Layer 3 license, you must copy the running-configuration to the startup-configuration and reload the device. Then, you can perform a non-disruptive ISSU.
Although HSRP and VRRP do not need to be removed before clearing a Layer 3 license, we recommend that you clear their configurations as well.
Although VRRP and HSRP can be configured without a Layer 3 license, they will not work without a Layer 3 license. If they are configured, non-disruptive ISSU is not supported.
Guidelines and Limitations for Layer 3 Interfaces
Layer 3 interfaces have the following configuration guidelines and limitations:
If you change a Layer 3 interface to a Layer 2 interface, Cisco NX-OS shuts down the interface, reenables the interface, and removes all configuration specific to Layer 3.
If you change a Layer 2 interface to a Layer 3 interface, Cisco NX-OS shuts down the interface, reenables the interface, and deletes all configuration specific to Layer 2.
Default Settings for Layer 3 Interfaces
The default setting for the Layer 3 Admin state is Shut.
Configuring Layer 3 Interfaces
Configuring a Routed Interface
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
switch(config)#interface ethernetslot/port
Enters interface configuration mode.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
Step 3
switch(conifg-if)# no switchport
Configures the interface as a Layer 3 interface and deletes any configuration specific to Layer 2 on this interface.
Note
To convert a Layer 3 interface back into a Layer 2 interface, use the switchport command.
Configures the bandwidth parameter for a routed interface, port channel, or subinterface, as follows:
value—Size of the bandwidth in kilobytes. The range is from 1 to 10000000.
inherit—Indicates that all subinterfaces of this interface inherit either the bandwidth value (if a value is specified) or the bandwidth of the parent interface (if a value is not specified).
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.
This example shows how to add a Layer 3 interface to the VRF:
switch# configure terminal
switch(config)# interface loopback 0
switch(config-if)# vrf member RemoteOfficeVRF
switch(config-if)# ip address 209.0.2.1/16
switch(config-if)# copy running-config startup-config
Verifying the Layer 3 Interfaces Configuration
Use one of the following commands to verify the configuration:
Command
Purpose
show interface ethernetslot/port
Displays the Layer 3 interface configuration, status, and counters (including the 5-minute exponentially decayed moving average of inbound and outbound packet and byte rates).
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portbrief
Displays the Layer 3 interface operational status.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portcapabilities
Displays the Layer 3 interface capabilities, including port type, speed, and duplex.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portdescription
Displays the Layer 3 interface description.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portstatus
Displays the Layer 3 interface administrative status, port mode, speed, and duplex.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernet slot/port.number
Displays the subinterface configuration, status, and counters (including the f-minute exponentially decayed moving average of inbound and outbound packet and byte rates).
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface port-channel channel-id.number
Displays the port-channel subinterface configuration, status, and counters (including the 5-minute exponentially decayed moving average of inbound and outbound packet and byte rates).
show interface loopbacknumber
Displays the loopback interface configuration, status, and counters.
show interface loopbacknumberbrief
Displays the loopback interface operational status.
show interface loopbacknumberdescription
Displays the loopback interface description.
show interface loopbacknumberstatus
Displays the loopback interface administrative status and protocol status.
show interface vlannumber
Displays the VLAN interface configuration, status, and counters.
show interface vlannumberbrief
Displays the VLAN interface operational status.
show interface vlannumberdescription
Displays the VLAN interface description.
show interface vlannumberprivate-vlan mapping
Displays the VLAN interface private VLAN information.
show interface vlannumberstatus
Displays the VLAN interface administrative status and protocol status.
Monitoring Layer 3 Interfaces
Use one of the following commands to display statistics about the feature:
Command
Purpose
show interface ethernetslot/portcounters
Displays the Layer 3 interface statistics (unicast, multicast, and broadcast).
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portcounters brief
Displays the Layer 3 interface input and output counters.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portcounters detailed [all]
Displays the Layer 3 interface statistics. You can optionally include all 32-bit and 64-bit packet and byte counters (including errors).
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portcounters error
Displays the Layer 3 interface input and output errors.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/portcounters snmp
Displays the Layer 3 interface counters reported by SNMP MIBs. You cannot clear these counters.
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface ethernetslot/port.numbercounters
Displays the subinterface statistics (unicast, multicast, and broadcast).
Note
If this is a 10G breakout port, the slot/port syntax is slot/QSFP-module/port.
show interface port-channelchannel-id.numbercounters
Displays the port-channel subinterface statistics (unicast, multicast, and broadcast).
show interface loopbacknumbercounters
Displays the loopback interface input and output counters (unicast, multicast, and broadcast).
show interface loopbacknumbercounters detailed [all]
Displays the loopback interface statistics. You can optionally include all 32-bit and 64-bit packet and byte counters (including errors).
show interface loopbacknumbercounters errors
Displays the loopback interface input and output errors.
show interface vlannumbercounters
Displays the VLAN interface input and output counters (unicast, multicast, and broadcast).
show interface vlannumbercounters detailed [all]
Displays the VLAN interface statistics. You can optionally include all Layer 3 packet and byte counters (unicast and multicast).
show interface vlancounterssnmp
Displays the VLAN interface counters reported by SNMP MIBs. You cannot clear these counters.
Configuration Examples for Layer 3 Interfaces
This example shows how to configure Ethernet subinterfaces: