Configure Inter VLAN Routing on Cisco Catalyst Switches
|
|
|
|
Introduction
This document provides instructions on how to configure Inter VLAN
routing on your Cisco Catalyst Switches. This procedure applies to Cisco
Catalyst 3550, 3560, 3750 and 4500 series switches which runs Cisco IOS
software.
Back to Top
Requirements
To perform the steps described in this document, you need these
items:
-
Complete the initial configuration of the switch as instructed in,
Configure
a Catalyst Switch with Cisco Network Assistant.
-
A console cable. Refer to,
Cable
Descriptions for more information about cables.
-
Terminal emulation software such as HyperTerminal.
-
A switch that runs Cisco IOS Software Release 12.1(11)EA1 or later
for SMI images or any EMI image.
-
Complete the Switch Port Assignment Worksheets as instructed in the
Site
Survey.
Back to Top
Inter VLAN Routing Overview
VLANs are used to separate a switched network into different broadcast
domains, where each VLAN is a separate broadcast domain. Devices in each VLAN
can communicate with other devices of the same VLAN. For communicating with
devices of other VLANs routing is required to be done between the VLANs, and
this is known as inter VLAN routing. For switches that do not support the
routing feature (e.g. Catalyst 2950) a separate router, connected to the
switch, is required to do routing between the VLANs. Catalyst 3550, 3560, 3750
and 4500 series switches support inter VLAN routing.
This document assumes that all the devices are directly connected to
the switch on which inter VLAN routing needs to be configured. This switch,
then connects to a router that is used to route the traffic destined to the
outside network or to the Internet. This connection is done via interface
FastEthernet 0/1 on the switch. However, if you have devices that connect to a
separate switch that connects to the switch on which inter VLAN routing is to
be configured, make sure the link between these two switches is a trunk. The
default gateway for devices connected to the switch is the VLAN interface ip
address of the respective VLAN to which the device belongs.
Note: To restrict certain VLANs from participating in inter VLAN routing,
you need to use ACLs to deny communication between them. Refer to,
ACL
configuration on Catalyst switches using CLI.
Back to Top
Connect to the Switch
Follow these steps to connect your PC to the switch for
configuration:
-
Connect a PC to the switch with a console cable.
-
Create a HyperTerminal connection to your switch. Refer to,
Create a
HyperTerminal Connection for more information.
-
Log into the switch with the login and password that you entered in
fields B10 and B11 of the Switch Worksheet.
Username:admin
Password:
-
Type enable and press Enter to
access the privileged mode. Type the enable password that you entered in field
S5 of the Switch Port Assignment Worksheet.
switch>enable
Password:
Back to Top
Configure Inter VLAN Routing on the Switch
Follow these steps to configure switch for inter VLAN
routing:
-
Enter the global configuration mode.
-
Create the VLANs, if they are not already created. Use the
vlan command followed by vlan id.
-
Enter the exit command to come back to global
configuration mode.
-
To configure the vlan, enter the interface vlan
command followed by the vlan id of the vlan just created.
-
Assign an ip address to this VLAN, which acts as default gateway
address to the devices in this VLAN, using the ip address
command followed by an ip address and subnet mask.
-
Enter the no shutdown command to bring up the
interface.
Switch#configure terminal
Switch(config)#vlan 21
Switch(config-vlan)#exit
Switch(config)#interface vlan 21
Switch(config-if)#ip address 192.168.11.1 255.255.255.0
Switch(config-if)#no shutdown
Note: Repeat this step to configure other VLANs on your switch, if not
already configured.
-
To assign the interfaces to the respective VLAN, if not already
assigned, use the interface command followed by the interface
name and module number/port number in interface configuration mode.
-
Enter the switchport command to make this
interface a Layer 2 interface.
-
Enter the switchport access vlan command
followed by the respective vlan ID to which the port belongs.
-
Enter the no shutdown command to bring up the
interface.
-
Enter the exit command to come out of the
configuration mode.
Switch(config)#interface FastEthernet 0/2
Switch(config-if)#switchport
Switch(config-if)#switchport access vlan 21
Switch(config-if)#no shutdown
Switch(config-if)#exit
Note: Repeat this step to assign other switch interfaces to their
respective VLANs, if not already assigned.
-
Enter the ip routing command to enable the routing
feature globally on the switch.
Switch(config)#ip routing
Note: If the switch does not take this command, Cisco IOS does not
support this feature. Upgrade Cisco IOS Software Release 12.1(11)EA1 or later
for SMI images or to an EMI image and repeat this step.
-
Get into the interface that connects to the upstream router using
the interface command followed by interface name, and then
enter the no switchport command to make this interface Layer 3
capable.
Switch(config)#interface FastEthernet 0/1
Switch(config-if)#no switchport
-
Assign an appropriate ip address to this interface using the
ip address command followed by an ip address and subnet mask,
and enter the no shutdown command to bring up the
interface.
Switch(config-if)#ip address 192.168.10.11 255.255.255.0
Switch(config-if)#no shutdown
-
Configure a default route on the switch to the upstream router for
the traffic to the outside network or the Internet using the ip
route command and the ip address of the upstream router at the
end.
Switch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1
-
Enter the end command to come out of the
configuration mode. Enter the copy running-config
startup-config command to save the configuration to NVRAM.
Switch(config)#end
Switch#copy running-config startup-config
Back to Top
Verify your configuration
Enter the show ip route command in the privilege exec
mode and analyze the output. The output must contain one static default route
to the upstream router and one entry for each VLAN configured on the
switch.
Switch#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 192.168.10.1 to network 0.0.0.0
C 192.168.10.0 is directly connected, FastEthernet 0/1
C 192.168.11.0 is directly connected, Vlan21
C 192.168.12.0 is directly connected, Vlan22
S* 0.0.0.0/0 [1/0] via 192.168.10.1
Back to Top
Next Step
You have completed Configuring Inter VLAN routing on your Cisco
Catalyst Switch.
Refer to the
Switch
Support Page to make further changes to your switch.
Refer to the
Configuration
Overview Page to configure other devices in your network.
Back to Top
Troubleshoot the Procedure
This section provides information about common problems that you may
encounter. If this information does not solve your problem, contact the
SMB
Technical Assistance Center (SMB TAC) for assistance.
Problem
|
Cause(s) and Suggested Solution(s)
|
The switch boots and displays several error messages but does
not display a prompt in HyperTerminal.
|
Press Enter to clear the output and display
the switch prompt.
Contact the
SMB
Technical Assistance Center (SMB TAC) for further
assistance.
|
Back to Top
Related Information