The Cisco SG300-20 Switch is a great home lab switch that features most of the capabilities that ones see and use in the enterprise environment and for a cheap price. Â I wanted to write up a quick blog post on how to setup multiple VLANs on this switch as well as how I am using it in a small VMware lab environment. Â The really nice thing about the Cisco SG300-20 switdch is that it is easily configured via the web admin interface and it is fully managed.
Take a look at my post here on how to run basic setup on the Cisco SG300-20 switch for use in a VMware lab.  We didn’t cover setting up VLANs in that particular post, so let’s take a look at that today.
Creating the VLAN
If you are wanting to create VLANs and do some cool inter-vlan routing the switch needs to be in layer 3 (L3) mode. Â This is found under System Settings in the menu. Â Note that once you change switch modes, your password that you set will be wiped out and returned to factory default.
Click on the VLAN settings menu.
Click to Add a VLAN with the VLAN ID and name. Â Note below you can also add a range of VLANs by specifying the range in the VLAN ID field.
You can choose to save your configuration now or later if you see the blinking “save” notification.
To assign an IP address to the VLAN interface itself, click the IPv4 Interface option in the menu
Select the specific VLAN as the interface to assign an address to, enter your IP address and subnet mask and click apply.
Click on the Port to VLAN option in the menu to assign ports with the web GUI.
If you are planning on tagging several or all your ports with a particular VLAN, by far the quickest way is by using the command line to add a range of ports.
- Enter global config mode (config t)
- interface range gi1-20 (if selecting all ports)
- switchport trunk allowed vlan add 5 (this will add VLAN 5 to ports 1-20)
To confirm your VLANs created you can enter the command:
- show vlan
Or from the GUI, select the Port to VLAN option in the menu:
Final Thoughts
There you have it! Â You have created your first VLAN(s) on your Cisco SG300-20 switch. Â I will be posting soon on how to use your router (in my case Sophos UTM) to route traffic between the VLANs that are created on the switch.
Google is updating how articles are shown. Don’t miss our leading home lab and tech content, written by humans, by setting Virtualization Howto as a preferred source.










Hello,
Hope you are doing well mate. Thanks for the awesome article I need your advise on setting up sophos utm to act as a firewall as well as to port forward port 25 to my exchange server 2013.
Here is how i have setup my lab Justin.
I have a home router with subnet 192.168.1.X this is my primary internet connection. To isolate my lab i have purchased another router and connected my home wireless router LAN port to the lab router WAN port. I have my home network IP as my WAN IP (192.168.1.200) and created 172.16.1.X as my lab LAN IP. I have connected my lab router to cisco SG300 and created some VLANS for management, servers etc. I have configured my exchange on the server VLAN and want to forward port 25.
Can you please guide me how can i achieve this please? where should i install the sophos utm and which nics it should be connected yo?
Hope to hear from you soon.
Many thanks,
Pavan
Reply
Hey Brandon – I am very interested in understanding “how to use your router (in my case Sophos UTM) to route traffic between the VLANs that are created on the switch.” I am a little bit stuck at the moment with my setup and would love any advice suggestions you can provide. My most recent issues stem from the addition of a new Cisco router to support the need for some new IP cameras.
My current setup:
SG300-10P (I have it set as L3 and although this is the newest device and will really only support the IP cameras, I’m thinking that I will consider this my main switch since it is L3).
SG200-26 I’ve been using this switch for a while now but not (anywhere close) to the capacity it was designed, I never bothered to setup VLANs and etc b/c the need really was not there until now.
Sophos UTM 9.x (running as a VM on ESXI 6) I love the UTM but definitely adds complexity at times, I currently use the UTM as my DHCP server and then have another machine as AD/DNS. I also have a Sophos Wireless Access Point AP55C that is in this mix too.
The rest of my environment is either VM’s or Physical PC’s. I use a couple of Distributed Switches in ESXI 6 for VM connectivity. Any information you could share on how you have setup VLAN’s with Sophos, ESXI, and etc would be great.
Hi Brandon.
Thank you for this knowledgeable blog.
I am very new to networking, I would really appreciate your help if you could make me understand and how to configure Cisco SG300 and Cyberoam 25iNG connected in a lab environment as below.
VLAN 10 – 192.168.10.1/24 (Server VLAN)
VLAN 15 – 192.168.15.115 – 192.168.15.1 FREE FREE/24 (DMZ VLAN)
VLAN 20 – 192.168.20.1/24 (Workstation VLAN)
VLAN 25 – 192.168.25.1/24 (Printer VLAN)
VLAN 30 – 192.168.30.1/24 (WiFi VLAN)
VLAN 99 – 10.10.99.1/24 (Management VLAN)
How should I configure this? Please help….
Hi Brandon,
This is a great blog. I am currently looking for a specific solution and I am a bit stuck. As I don’t have a switch in fron of me at the moment I am going to ask you the question. I will be using a SG300-24 switch with multiple VLAN’s. I’ll have a VLAN 1 for Management with VLAN ID 100, A VLAN with ID 200, a VLAN with ID 300 and a VLAN with ID 400. The reason for this is the different types of protocols we are using in the music industry.
I want to setup 1 port on the switch where I can connect my macbook and be able to communicate with all the VLAN’s. I have created all the VLAN’s in my network setup on my Mac but I need to know how to configure the port in the switch. Would this be a trunk port with all the VLAN’s tagged?
Thank you for your time if you can try to help me.
Hi brendon,
I am using asa 5510 but i wanna use only one port from asa, g0/2 which is configured for 192.168.0.2/24.
Can i use this port as vlan 10,20,30 in sg300 24 port.
Hi Brandon,
I know this is an old post, but this is exactly what I’m going to attempt to undertake within the next couple of days on my Cisco SG300-28.
My overall aim is to setup multiple VLANs to separate VMware traffic (i.e. Management, Storage, HA/VMotion/DRS, VMnet).
In order to do this, would I also need an additional router, as my only current router is an ISP Cable Modem/Router which isn’t that configurable? I’ve read that it’s possible to take an old router and effectively use that as a bridge between the Layer 3 Switch (Cisco) and the ISP Modem/Router by using DD-WRT? Would this suffice, or would the easiest method be to purchase a 2nd-hand Cisco (e.g. rv325 or a 1921) router and configure it that way?
Many thanks,
Nick