Reference Guide

Table Of Contents
You can enable L2 switching on a port interface in access or trunk mode. By default, an interface is configured in access mode.
Access mode allows L2 switching of untagged traffic on a single VLAN (VLAN 1 is the default). Trunk mode enables L2 switching
of untagged traffic on the access VLAN, and tagged traffic on multiple (one or more) VLANs.
By default, native VLAN of a port is the default VLAN ID of the switch. You can change the native VLAN using the
switchport access vlan vlan-id command.
A trunk interface carries VLAN traffic that is tagged using 802.1q encapsulation. If an access interface receives a packet with an
802.1q tag in the header that is different from the access VLAN ID, it drops the packet.
By default, a trunk interface carries only untagged traffic on the access VLAN you must manually configure other VLANs for
tagged traffic.
1. Select one of the two available options:
Configure L2 trunking in INTERFACE mode and the tagged VLAN traffic that the port can transmit. By default, a trunk
port is not added to any tagged VLAN. You must create a VLAN before you can assign the interface to it.
switchport mode trunk
switchport trunk allowed vlan vlan-id-list
Reconfigure the access VLAN assigned to a L2 access or trunk port in INTERFACE mode.
switchport access vlan vlan-id
2. Enable the interface for L2 traffic transmission in INTERFACE mode.
no shutdown
L2 interface configuration
OS10(config)# interface ethernet 1/1/7
OS10(conf-if-eth1/1/7)# switchport mode trunk
OS10(conf-if-eth1/1/7)# switchport trunk allowed vlan 5,10
OS10(conf-if-eth1/1/7)# no shutdown
L3 mode configuration
Ethernet and port-channel interfaces are in L2 access mode by default. When you disbale L2 mode and then assign an IP
address to an Ethernet port interface, you place the port in L3 mode.
Configure one primary IP address in L3 mode. You can configure up to 255 secondary IP addresses on an interface. At least one
interface in the system must be in L3 mode before you configure or enter a L3 protocol mode, such as OSPF.
1. Remove a port from L2 switching in INTERFACE mode.
no switchport
2. Configure L3 routing in INTERFACE mode. Add the keyword secondary to configure backup IP addresses.
ip address address [secondary]
3. Enable the interface for L3 traffic transmission in INTERFACE mode.
no shutdown
L3 interface configuration
OS10(config)# interface ethernet 1/1/9
OS10(conf-if-eth1/1/9)# no switchport
OS10(conf-if-eth1/1/9)# ip address 10.10.1.92/24
OS10(conf-if-eth1/1/9)# no shutdown
View L3 configuration error
OS10(config)# interface ethernet 1/1/1
OS10(conf-if-eth1/1/1)# ip address 1.1.1.1/24
% Error: remove Layer 2 configuration before assigning an IP
78
Interfaces