IntroductionThis document provides the configuration and troubleshooting steps applicable to the creation of Layer 3 interfaces. VLANs divide broadcast domains in a LAN environment. Whenever hosts in one VLAN need to communicate with hosts in another VLAN, the traffic must be routed between them. This is known as inter-VLAN routing. On Catalyst switches it is accomplished by the creation of Layer 3 interfaces (switch virtual interfaces (SVIs) ).Note: This document uses a Catalyst 3550 as an example.
However, the concepts can also be applied to other Layer 3 switches that run Cisco IOS 速 (for example, Catalyst 3560, 3750, Catalyst 4500/4000 Series with Sup II+ or later, or Catalyst 6500/6000 Series that run Cisco IOS System software). Prerequisites RequirementsCatalyst switch models 3560, 3750, Catalyst 4500/4000 Series with Sup II+ or later, or Catalyst 6500/6000 Series that run Cisco IOS system software support basic InterVLAN routing features in all their supported software versions. Before you attempt this configuration on a 3550 series switch, ensure that you meet these prerequisites:.InterVLAN routing on the Catalyst 3550 has certain software requirements in order to support interVLAN routing on the switch. See this table in order to determine whether your switch can support interVLAN routing. Image Type and Version.
YesFor more information on the differences between SMI and EMI, refer to. This document also provides the procedure to upgrade the Cisco IOS code to a version that supports interVLAN routing.This document assumes that Layer 2 has been configured and that the devices within the same VLAN connected to the 3550 communicate with one another.
A “router on a stick” (aka “one-armed router”) is a network configuration in which a single network switch is connected to a single LAN interface on a router. The network switch may be configured to have two or more VLANs to logically partition the network. The Router on a Stick setup allows the EdgeRouter to route traffic between VLANs by associating an Ethernet interface with multiple VLAN IDs. This allows the devices in different VLANs to communicate with each other through the EdgeRouter.
If you need information on how to configure VLANs, access ports, and trunking on the 3550, refer to for the specific Cisco IOS version you run on the switch.Components UsedThe information in this document is based on a Catalyst 3550-48 that runs Cisco IOS Software Release 12.2(44)SE6 EMI.The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command. Configure InterVLAN Routing TaskIn this section, you are presented with the information to configure the features described in this document.This logical diagram explains a simple interVLAN routing scenario.
The scenario can be expanded to include a multi-switch environment if you first configure and test inter-switch connectivity across the network before you configure the routing capability. For such a scenario that uses a Catalyst 3550, refer to.Step-by-Step InstructionsComplete these steps in order to configure a switch to perform interVLAN routing.Enable routing on the switch with the ip routing command. Even if IP routing was previously enabled, this step ensures that it is activated. Switch(config)# ip routingNote: If the switch does not accept the ip routing command, upgrade to either SMI image Cisco IOS Software Release12.1(11)EA1 or later, or an EMI image, and repeat this step.
![Router On A Stick Router On A Stick](/uploads/1/2/5/4/125437855/211011640.jpg)
See the section for more information.Tip: Check the show running-configuration. Verify whether ip routing is enabled. The command, if enabled, appears towards the top of the output.hostname Switch!!ip subnet-zeroip routing!vtp domain Ciscovtp mode transparent.Make note of the VLANs that you want to route between. In this example, you want to route traffic between VLANs 2, 3 and 10.Use the show vlan command in order to verify that the VLANs exist in the VLAN database. If they do not exist, add them on the switch.
This example shows the addition of VLANs 2, 3, and 10 to the switch VLAN database Switch# vlan databaseSwitch(vlan)# vlan 2VLAN 2 added:Name: VLAN0002Switch(vlan)# vlan 3VLAN 3 added:Name: VLAN0003Switch(vlan)# vlan 10VLAN 10 added:Name: VLAN0010Switch(vlan)# exitAPPLY completed.Exiting.Tip: You can use VLAN Trunking Protocol (VTP) in order to propagate these VLANs to other switches. Refer to.Determine the IP addresses you want to assign to the VLAN interface on the switch.
![Stick Stick](/uploads/1/2/5/4/125437855/617417377.jpg)
For the switch to be able to route between the VLANs, the VLAN interfaces must be configured with an IP address. When the switch receives a packet destined for another subnet/VLAN, the switch looks at the routing table in order to determine where to forward the packet. The packet is then passed to the VLAN interface of the destination. It is in turn sent to the port where the end device is attached.Configure the VLAN interfaces with the IP address identified in step 4.
Switch# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)# interface Vlan2Switch(config-if)# ip address 10.1.2.1 255.255.255.0Switch(config-if)# no shutdownRepeat this process for all VLANs identified in step 1.Configure the interface to the default router. In this scenario you have a Layer 3 FastEthernet port. Switch(config)# interface FastEthernet 0/1Switch(config-if)# no switchportSwitch(config-if)# ip address 200.1.1.1 255.255.255.0Switch(config-if)# no shutdownThe no switchport command makes the interface Layer 3 capable. The IP address is in the same subnet as the default router.Note: This step can be omitted if the switch reaches the default router through a VLAN. In its place, configure an IP address for that VLAN interface.Configure the default route for the switch.
Switch(config)# ip route 0.0.0.0 0.0.0.0 200.1.1.2From the diagram in the section, note that the IP address of the default router is 200.1.1.2. If the switch receives a packet for a network not in the routing table, it forwards it to the default gateway for further processing. From the switch, verify that you can ping the default router.Note: The ip default-gateway command is used to specify the default gateway when routing is not enabled. However, in this case, routing is enabled (from step 1). Therefore, the ip default-gateway command is unnecessary.Configure your end devices to use the respective Catalyst 3550 VLAN interface as their default gateway. For example, devices in VLAN 2 should use the interface VLAN 2 IP address as its default gateway. Refer to the appropriate client configuration guide for more information on how to designate the default gateway.(Optional) When you implement Inter-VLAN routing, you can also isolate some VLANs from being routed.
Refer to the section of for more information.This video on the demonstrates how to configure the InterVLAN routing on Catalyst 3550 Series Switch:VerifyThis section provides information in order to confirm that your configuration works properly.show ip route - Provides a snapshot of the routing table entries.