{"id":190,"date":"2011-11-22T23:24:29","date_gmt":"2011-11-22T23:24:29","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=190"},"modified":"2018-09-06T23:11:39","modified_gmt":"2018-09-06T23:11:39","slug":"vlan-how-to-segmenting-a-small-lan","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=190","title":{"rendered":"VLAN How To: Segmenting a small LAN"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>What is a VLAN? Is it some sort of highly expensive technology or virtual reality? Not at all. VLANs are relatively simple, yet they offer a wide variety of options and capabilities to improve your network.<\/p>\n<p>VLAN, or Virtual LAN, is a technology that enables dividing a physical network into logical segments at Layer 2. Functionally, VLANs enable a network administrator to partition a network  into separate, independent networks. There are many reasons to separate a network into VLANs, and numerous options to consider.<\/p>\n<p>While a useful technology for small LANS, VLANs are often deployed in  large networks, too. In larger networks, VLANs are sometimes used to  join physically separate LANs or LAN segments into a single logical LAN.<\/p>\n<p>The goal of this article is to explain and discuss VLANs, including why you should consider using VLANs in a smaller network. I&#8217;ll also   walk through a configuration example showing how to configure a VLAN-aware switch to create separate LAN segments.<\/p>\n<h3>VLANs and Switches<\/h3>\n<p>If you have more than one device on your network, you probably have a switch. A switch is a simple device that operates at Layer 2 of the <a href=\"http:\/\/en.wikipedia.org\/wiki\/OSI_model\" target=\"_blank\">OSI model<\/a>, forwarding data frames from one device to another based on their hardware or MAC (Media Access Control) address. The basic Layer 2 switch does not care or know about IP addresses, which operate at Layer 3.<\/p>\n<p>Your switch may be a few  ports built into your  router, it may be a small unmanaged (non-configurable) switch such as the D-Link DGS-2205 shown in Figure 1. Or you may have a more advanced switch with VLAN capability, possibly referred to as a managed, &#8220;smart&#8221; or  multilayer switch. Larger networks usually have multiple switches at numerous locations.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"D-Link switch\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/dlinkswitch.jpg\" border=\"0\" alt=\"D-Link switch\" width=\"425\" height=\"245\" \/><\/p>\n<h6>Figure 1: D-Link switch without VLAN capability<\/h6>\n<p>As stated, switches pass data from one device to another based on their MAC addresses. The key question is, how does the switch know which MAC address is located on which port?<\/p>\n<p>Even the simplest switch has a &#8220;learning ability&#8221; to read the MAC address of the devices connected, and store those MAC addresses in a table in memory. Switches &#8220;learn&#8221; by examining the source MAC address of every frame received. New MAC addresses learned on received frames are added to a table, creating in the switch&#8217;s memory a mapping of MAC addresses to switch ports.<\/p>\n<h3>Broadcasts<\/h3>\n<p>VLANs become important when you consider broadcasts. Broadcasts are frames sent to all devices on a switch, and in many cases, a normal and frequent function. A broadcast domain is the set of all devices that receive a broadcast. Small LANs are typically equivalent to a single broadcast domain.<\/p>\n<p>Devices on a network generate significant broadcast traffic. Broadcasts normally occur when a device is trying to send data to another device, but doesn&#8217;t know the MAC address of the destination device. A PC that knows the destination IP, but not the MAC associated with that IP, will send a broadcast. This type of broadcast is an <a href=\"http:\/\/en.wikipedia.org\/wiki\/Address_Resolution_Protocol\" target=\"_blank\">ARP<\/a> (Address Resolution Protocol) broadcast.<\/p>\n<p>Devices, such as PCs, will build and maintain a listing of IP addresses to MAC addresses in what is known as the ARP cache. The ARP cache is temporary, can be overwritten, and is rebuilt every time the PC is powered on. In addition, entries expire after two minutes on Windows XP and 2000 PCs.<\/p>\n<p>In a Windows PC, you can see the ARP cache by typing <strong>arp -a<\/strong> at the command line. In Figure 2, you can see the ARP cache of my PC, as learned from its network interface.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"arp -a\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/arp_a.jpg\" border=\"1\" alt=\"arp -a\" width=\"425\" height=\"132\" \/><\/p>\n<h6>Figure 2: arp -a command showing ARP cache<\/h6>\n<p>Another example of broadcasts generated by PCs is <strong>DHCP<\/strong> (Dynamic Host Configuration Protocol) requests. PCs will send DHCP broadcast requests when they&#8217;re turned on to acquire an IP address, unless their IP has been statically configured.<\/p>\n<p>Another source of broadcasts are switches themselves. When a frame enters a switch destined for a MAC address that the switch hasn&#8217;t  learned\u2014and that thus isn&#8217;t in the switch&#8217;s MAC table\u2014the switch will  broadcast that frame to all devices except the one that sent it, looking for a response.<\/p>\n<p>The device with the desired MAC will respond to this broadcast. The switch will then update its MAC table with what it learned from the port on which the response frame was received. Like a PC, the MAC table of a switch is usually stored in temporary memory, and will be rebuilt every time the switch is powered on.<\/p>\n<p><strong>IP multicasts<\/strong> are yet another source of broadcasts. Video can  be sent over IP multicasts, which can consume tremendous amounts of  bandwidth. For this reason, IP multicasting is frequently disabled in  large networks and in most consumer routers by default.<\/p>\n<p>Broadcasts can eat up considerable bandwidth on your LAN and they also use processing power. Every device in the LAN receives broadcasts and must read and determine whether or not to respond to each broadcast.   As the number of devices in your LAN grows, so will the volume of broadcast traffic.<\/p>\n<p>This is where VLANs become valuable\u2014to break up broadcast domains. Broadcasts are propagated within a VLAN, but not between VLANs. By segmenting a network into VLANs, you will increase usable network bandwidth, resources, and performance through the reduction of broadcast traffic.<\/p>\n<h3>Routers<\/h3>\n<p>Routers also break up broadcast domains. Routers operate at Layer 3, forwarding packets based on IP addresses, not MAC addresses. A router will receive a frame on its Ethernet interface, strip off the MAC address, and make a routing decision based on the originating and destination IP addresses.<\/p>\n<p>Routing is an integral part of any network that contains multiple subnets and can play a key part in VLANs. VLANs can be configured on separate subnets, requiring a router to provide access to common services required by each VLAN.<\/p>\n<p>For example, a network connected to the Internet  usually employs a gateway router, which is probably also providing DHCP and NAT  (Network Address Translation) services. If  VLANs are created on different  subnets, then the gateway, or another router will need to provide those  services to each VLAN. In larger LANs, inter-subnet routing and VLAN  segmentation is often handled by Layer 3 (sometimes called &#8220;multilayer&#8221;)  switches.<\/p>\n<p>VLANs can also be configured to share a single subnet, yet isolate various LAN members from each other. I&#8217;m going with the single subnet approach here, using the SRW as my Layer 2 managed switch and a Linksys RV042 router (Figure 3) for  Internet access, DHCP, and NAT.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Linksys RV042\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/rv042.jpg\" border=\"0\" alt=\"Linksys RV042\" width=\"425\" height=\"280\" \/><\/p>\n<h6>Figure 3: The Linksys RV042 router<\/h6>\n<h3>How To<\/h3>\n<p>Now that you understand VLAN basics, let&#8217;s get to the fun part! I&#8217;ll  be showing you how to segment a single-subnet LAN into multiple private  segments.This basic application of VLANs is handy for adding an extra  measure of security to clients or servers that contain confidential  information. It can also be used in multi-tenant applications, to share a  single Internet connection, yet allow each tenant to share files and printers without worrying about the others. I&#8217;m sure you can think of other applications.<\/p>\n<p>I&#8217;ll be using a <strong>Linksys SRW2008<\/strong> (Figure 4), an eight port 10\/100\/1000 switch with a nice web utility for configuration. The SRW is a Layer 2 switch with a large number of features, including VLAN support.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Linksys SRW2008\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/srw2008.jpg\" border=\"0\" alt=\"Linksys SRW2008\" width=\"425\" height=\"175\" \/><\/p>\n<h6>Figure 4: The Linksys SRW2008 switch<\/h6>\n<p>The basic steps in configuring a VLAN are:<\/p>\n<ol>\n<li>Plan your network.<\/li>\n<li>Create the VLANs.<\/li>\n<li>Associate switch ports with the VLANs.<\/li>\n<li>Test VLAN connectivity.<\/li>\n<li>Implement security measures as appropriate.<\/li>\n<\/ol>\n<h3>Planning<\/h3>\n<p>The most important part of VLAN implementation, even in a small network, is planning. You need to review your devices and decide which ones should go in which VLAN. A network administrator must consider the components, functions, and traffic types of all the elements of the network when planning VLANs.<\/p>\n<p>The network components connected to the eight port SRW switch I&#8217;m using for this VLAN example are a LAN port from the RV042 router on port 1, a WiFi router on port 2, a Windows Server on port 3, a NAS on port 4, a printer on port 5, a Linux VoIP Server on port 6, a VoIP ATA on port 7, and a laptop computer on port 8. Figure 5 is a simple diagram of the &#8220;Before LAN.&#8221;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Before VLANs\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/before.jpg\" border=\"1\" alt=\"Before VLANs\" width=\"425\" height=\"295\" \/><\/p>\n<h6>Figure 5: The network before dividing into VLANs<\/h6>\n<p>None of these components are &#8220;VLAN-aware,&#8221; meaning they will send all frames to the switch &#8220;UnTagged.&#8221; VLAN-aware devices, such as  VLAN-enabled switches, as well as advanced network interface cards, can  specify VLAN information by &#8220;Tagging&#8221; a frame with a VLAN number. This is an  important factor when it comes to multi-switch configurations.<\/p>\n<p>A common VLAN best practice is to place all VoIP devices in their own VLAN to prevents data traffic from interfering with time-sensitive voice traffic. So we have:<\/p>\n<p>&#8211; a VLAN for the <strong>Data<\/strong> devices<br \/>\n&#8211; a VLAN for the <strong>VoIP<\/strong> devices<\/p>\n<p>But I also need <em>both<\/em> Data and VoIP devices to have Internet access. So I&#8217;ll need:<\/p>\n<p>&#8211; a  VLAN to enable <strong>Internet access<\/strong> for both VLANs<\/p>\n<p>This ability to allow ports to access multiple VLANs comes in very handy and is key to our example.<\/p>\n<p>I&#8217;m also going to configure the <strong>Laptop<\/strong> switch port for access to <em>all<\/em> VLANs and the management functions of the SRW. The SRW switch itself is also a member of the LAN, and has its own IP address. It is important to remember this device and include it in a VLAN to retain access to the switch&#8217;s management utility. More on this later.<\/p>\n<p>Mapping your network is a big part of the planning. The SRW allows for naming the devices on each port, which is time well spent for the future date when you&#8217;re troubleshooting. I took a few minutes and wrote down which devices in my LAN were going to be plugged into which physical port on the switch. I then configured the SRW with a recognizable name for each port in the <strong>Description<\/strong> field of the <strong>Port Management<\/strong> menu (Figure 6), making it easier to see what was where.<\/p>\n<p><a href=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/portnaming_big.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Port naming\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/portnaming.jpg\" border=\"1\" alt=\"Port naming\" width=\"425\" height=\"223\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"Click to enlarge image\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/enlarge.gif\" border=\"0\" alt=\"Click to enlarge image\" width=\"54\" height=\"16\" align=\"absmiddle\" \/><\/a><\/p>\n<h6>Figure 6: Naming the ports<\/h6>\n<h3>Create VLANs<\/h3>\n<p>With my planning complete, it&#8217;s time to create the VLANs. Creating VLANs in the SRW is simply a matter of clicking the &#8220;Create VLAN&#8221; menu and numbering and naming your VLANs. I&#8217;m splitting Voice and <a id=\"itxthook0\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/30071-vlan-how-to-segmenting-a-small-lan#\">Data<\/a> on this network, yet I&#8217;m going to create three VLANs so I can name and fully manage all VLANs in use.<\/p>\n<p>Figure 7 shows my created VLANs (2,3,4). Note that VLAN1 already existed in the SRW&#8217;s default configuration; this is the VLAN of the management interface of the SRW.<\/p>\n<p><a href=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/vlan_naming_big.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Created VLANs\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/vlan_naming.jpg\" border=\"1\" alt=\"Created VLANs\" width=\"425\" height=\"257\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"Click to enlarge image\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/enlarge.gif\" border=\"0\" alt=\"Click to enlarge image\" width=\"54\" height=\"16\" align=\"absmiddle\" \/><\/a><\/p>\n<h6>Figure 7: Created VLANs named appropriately<\/h6>\n<h3>Map Ports<\/h3>\n<p>The next step is to map the physical switch ports to the appropriate VLANs. This is a multistep process, and involves a couple of  terms specific to the SRW. The Linksys SRW has several port types for VLANs: <strong>Access<\/strong>, <strong>General<\/strong>, and <strong>Trunk<\/strong>.  Other switches may use different terminology, so I&#8217;ll describe what these terms mean.<\/p>\n<p>Linksys defines Access and Trunk ports similar to Cisco&#8217;s definitions\u2014which makes sense, as Linksys is a division of Cisco. An <strong>Access<\/strong> port is one that belongs to a single VLAN. Frames received on ports configured as Access cannot be modified, and more advanced VLAN port features such as filtering are disabled.<\/p>\n<p>A <strong>Trunk<\/strong> port is defined by Linksys as belonging to multiple VLANs in which all ports are &#8220;Tagged&#8221; with a VLAN ID. Two or more VLAN capable switches can be configured with VLANs, connected together with trunks, and the frames passed between them Tagged by the sending switch to identify the destination VLAN.<\/p>\n<p>I&#8217;m using Linksys&#8217; port type of <strong>General<\/strong>, which allows a port to be a member of multiple VLANs, and have the option of Tagging. I&#8217;m going to use the UnTagged option for all VLANs in this example.<\/p>\n<p>Changing a port&#8217;s type on the SRW is done in the Port Setting menu (Figure 8), and there is a simple drop down selector for each port. I changed all eight ports to a Mode of General, and clicked Save.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"General port\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/general.jpg\" border=\"1\" alt=\"General port\" width=\"349\" height=\"142\" \/><\/p>\n<h6>Figure 8: Selecting the General port mode<\/h6>\n<p>Now that the VLANs are created, and we&#8217;ve configured the ports to allow membership to multiple VLANs, we can assign ports to VLANs. The end result (summarized in Table 1) I want is:<\/p>\n<ul>\n<li> Ports 1 and 8 to be members of the Network (2), Data (3), and VoIP (4)VLANs<\/li>\n<li>SRW management interface on the Network  VLAN 2<\/li>\n<li>Ports 2\u20135 on the Network and Data VLAN 3<\/li>\n<li>Ports 6\u20137 on the Network and VoIP VLAN 4<\/li>\n<\/ul>\n<table id=\"nointelliTXT\" align=\"center\">\n<tbody>\n<tr>\n<th><\/th>\n<th>1<\/th>\n<th>2<\/th>\n<th>3<\/th>\n<th>4<\/th>\n<th>5<\/th>\n<th>6<\/th>\n<th>7<\/th>\n<th>8<\/th>\n<\/tr>\n<tr>\n<td><strong>VLAN 1 (Default)<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<\/tr>\n<tr>\n<td><strong>VLAN 2 (Network)<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>VLAN 3 (Data)<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>VLAN 4 (VoIP)<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<td align=\"center\" valign=\"middle\"><strong>X<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6>Table 1: Port to VLAN mapping summary<\/h6>\n<p>The quickest way to do this on the SRW is via the <strong>Ports to VLAN<\/strong> menu. At the top, you select VLAN. You can&#8217;t edit any of the settings on VLAN1, so I selected the VLAN indicated as &#8220;2, Network.&#8221; I want all ports to be members of VLAN2, so I changed each port from the default &#8220;Excluded&#8221; button, to the &#8220;UnTagged&#8221; button, as in Figure 9.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"VLAN2 config\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/vlan2ports.jpg\" border=\"1\" alt=\"VLAN2 config\" width=\"271\" height=\"255\" \/><\/p>\n<h6>Figure 9: Configuring access to VLAN2<\/h6>\n<p>Next, I want ports 1\u20135 and 8 to be members of the Data VLAN, so I selected UnTagged for those ports for the VLAN indicated as &#8220;3, Data,&#8221; as in Figure 10.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"VLAN3 config\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/vlan3ports.jpg\" border=\"1\" alt=\"VLAN3 config\" width=\"273\" height=\"260\" \/><\/p>\n<h6>Figure 10: Configuring access to VLAN3<\/h6>\n<p>Last, I want ports 1 and 6\u20138 to be members of the VoIP VLAN, so I selected UnTagged for those ports for the VLAN indicated as &#8220;4, VoIP,&#8221; as in Figure 11.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"VLAN4 config\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/vlan4ports.jpg\" border=\"1\" alt=\"VLAN4 config\" width=\"272\" height=\"258\" \/><\/p>\n<h6>Figure 11: Configuring access to VLAN4<\/h6>\n<h3>Set PVID<\/h3>\n<p>The next step  is to change the <strong>PVID<\/strong> (Port Default VLAN ID) setting on each port. The PVID is the VLAN ID the switch will assign to all UnTagged frames <em>received<\/em> on each port. As mentioned, I&#8217;m not using VLAN-aware devices, so all frames will arrive at the switch UnTagged. The frames will then receive the PVID associated with their port.<\/p>\n<p><strong>PVIDs are the key to breaking up a broadcast domain in this example!<\/strong> The simple rule to remember is that you set each port&#8217;s PVID equal to the number of the VLAN that you want it to <em>logically<\/em> belong to. This is where naming the VLANs is important.<\/p>\n<p>So, my <a id=\"itxthook0\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/30071-vlan-how-to-segmenting-a-small-lan#\">VoIP<\/a> server and ATA are connected to switch ports 6 and 7, so I set both their PVIDs to 4, which I named the <strong>VoIP<\/strong> VLAN. Similarly, my <a id=\"itxthook1\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/30071-vlan-how-to-segmenting-a-small-lan#\">data<\/a> devices are plugged into switch ports 2 through 5, so they get a PVID of 3, which is the <strong>Data<\/strong> VLAN. Ports 1 and 8 are left over and get a PVID of 2, which is the <strong>Network<\/strong> VLAN.<\/p>\n<p>Changing PVIDs on the SRW is accomplished via the <strong>Port Setting<\/strong> menu, and you simply put in the number of the VLAN that applies to all UnTagged frames arriving on that port, as in Figure 12.<\/p>\n<p><a href=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/pvid_portmapping_big.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"PVID port mapping\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/pvid_portmapping.jpg\" border=\"1\" alt=\"PVID port mapping\" width=\"425\" height=\"191\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"Click to enlarge image\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/enlarge.gif\" border=\"0\" alt=\"Click to enlarge image\" width=\"54\" height=\"16\" align=\"absmiddle\" \/><\/a><\/p>\n<h6>Figure 12: Mapping PVIDs to ports<\/h6>\n<p>Click Save, and you&#8217;ve completed the configurations. I did this on a live network; you would be wise to do this during little or no activity on a production network. If you have a defined maintenance window, this type of work definitely belongs in that time frame.<\/p>\n<p>One issue I ran into while configuring VLANs on this managed switch was locking myself out of the switch&#8217;s management interface, which by default is on VLAN1. The end result I&#8217;m going for will leave nothing on VLAN1, so I&#8217;m going to have to change the switch&#8217;s default setting from VLAN1 while in VLAN1, and then go to a port in VLAN2 to complete the configurations.<\/p>\n<p>The easiest way I found to do this is to change the PVID on port 1, which is connected to the RV042, to a PVID of 2, and then change the network setting of the SRW to VLAN2, as in Figure 13. I then moved the Ethernet cable connected to my Laptop from port 8 of the SRW to a port on the RV042 to finish the configurations.<\/p>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" title=\"Tip\" src=\"http:\/\/www.smallnetbuilder.com\/images\/tip_hp.gif\" border=\"0\" alt=\"Tip\" width=\"16\" height=\"16\" \/> <strong>TIP:<\/strong> Some inexpensive managed \/ &#8220;smart&#8221; switches don&#8217;t have the ability to  change the VLAN of the Management interface. In that case, you would use  the default VLAN (usually either 0 or 1) as the &#8220;Network&#8221; VLAN in this  example.<\/p><\/blockquote>\n<p>If you lock yourself out of the switch management interface, there is  also a console connection option. On switches without console connections,  you&#8217;d need to reset the switch to its default configuration and start  over.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Management config\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/mgt_vlan.jpg\" border=\"1\" alt=\"Management config\" width=\"425\" height=\"196\" \/><\/p>\n<h6>Figure 13: Putting the switch on a different VLAN<\/h6>\n<h3>Testing<\/h3>\n<p>With the switch VLAN configurations complete, it is time to test. The goal of this exercise was to separate the Data components from the VoIP components, so pings from the Data to the VoIP VLAN and back are a good way to see if you&#8217;ve succeeded.<\/p>\n<p>Indeed, pings from components in the Data VLAN did not reach components in the VoIP VLAN, and vice versa, which is what I want. However, all components need Internet access, so checking a browser on servers in both VLANs or pinging a reliable Internet host such as Google or Yahoo are good tests.<\/p>\n<p>Since VoIP elements are part of this exercise, placing test calls is a good idea, both to and from stations, as well as to and from outside POTS numbers. Make sure to transmit and receive audio in both directions to ensure no one-way audio problems. One-way audio would indicate a routing or firewall problem blocking the voice path of the communication stream.<\/p>\n<p>Another benefit of VLANs is that my network is now more secure than  it was as a single LAN. Any device can flood the network with broadcast traffic, forming a denial of service attack against other  devices on the same VLAN. However, since broadcasts can&#8217;t cross VLANs, a device on  my Data VLAN now can&#8217;t flood my VoIP VLAN.<\/p>\n<p>With these steps completed, my network is now divided into two separate VLANs and a third that overlaps the two. Figure 14 is a  simple picture of my network with VLANs implemented. The four devices on the left have access to each other and the Internet. The two  VoIP devices have access to each other and the Internet. Broadcasts in either  VLAN will not affect the other.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"After VLANs\" src=\"http:\/\/www.smallnetbuilder.com\/images\/stories\/lansrouters\/vlan_howto\/after.jpg\" border=\"1\" alt=\"After VLANs\" width=\"425\" height=\"285\" \/><\/p>\n<h6>Figure 14: The network divided into VLANs<\/h6>\n<h3>VLAN Best Practices<\/h3>\n<p>These are some general guidelines in creating VLANs. A VLAN creates a boundary between devices, so the goal is to plan the boundaries that will improve network functionality and security.<\/p>\n<ol>\n<li><strong>Grouping devices by traffic patterns &#8211; <\/strong>Devices that      communicate extensively between each other are good candidates to be      grouped into a common VLAN.<\/li>\n<li><strong>Grouping devices for security &#8211; <\/strong>It is often a good practice      to put servers and key infrastructure in their own VLAN, isolating them      from the general broadcast traffic and enabling greater protection.<\/li>\n<li><strong>Grouping devices by traffic types &#8211; <\/strong>As discussed in this      How To, VoIP quality is improved by isolating VoIP devices to their own      VLAN. Other traffic types may also warrant their own VLAN. Traffic types      include network management traffic, IP multicast traffic such as video,      file and print services, email, Internet browsing, database access, shared      network applications, and traffic generated by peer-to-peer applications.<\/li>\n<li><strong>Grouping devices geographically &#8211; <\/strong>In a network with limited      trunking, it may be beneficial to combine the devices in each location      into their own VLAN.<\/li>\n<\/ol>\n<h3>More VLAN Technologies<\/h3>\n<p>In this How To, I&#8217;ve configured static VLANs. A static VLAN is created by assigning switch ports to specific VLAN numbers. Some switches may support <strong>dynamic VLANs<\/strong>, which are created by assigning MAC addresses to VLAN numbers. Dynamic VLANs are a less common way to configure VLANs and are more resource intensive to build and maintain. But they do enable mobility of devices while retaining VLAN boundaries.<\/p>\n<p>As discussed, I didn&#8217;t use <strong>VLAN Trunking<\/strong> in this example. If I had multiple VLAN-aware switches, I would likely have employed Trunking to enable distributed VLAN configurations.<\/p>\n<p>The standard protocol for VLAN Tagging is <strong>802.1Q<\/strong>, sometimes referred to as Dot1Q. If you&#8217;re selecting a VLAN capable device, you&#8217;ll  want to ensure this protocol is supported for interoperability, especially if  you&#8217;re going to use it in VLAN trunking applications. The ability to  change a port&#8217;s PVID usually comes along with 802.1Q capability.<\/p>\n<h3>Conclusion<\/h3>\n<p>The Linksys SRW2008  is a nice switch for creating VLANs on your small network. Each of its eight ports support gigabit Ethernet, so it could serve as a central switch connected to multiple other switches. You could use less-expensive unmanaged switches to group devices, and connect each unmanaged switch to a port on the SRW, using the SRW&#8217;s VLAN capability to break up the broadcast <a id=\"itxthook2\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/30071-vlan-how-to-segmenting-a-small-lan#\">domains<\/a> and maximize available bandwidth.<\/p>\n<p>However, pretty much any managed or &#8220;smart&#8221; switch supports  port-based VLANs, which is sufficient to implement the example in this  article.<\/p>\n<p>A final plus to using VLANs is network design. VLANs enable segmentation and grouping, which are recognized elements of good network design. Good design makes network growth and maintenance easier. Being able to eliminate all the devices in one VLAN as a possible cause of a problem in the other VLAN is a helpful and immediate benefit of having VLANs in your network.<\/p>\n<p>With the right equipment and good planning, implementing a VLAN is straightforward. Take your time and follow these steps, and you&#8217;ll be rewarded with more bandwidth, increased security, and a better-designed network.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction What is a VLAN? Is it some sort of highly expensive technology or virtual reality? Not at all. VLANs are relatively simple, yet they offer a wide variety of options and capabilities to improve your network. VLAN, or Virtual LAN, is a technology that enables dividing a physical network into logical segments at Layer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-190","post","type-post","status-publish","format-standard","hentry","category-networking-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=190"}],"version-history":[{"count":5,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/190\/revisions"}],"predecessor-version":[{"id":2630,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/190\/revisions\/2630"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}