Documente Academic
Documente Profesional
Documente Cultură
Page 1 of 26
Submit Query
To allow hosts in different VLANs communicate with each other, we need a Layer 3 device (like a
router) for routing:
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 2 of 26
The routing traffic from one VLAN to another VLAN is called InterVLAN routing.
Now host A can communicate with host C or D easily. Now lets see how the traffic is sent from host A
to host D. First, host A knows the destination host is in a different VLAN so it sends traffic to its default
gateway (on the router) through the switch. The switch tags the frame as originating on VLAN 10 and
forwards to the router. In turn, the router makes routing decision from VLAN 10 to VLAN 20 and sends
back that traffic to the switch, where it is forwarded out to host D.
Notice that the routing decision to another VLAN is done by the router, not the switch. When frames
leave the router (step 3 in the picture above), they are tagged with VLAN 20.
Also notice that receiving ends (host A & D in this case) are unaware of any VLAN information. Switch
attaches VLAN information when receiving frames from host A and removes VLAN information before
forwarding to host D.
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 3 of 26
But there is one disadvantage in the topology above: for each VLAN we need a physical connection
from the router to the switch but in practical, the interfaces of the router are very limited. To overcome
this problem, we can create many logical interfaces in one physical interface. For example from a
physical interface fa0/0 we can create many sub-interfaces like fa0/0.0, fa0/0.1 Now this router is
often called router on a stick (maybe because there is only one physical link connecting from router so
it looks like a router on a stick ^^)
The router treats each sub-interface as a separate physical interface in routing decisions -> data can be
sent and received in the same physical interface (but different sub-interfaces) without being dropped by
the split-horizon rule in the case you want to send routing updates through the router from one VLAN to
another.
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 4 of 26
must be implemented on both router and switch. Lets see what actions need to be completed when we
want to configure InterVLAN in router on a stick model using the above topology.
+ The switch port connected to the router interface must be configured as trunk port.
+ The router sub-interfaces must be running a trunking protocol. Two popular trunking protocols in
CCNA are 802.1q (open standard) and InterSwitch Link (ISL, a Cisco propriety protocol).
+ Set IP address on each sub-interface.
To help you understand more clearly about InterVLAN, the main configuration of router & switch are
shown below:
Configure trunk port on switch:
Switch(config)#interface f0/0
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode trunk
Create sub-interfaces, set 802.1Q trunking protocol and ip address on each sub-interface
Router(config)#interface f0/0
Router(config-if)#no shutdown
(Note: The main interface f0/0 doesnt need an IP address but it must be turned on)
Router(config)#interface f0/0.0
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config-subif)#interface f0/0.1
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
(Note: In the encapsulation dot1q 10 command, 10 is the VLAN ID this interface operates in)
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 5 of 26
I also list the full configuration of the above topology for your reference:
Configure VLAN
Switch(config)#vlan 10
Switch(config-vlan)#name SALES
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name TECH
Set ports to access mode & assign ports to VLAN
Switch(config)#interface range fa0/1-2
Switch(config-if)#no shutdown
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)#interface range fa0/3-4
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode access
Switch(config-if)# switchport access vlan 20
In practical, we often use a Layer 3 switch instead of a switch and a router on the stick, this helps
reduce the complexity of the topology and cost.
Note: With this topology, we dont need to use a trunking protocol and the switchport mode trunk
command. The full configuration of Layer 3 switch is listed below:
Switch configuration
ip routing
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 6 of 26
interface Vlan10
ip address 192.168.10.1 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
And on hosts just assign IP addresses and default gateways (to the corresponding interface VLANs) ->
hosts in different VLANs can communicate.
In summary, InterVLAN routing is used to permit devices on separate VLANs to communicate. In this
tutorial you need to remember these important terms:
+ Router-on-a-stick: single physical interface routes traffic between multiple VLANs on a network.
+ Subinterfaces are multiple virtual interfaces, associated with one physical interface. These
subinterfaces are configured in software on a router that is independently configured with an IP address
and VLAN assignment.
Comments (50) Comments
1. a.daqare
February 24th, 2012
thank you this is really good information. Keep up the good work
2. Bob
February 26th, 2012
its wonderful congrats!!!
3. Jien
February 27th, 2012
Hi, there are minor wrong word on Create sub-interfaces, set 802.1Q trunking protocol and ip
address on each sub-interface
Router(config)#interface f0/0
Router(config-if)#no shutdown
(Note: The main interface f0/0 doesnt need an IP address but it must be turned on)
Router(config-if)#interface f0/0.0 (before create the sub interface, it suppose still in interface
mode)
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config-subif)#interface f0/0.1
Router(config-subif)#encapsulation dot1q 20 (i amend to dot1q, as u wrote to dot11)
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 7 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 8 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 9 of 26
ellary do appreciate you stopping by and leaving a quick note. It helps fuel my motivation to keep
going. I hope I was able to help and move you closer to your next Cisco Certification.
16. janjo
May 7th, 2012
SPLENDID!!! Thank you for this wonderful information.
Cheers!!
17. Having problem.
May 22nd, 2012
Hi everyone,
I am currently using cisco catalyst 3750 series (POE-48) switch.
I was given a scenario to test out. But there is some problem.
Requirements: PC1 in VLAN 10 able to ping PC2 in VLAN 30 and vice versa too.
I tried the approach as stated in the layer 3 switch in 9tut, but i still not able get the hosts to ping
each other.
My current Switch Configuration file is in the url below.
http://pastebin.ca/2151923
1. Create 4 VLANS
VLAN 10 NAME: Server_VLAN
VLAN 15 NAME: Client_VLAN
VLAN 20 NAME: Demo_VLAN
VLAN 30 NAME: Test_VLAN
2. Port Assignments
VLAN 10 Fa1/0/1 12
VLAN 15 Fa1/0/13 24
VLAN 20 Fa1/0/25 36
VLAN 30 Fa1/0/37 43
3. IP
VLAN 10 10.1.10.0/24
VLAN 15 10.1.15.0/24
VLAN 20 10.1.20.0/24
VLAN 30 10.1.30.0/24
18. Having problem.
May 23rd, 2012
It works! realises it my window firewall issues! thanks!
19. Wario
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 10 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 11 of 26
no aaa new-model
system mtu routing 1500
ip subnet-zero
ip routing
!
!
!
!
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/3
switchport mode access
!
interface FastEthernet0/4
switchport mode access
!
interface FastEthernet0/5
switchport mode access
!
interface FastEthernet0/6
switchport mode access
!
interface FastEthernet0/7
switchport mode access
!
interface FastEthernet0/8
switchport mode access
!
interface FastEthernet0/9
switchport mode access
!
interface FastEthernet0/10
switchport mode access
!
interface FastEthernet0/11
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 12 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 13 of 26
!
interface Vlan10
ip address 192.168.17.200 255.255.255.0
!
interface Vlan20
ip address 192.168.20.200 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.17.1
ip http server
!
!
!
control-plane
!
!
line con 0
line vty 0 4
login
line vty 5 15
login
!
end
Switch#sh vlan
VLAN Name Status Ports
- 1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Gi0/1, Gi0/2
10 vlan10 active Fa0/1
20 vlan20 active Fa0/23, Fa0/24
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
- - -
1 enet 100001 1500 0 0
10 enet 100010 1500 0 0
20 enet 100020 1500 0 0
1002 fddi 101002 1500 0 0
1003 tr 101003 1500 0 0
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 14 of 26
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
- - -
1004 fdnet 101004 1500 ieee 0 0
1005 trnet 101005 1500 ibm 0 0
Remote SPAN VLANs
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 15 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 16 of 26
@straut:
I am new to the CCNA, i think you need to set password over the console and telnet.
there you didnt set anything over there
let me know whether it is applicable or not?
Regards
ravi mishra
23. Aloha
July 10th, 2012
@blake
You have to set the default gateway as that of vlan address, if not the packet will be dropped
24. MINI
July 10th, 2012
@stuart
I think you have to set the ip address of the Vlan as your default gateway on the pc, so that they
will know where the packet has to go.
25. Anu Tiger
July 15th, 2012
Sir I made this scenario in packet tracer with your suggested configuration. but I made 3 vlans in
the palace of these 2s. (VLAN2, VLAN3, VLAN10).
But all vlans are unable to communicate with each other.
I paste down my configuration :SWITCH
#do sh run
Building configuration
Current configuration : 1073 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 17 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 18 of 26
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
#do sh vlan
VLAN Name Status Ports
- 1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
2 A active Fa0/2
3 D active Fa0/3
10 S active Fa0/4
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
- - -
1 enet 100001 1500 0 0
2 enet 100002 1500 0 0
3 enet 100003 1500 0 0
10 enet 100010 1500 0 0
1002 fddi 101002 1500 0 0
1003 tr 101003 1500 0 0
1004 fdnet 101004 1500 ieee 0 0
1005 trnet 101005 1500 ibm 0 0
Remote SPAN VLANs
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 19 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 20 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 21 of 26
or you can give the default gateway on each pc to that you have configured on the sub interface
Hope this works please post if you still encounter any problem.
Best Regards,
XXXXXXXXX
27. Andy
July 26th, 2012
Why is the ACL applied to F0/1 out and not F0/0 in. Shouldnt extended ACLs be applied nearest
to the source, F0/0 in?
28. Andy
July 26th, 2012
Whoa sorry Wrong tab
29. King
September 13th, 2012
Excellent work! I like your website. My question is- if I do everything from this site and dont do
any dumps. Will I pass? I find this website very useful and personally feel I dont need to study
from any dumps. Pls suggest.
30. tofik bhati
September 29th, 2012
thank u i am understand
31. Dhinesh
October 5th, 2012
what is commandto convert L3 switch as router..
32. Anonymous
October 18th, 2012
I need InterVLAN Routing tutorial from 9tut.com
Can anyone send me at haigoo77@live.com
33. ketan
October 20th, 2012
thanks for help
34. arnoldrs
November 25th, 2012
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 22 of 26
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 23 of 26
Can you please provide the configuration example of both ends. Would be great help. Thanks!!!
42. Anonymous
October 31st, 2014
Can anyone send inter vlan routing configuration detail steps.
43. kannan
December 4th, 2014
small mistake contain
44. Rex
March 17th, 2015
@ stuart: I think Its easier to use router on a stick. And I dont see any interfaces configured as
trunk links.Like the interfaces connecting your router to the switch. Try that if itll work: )
45. jjs1234
April 10th, 2015
Inter Vlan routing is easy. You need to set up DHCP aswell and make sure the default gateway is
pointed correctly for each vlan.
Conf Term
Service Dhcp
ip dhcp pool (name)
network (Network) (Subnet)
Default router (IP of Gateway)
DNS Server 8.8.8.8
It should all work for you guys. IVR will work if no DHCP just have to manually set your
gateway/IP/Subnet etc.
46. dereje
August 7th, 2015
Its good but something not clear about encapsulation dotq
47. Emeka
September 18th, 2015
Check out additional CCNA dumps at exams(dot)eu(dot)pn or at exams(dot)cf.
48. Eliseu
September 18th, 2015
There is a new site called exams(dot)cf which has new CCNA dumps. Download the VCE dumps
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 24 of 26
at exams(dot)cf.
49. Nishit
October 7th, 2015
Trunk port can we directly connect to computer?
50. Manish Pathak
December 5th, 2015
Do we expecxt different and new diagrams and network tolpology to understand it more wider in
depth.
Add a Comment
Name
Submit Comment
Premium Membership
Become a member to interact with all questions and read all tutorials, labs!
CCNA 200-120
z
z
z
z
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
z
Page 25 of 26
CCNA Self-Study
z
z
z
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015
Page 26 of 26
Network Resources
z
ICND1/ICND2 Website
CCIE Website
Top
http://www.9tut.com/intervlan-routing-tutorial
12/15/2015