Thursday, October 16, 2008

How to create VLAN Interfaces for InterVLAN Routing in Cisco IOS

How to create VLAN Interfaces for InterVLAN Routing in Cisco IOS
Posted on Jul 01, 2008 under Cisco |

Tags:Cisco cisco-switch InterVLAn-Routing ios router switch vlan

VLAN Interfaces are required in network scenarios where you have different VLANs and need Inter-VLAN switching on Layer3 (Routing capable) switches. Every VLAN that needs to be routed should have a VLAN interface.

Let's say we have VLAN 10 which hosts the subnet 192.168.10.0 subnet, VLAN hosts 192.168.20.0 subnet and VLAN 30 hosts 192.168.30.0 subnet. For Inter-VLAN routing to work, we need to have a VLAN interface setup for each of these VLANs and configured with an IP address from the same subnet which will be the default Gateway for that subnet. Lets say, 192.168.10.254,192.168.20.254.192.168.30.254 are the IP addresses for VLAN Interfaces of VLAn 10,20,30 respectively.

Assuming the VLANs are configured already, let's proceed to get the VLAN interfaces created.

Enable Routing on the Switch

ciscoswitch# conf t

ciscoswitch(config)# ip routing

Add VLAN Interface

ciscoswitch(config)# interface vlan10

ciscoswitch(config-if)# no shut

ciscoswitch(config-if)# ip address 192.168.10.0 255.255.255.0

This configures a VLAN interface for VLAN 10.

Default Route on Switch

Add a default route on the Switch. This will forward all traffic from the different VLANs to the default router.

ciscoswitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.100.1

Interface to the Router

If the switch cannot reach the default router through a VLAN then an interface that connects to the router which does these routing needs to configured as a routed interface and assigned with an IP address that is in the same subnet as that of the Default router.

ciscoswitch(config)# interface gi0/1

ciscoswitch(config-if)# no shut

ciscoswitch(config-if)# no switchport

ciscoswitch(config-if)# ip address 192.168.100.2 255.255.255.0

This makes the inerface as a routed interface and assigns an IP address in the same subnet as the default router.
Related Posts

* Unable to delete Stale/Obsolete statc routes in Cisco IOS (Jul 03, 2008)
* High CPU usage when SNMP is enabled in Cisco Routers (Jun 19, 2008)
* Configure MD5 encrypted passwords for users on Cisco IOS (May 20, 2008)
* Enable/Configure DHCP Snooping in Cisco Catalyst Switches (IOS) (May 15, 2008)
* Allow user view Running/Startup-Config (red-only) in Cisco IOS (May 12, 2008)

url:http://www.itsyourip.com/cisco/how-to-create-vlan-interfaces-for-intervlan-routing-in-cisco-ios/

1 comment:

network said...

wow.. great . thanhs . iwant to learning Cisco network .
Visit my blog. Cisconas.blogspot.com