02-27-2009 02:22 AM - edited 03-06-2019 04:17 AM
Hi,
I have attended an interview they asked me one simple question but i have some dought on my answer.
question: A router with single interface connected to L2 switch, we want 5 Vlans
where do we create the Vlans?
where to add the route for intervlan comm?
Solved! Go to Solution.
02-27-2009 03:36 AM
By vlan creation, I meant
switch(config)#vlan 10
switch(config-vlan)#name Vlan-10
switch(config)#vlan 20
switch(config-vlan)#name Vlan-20
on the switch itself (or from the vlan database depending on the switch model/IOS)
switch#vlan database
switch(vlan)#vlan 10 name vlan-10
then assign interfaces to the vlans
switch#conf t
switch(config)#interface fastethernet1/1
switch(config-if)#switchport mode access
switch(config-if)#switchport access vlan 10
The router interfaces is just sending and recieving tagged frames, not creating vlans.
02-27-2009 02:25 AM
Hi
The link to the Router should be trunk and the the router has a sub interface for each vlan. The vlan creation is on the switch with ports assigned to each vlan and all 5 vlans are added to the trunk going up to the router.
So the routing is handled by the only Layer 3 device you have ie the router,
02-27-2009 02:49 AM
Lets consider router interface is Fe0/1
correct me if I am wrong
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown.
interface FastEthernet0/1.10
description **Vlan 10 *****
ip address 192.168.10.0 255.255.255.0
no shutdown
interface FastEthernet0/1.11
description **Vlan 11 *****
ip address 192.168.11.0 255.255.255.0
no shutdown
interface FastEthernet0/1.12
description **Vlan 12 *****
ip address 192.168.12.0 255.255.255.0
no shutdown
From 13 - 15
02-27-2009 02:58 AM
That's not right.
If this is a router not a Layer 3 switch then there is no switch mode trunk command. You tell the router which TAG'd frame belongs to which interface using the encapsulation sub interface command.
The router config would be
interface FastEthernet0/1
speed 100
duplex full
interface FastEthernet0/1.10
description Vlan 10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface FastEthernet0/1.20
description Vlan 20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
You have used the network address as a host address which is also wrong.
02-27-2009 03:07 AM
what would be the switch config?
02-27-2009 03:11 AM
interface fastethernet0/1
description Trunk to Router
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10-15
switchport mode trunk
speed 100
duplex full
02-27-2009 03:29 AM
but u said Vlan creation in on Switch
"The vlan creation is on the switch "
02-27-2009 03:36 AM
By vlan creation, I meant
switch(config)#vlan 10
switch(config-vlan)#name Vlan-10
switch(config)#vlan 20
switch(config-vlan)#name Vlan-20
on the switch itself (or from the vlan database depending on the switch model/IOS)
switch#vlan database
switch(vlan)#vlan 10 name vlan-10
then assign interfaces to the vlans
switch#conf t
switch(config)#interface fastethernet1/1
switch(config-if)#switchport mode access
switch(config-if)#switchport access vlan 10
The router interfaces is just sending and recieving tagged frames, not creating vlans.
02-27-2009 03:58 AM
Hey Adam,
Thx for ur valuable time
rgds
Ganesh-----
02-27-2009 07:01 AM
If there are additional vlans in the future, make sure you use the keyword "add"
switchport trunk allowed vlan add 16
02-27-2009 07:07 AM
Sure
02-27-2009 03:48 PM
Thanks for the solution, Adam.
I don't want to be pedantic or some sort, but your solution will work 90% or the time. The VLAN creation will not work 10% of the time if the switch are the 2900/3500XL series.
For these type of models, you need to create the VLAN's via the VLAN database.
vlan database
vlan 10
vlan 11
vlan 12
vlan 13
vlan 14
etc.
exit
Another thing is that for the new-generation of switches, once you've created the vlan interface, the switch will automatically create the vlan for you.
Some know-it-all tried this trick question during my interview and this was my response.
02-27-2009 06:30 PM
I did meantion that if you re read my post
*on the switch itself (or from the vlan database depending on the switch model/IOS)*
*switch#vlan database
*switch(vlan)#vlan 10 name vlan-10
02-27-2009 06:42 PM
My apologies. :)
02-27-2009 06:51 PM
.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: