Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Interview question

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

Re: Interview question

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.

14 REPLIES

Re: Interview question

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,

New Member

Re: Interview question

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

Re: Interview question

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.

New Member

Re: Interview question

what would be the switch config?

Re: Interview question

interface fastethernet0/1

description Trunk to Router

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 10-15

switchport mode trunk

speed 100

duplex full

New Member

Re: Interview question

but u said Vlan creation in on Switch

"The vlan creation is on the switch "

Re: Interview question

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.

New Member

Re: Interview question

Hey Adam,

Thx for ur valuable time

rgds

Ganesh-----

New Member

Re: Interview question

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

switchport trunk allowed vlan add 16

New Member

Re: Interview question

Sure

Hall of Fame Super Gold

Re: Interview question

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.

Re: Interview question

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

Hall of Fame Super Gold

Re: Interview question

My apologies. :)

New Member

Re: Interview question

.

231
Views
5
Helpful
14
Replies
CreatePlease to create content