InterVLAN Routing

This topic is to discuss the following lesson:

Rene,

I have a Cisco SG300-28 PoE+ switch and am having an old age moment in setting up VLans. Would you know the answer to or be able to assist with the following:

My network has:

1 router, which also handles DHCP duties with one range currently specified 192.168.1.x/24
1 switch
1 WAP
and about 40 nodes

I want to create multiple VLANS on the Cisco SG300 switch.

Vlan10 - Mgmnt
Vlan20 - Children
Vlan30 - AV
Vlan40 - Automation
Vlan50 - VoIP
Vlan60 - Guest

What are the steps necessary after creating the Vlans in this scenario to make things work?

WAP is on port 1 of the switch
ROUTER is on port 2 of the switch

I am using a browser to access and manage the Cisco SG300-28PP switch

I currently have the switch in L3 mode.

I was planning on establishing the following network ranges to match Vlan IDs.

Vlan10 - Mgmnt - 192.168.10.x/24
Vlan20 - Children - 192.168.20.x/24
Vlan30 - AV - 192.168.30.x/24
Vlan40 - Automation - 192.168.40.x/24
Vlan50 - VoIP - 192.168.50.x/24
Vlan60 - Guest - 192.168.60.x/24

In each network range I will be using x.x.x.200 to x.x.x.230 as the DHCP range

What is necessary to accomplish all of this?

Hi JT,

I did a write-up once for the SG300, it might help:

If you run the SG300 in L3 mode then it can route between the VLANs and you can use it as a DHCP server. There are a couple of things you have to do if you want your hosts in the different VLANs to use the router for Internet access.

First you’ll need another subnet between the SG300/router so that they can reach each other.

Once you can ping between the SG300/router, you’ll need three more things:

  • The SG300 requires a default route pointing to the router, without it the SG300 has no idea where to forward traffic destined to the Internet.
  • The router requires static routes for all your 192.168.xx.x/24 networks or it will have no idea how to reach these networks.
  • The router has to NAT all 192.168.xx.x/24 networks.

In the link above I configured a trunk between the router/SG300 but that’s only needed if you want to use the router for all routing / DHCP server.

Hope this helps!

Rene

Question in regard SVI’s:
If I have 50 SVI’s configured then all the SVI’s can communicate with one another then How would you secure communication between them?
Please advise

Hi Alfredo,

You can attach access-lists to the SVI interfaces, this will prevent devices behind one SVI to communicate with devices in another SVI.

Just follow this example but attach it to the SVI interface:

Rene

I studied my CCNP SWITCH but going through your training I came to realize that I have gaps of information that I never saw on my training.

Thanks and keep the good work.

1 Like

Hello Rene,

Thanks for the article,
I tried to do "switchport trunk encapsulation dot1q "
and the switch did not accept it?
could you please let me know why is that?

Wisam

1 Like

Hi Wisam,

What switch model did you use?

Rene

I did use packet tracer.

Wisam

Hi Wisam,

Ok, it’s possible that it’s not supported. Some switches suppot two trunking protocols; ISL and 802.1Q.

Some (newer) switches only support 802.1q and these switches don’t support the “trunk encapsulation” command since they only support 1 trunking protocol.

Rene

1 Like

Hi Wisam,

Ok, it’s possible that it’s not supported. Some switches suppot two trunking protocols; ISL and 802.1Q.

Some (newer) switches only support 802.1q and these switches don’t support the “trunk encapsulation” command since they only support 1 trunking protocol.

Rene

1 Like

Thanks Rene.

What are the advantages and disadvantages of using SVI or Routed port? you mentioned to use svi if there are more than one interface in a VLAN. Can you elaborate as you which this way is better?

Thanks

1 Like

There are two types of interfaces…switchports (L2) or routed ports (L3). The switchport (as the name implies) only switches traffic and can belong to a VLAN.

The routed port doesn’t have a clue what a VLAN is but you can configure an IP address on it. These are the same interfaces as a router has.

If you have some devices that should be in the same VLAN then it’s best to use switchports, put them in the same VLAN and then use a SVI with an IP address that they can use as a default gateway.

The routed port is more suitable for a link to a router or something. You use a /30 subnet between the L3 interface on the switch and router and that’s it. You could also use the router port as a “router on a stick” with a trunk to a L2 switch perhaps.

Rene

Rene

2 Likes

Rene

SwitchA(config)#interface fa0/3
SwitchA(config-if)#switchport trunk encapsulation dot1q 
SwitchA(config-if)#switchport mode trunk 
SwitchA(config-if)#switchport trunk allowed vlan 10,20

Does switchport trunk allowed vlan 10, 20 exclude native vlan 1 from accessing these 2 trunk links?
Or does vlan 1 have default access to all vlans trunked and non trunked?

Thanks

2 Likes

Hi Donald,

By default all VLANs are allowed so if you only want VLAN 10 and 20 on it, you should remove all VLANs and then use the “allowed vlan” command.

Rene

1 Like

HI Rene

Hope u r doing great.

Can we pass the VLAN traffic (layer 2 traffic) between two routers/ layer 3 switch?

Also I am trying to make a trunk port between L3 3750 switch and switch-260 but trunk is not forming or neither its giving any error.

Hi Shinu,

I’m doing great, hope you as well.

You could make VLAN traffic pass a router if you want by bridging two interfaces together. It’s not a common thing to do however. On a L3 switch it’s easier, just use switchports like you normally do.

About the trunk, not sure what brand your 260 switch is but if it supports 802.1Q, it should be possible. Just make sure the 3750 is configured in trunk mode and not dynamic auto or desirable.

Rene

Rene,
Hi. In the example at the beginning with the router serving as the L3 GW for two VLANs what is the native VLAN if any in this particular instance? Is one required?

Thanks,
Thomas

Hi Thomas,

The default native VLAN 1 is one but it’s not used or required in that example. We use the native vlan for some management protocols like PaGP, LACP, VTP, CDP, etc.

Rene