10-14
Cisco 7600 Series Router Cisco IOS Software Configuration Guide, Release 12.2SX
OL-4266-08
Chapter 10 Configuring LAN Ports for Layer 2 Switching
Configuring LAN Interfaces for Layer 2 Switching
Configuring a LAN Interface as a Layer 2 Access Port
Note
If you assign a LAN port to a VLAN that does not exist, the port is shut down until you create the VLAN
in the VLAN database (see the
“Creating or Modifying an Ethernet VLAN” section on page 14-10
).
To configure a LAN port as a Layer 2 access port, perform this task:
This example shows how to configure the Fast Ethernet port 5/6 as an access port in VLAN 200:
Router#
configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
interface fastethernet 5/6
Router(config-if)#
shutdown
Router(config-if)#
switchport
Router(config-if)#
switchport mode access
Router(config-if)#
switchport access vlan 200
Router(config-if)#
no shutdown
Router(config-if)#
end
Router#
exit
Command
Purpose
Step 1
Router(config)#
interface
type
1
slot/port
1.
type
=
ethernet
,
fastethernet
,
gigabitethernet
, or
tengigabitethernet
Selects the LAN port to configure.
Step 2
Router(config-if)#
shutdown
(Optional) Shuts down the interface to prevent traffic flow
until configuration is complete.
Step 3
Router(config-if)#
switchport
Configures the LAN port for Layer 2 switching.
Note
You must enter the
switchport
command once
without any keywords to configure the LAN port
as a Layer 2 port before you can enter additional
switchport
commands with keywords.
Step 4
Router(config-if)#
no switchport
Clears Layer 2 LAN port configuration.
Step 5
Router(config-if)#
switchport mode access
Configures the LAN port as a Layer 2 access port.
Router(config-if)#
no switchport mode
Reverts to the default switchport mode (
switchport mode
dynamic desirable
).
Step 6
Router(config-if)#
switchport access vlan
vlan_ID
Places the LAN port in a VLAN. The
vlan_ID
value can
be 1 through 4094, except reserved VLANs (see
Table 14-1 on page 14-2
).
Router(config-if)#
no switchport access vlan
Reverts to the default access VLAN (VLAN 1).
Step 7
Router(config-if)#
no shutdown
Activates the interface. (Required only if you shut down
the interface.)
Step 8
Router(config-if)#
end
Exits configuration mode.
Step 9
Router#
show running-config interface
[
type
1
slot/port
]
Displays the running configuration of the interface.
Step 10
Router#
show interfaces
[
type
1
slot/port
]
switchport
Displays the switch port configuration of the interface.