cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
834
Views
5
Helpful
14
Replies

Interview question

gandhi.ganesh
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

14 Replies 14

adamclarkuk_2
Level 4
Level 4

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,

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

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.

what would be the switch config?

interface fastethernet0/1

description Trunk to Router

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 10-15

switchport mode trunk

speed 100

duplex full

but u said Vlan creation in on Switch

"The vlan creation is on the switch "

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.

Hey Adam,

Thx for ur valuable time

rgds

Ganesh-----

If there are additional vlans in the future, make sure you use the keyword "add"

switchport trunk allowed vlan add 16

Sure

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.

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

My apologies. :)

sdoremus33
Level 3
Level 3

.

Getting Started

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: