VLAN (Virtual Local Area Network) is
a logical local area network (or LAN) that extends beyond a single traditional
LAN to a group of LAN segments, given specific configurations. Since a VLAN is
a logical entity, its creation and configuration is done completely in
software.
How
is a VLAN Identified?
Since a VLAN is a software concept,
identifiers and configurations for a VLAN must be properly prepared for it to
function as expected. Frame coloring is the process used to ensure that VLAN
members or groups are properly identified and handled. With frame coloring,
packets are given the proper VLAN ID at their origin so that they may be
properly processed as they pass through the network. The VLAN ID then enables
switching and routing engines to make the appropriate decisions as defined in
the VLAN configuration.
Why
Use VLANs?
Traditional network designs use
routers to create broadcast domains and limit broadcasts between multiple
sub-nets. This prevents broadcast floods in larger networks from consuming
resources or causing unintentional denials of service unnecessarily.
Unfortunately, the traditional network design methodology has some design
flaws.
- Geographic Focus – Traditional network designs focus on physical locations of equipment and personnel for addressing and LAN segment placement. Because of this there are a few significant drawbacks:
- Network segments for physically disjointed organizations cannot be part of the same address space. Each physical location must be addressed independently and be part of its own broadcast domain. This can force personnel to be located in a central location or to have additional latency or connectivity shortfalls.
- Relocating personnel and departments can become difficult, especially if the original location retains its network segments. Relocated equipment will have to be reconfigured based on the new network configuration.
A VLAN solution can alleviate both
of these drawbacks by permitting the same broadcast domain to extend beyond a
single segment.
- Additional Bandwidth Usage – Traditional network designs require additional bandwidth because packets have to pass through multiple levels of network connectivity because the network is segmented.
A proper VLAN design can ensure that
only devices that have that VLAN defined on it will receive and forward packets
intended as source or destination of the network flow.
Types
of VLAN
There are only two types of VLAN
possible today, cell-based VLANs and frame-based VLANs.
- Cell-based VLANs are used in ATM switched networks with LAN Emulation (or LANE). LANE allows hosts on traditional LAN segments to communicate using ATM networks without having to use special hardware or software modification.
- Frame-based VLANs are used in Ethernet networks with frame tagging. The two primary types of frame tagging are IEEE 802.10 and ISL (Inter Switch Link is a Cisco proprietary frame-tagging). Keep in mind that the 802.10 standard makes it possible to deploy VLANs with 802.3(Ethernet), 802.5 (Token-Ring), and FDDI, but Ethernet is most common.
VLAN
Modes
There are three different modes in
which a VLAN can be configured. These modes are covered below:
- VLAN Switching Mode – The VLAN forms a switching bridge in which frames are forwarded unmodified.
- VLAN Translation Mode – VLAN translation mode is used when the frame tagging method is changed in the network path or if the frame traverses from a VLAN group to a traditional or native interface that is not configured in a VLAN. When the packet needs to pass into a native interface, the VLAN tag is removed so that the packet can properly enter the native interface.
- VLAN Routing Mode – When a packet is routed from one VLAN to a different VLAN, use VLAN routing mode. The packet is modified, usually by a router, which places its own MAC address as the source and changes the packet’s VLAN ID.
VLAN
Configurations
Different terminology is used between
different hardware manufacturers when it comes to VLANs. As a result, there is
often confusion at implementation time. Following are a few details and some
examples to assist in defining VLANs so confusion is not an issue.
Cisco
VLAN Terminology
Users need a few details to define a
VLAN on most Cisco equipment. Unfortunately, because Cisco sometimes acquires
the technologies it uses to fill their switching, routing, and security product
lines, naming conventions are not always consistent. This article is focusing
on only one Cisco switching and routing product line running Cisco IOS.
- VLAN ID – The VLAN ID is a unique value assigned to each VLAN on a single device. With a Cisco routing or switching device running IOS, the range is from 1-4096. When a VLAN is defined, the syntax “vlan x,” where x is the number the user would like to assign to the VLAN ID is usually used. VLAN 1 is reserved as an administrative VLAN. If VLAN technologies are enabled, all ports are a member of VLAN 1 by default.
- VLAN Name – The VLAN name is a text based name used to identify a VLAN, perhaps to help technical staff in understanding its function. The string to be used can be between 1 and 32 characters in length.
- Private VLAN – Define whether the VLAN is to be a private VLAN in the VLAN definition and what other VLAN might be associated with it in the definition section. When a Cisco VLAN is configured as a private vlan, this means that ports that are members of the VLAN cannot communicate directly with each other by default. Normally, all ports that are VLAN members can communicate directly with each other just as they would be able to if they were a standard network segment member. Private vlans are created to enhance the security on a network where hosts coexisting on the network cannot or should not trust each other. This is a common practice to use on web farms or in other high risk environments where communication between hosts on the same sub-net are unnecessary. The user should check Cisco documentation if he/she has questions about how to configure and deploy private VLANs.
- VLAN modes – in Cisco IOS, there are only two modes an interface can operate in, “mode access” and “mode trunk.” Access mode is for end devices or devices that will not require multiple VLANs. Trunk mode is used for passing multiple VLANs to other network devices or for end devices that need to have membership to multiple VLANs at once. If wondering what mode to use, use “mode access.”
Cisco
VLAN implementations
VLAN Definition
To define a VLAN on a Cisco device,
the user needs a VLAN ID, a VLAN name, ports to participate in the VLAN, and
the type of membership the port will have with the VLAN.
- Step 1 – Log into the router or switch in question and get into enable mode.
- Step 2 – Get into configuration mode using “conf t.”
- Step 3 – Create the VLAN by entering “vlan X” where X is the ID the user would like to assign the VLAN.
- Step 4 – Name the VLAN by entering “name.” Replace with the string that the VLAN will be identified with.
- Step 5 – In order for the new VLAN to be a private vlan, enter “private-vlan primary” and “private-vlan association Y” where Y is the secondary VLAN to be associated with the primary vlan. For the private VLAN to be community based, enter “private-vlan community” instead.
- Step 6 – Enter “end” to exit configuration mode
- Step 7 – Save the configuration to memory by entering “wr mem” and to the network if needed using “wr net.” The user may have to supply additional information to write configurations to the network depending on the device configuration.
The user has now created a vlan by
assigning it an ID and giving it a name. At this point, the VLAN has no special
configuration to handle IP traffic nor are there any ports that are VLAN
members. The next section describes how to complete the vlan configuration.
VLAN Configuration
A VLAN is not of much use if it has
not been assigned an IP Address s,
the subnet netmask, and port membership. In normal network segment configurations
on routers, individual interfaces or groups of interfaces (called channels) are
assigned IP addresses. When VLANs are used, individual interfaces are VLAN
members, do not have individual IP addresses, and generally do not have access
lists applied to them. Those features are usually reserved for the VLAN
interfaces. The following steps detail one method of creating and configuring a
VLAN interface. NOTE: These steps have already assumed that the user logged
into the router, got into enable mode, and entered configuration mode. These
specific examples are based on the Cisco 6500 series devices.
- Step 1 – Enter “Interface VlanX” where X is the VLAN ID used in the VLAN definition above.
- Step 2 – This step is optional. Enter “description VLAN” where VLAN description details what the VLAN is going to be used for. Simply re-use the VLAN name used above if preferred.
- Step 3 – Enter “ip address” where is the address you want to assign this device in the VLAN, andis the network mask for the subnet you have assigned the VLAN.
- Step 4 – This step is optional. Create and apply an access list to the VLAN for inbound and outbound access controls. For a standard access list, enter “access-group XXX in” and “access-group YYY out” where XXX and YYY corresponds to access-lists previously configured. Remember that the terms are taken with respect to the specific subnet or interface, so “in” means from the VLAN INTO the router and “out” means from the router OUT to the VLAN.
- Step 5 – This step is optional. Enter the private VLAN mapping to be used if the port is part of a private VLAN. This should be the same secondary VLAN associated with the primary VLAN in the VLAN definition above. Enter “private-vlan mapping XX” where XX is the VLAN ID of the secondary VLAN to be associated with this VLAN.
- Step 6 – This step is optional. Configure HSRP and any other basic interface configurations normally used for the Cisco device.
- Step 7 – Enter “end” to exit configuration mode.
- Step 8 – Save the configuration to memory by entering “wr mem” and to the network if needed using “wr net.” The user may have to supply additional information to write configurations to the network depending on the device configuration.
Now the vlan is defined and
configured, but no physical ports are a member of the VLAN, so the VLAN is
still not of much use. Next port membership in the VLAN is described. IOS
devices describe interfaces based on a technology and a port number, as with
“FastEthernet3/1″ or “GigabitEthernet8/16.” Once the user determines which
physical ports he/she wants to be members of the VLAN, use the following steps
to configure it. NOTE: These steps have already assumed that the user logged
into the router, got into enable mode, and entered configuration mode.
For Access Ports
- Step 1 – Enter “Interface” where the name Cisco has assigned the interface to be associated with the VLAN.
- Step 2 – This step is optional. Enter “description ” whereis text describes the system connected to the interface in question. It is usually helpful to provide DNS hostname, IP Address, which port on the remote system is connected, and its function.
- Step 3 – This step depends on the equipment, IOS version, and requirements. Enter “switchport” if the interface should act as a switch port. Some hardware does not support switchport mode and can only be used as a router port. The user should check the documentation if he/she does not know the difference between a router port and a switch port.
- Step 4 – Only use this step if step 3 above was used. Enter “switchport access vlan X” where X is the VLAN ID of the VLAN that the port should be a member of.
- Step 5 – Only use this step if step 3 above was used. Enter “switchport mode access” to tell the port that it should be used as an access port.
- Step 6 – Enter “end” to exit configuration mode.
- Step 7 – Save the configuration to memory by entering “wr mem” and to the network if needed using “wr net.” The user may have to supply additional information to write configurations to the network depending on device configuration.
For Trunk Ports
- Step 1 – Enter “Interface” whereis the name Cisco has assigned the interface to be associated with the VLAN.
- Step 2 – This step is optional. Enter “description” whereis text describing the system connected to the interface in question. It is usually helpful to provide DNS hostname, IP Address, which port on the remote system is connected, and its function.
- Step 3 – This step depends on the equipment, IOS version, and requirements. Enter “switchport” if the interface should act as a switch port. Some hardware does not support switchport mode and can only be used as a router port. The user should check the documentation if he/she does not know the difference between a router port and a switch port.
- Step 4 – Only use this step if step 3 above was used. Enter “switchport trunk encapsulation dot1q.” This tells the VLAN to use dot1q encapsulation for the VLAN, which is the industry standard encapsulation for trunking. There are other encapsulation options, but some equipment may not operate with non Cisco equipment.
- Step 5 – Only use this step if step 3 above was used. Enter “switchport trunk allowed vlan XX, YY, ZZ” where XX, YY, and ZZ are VLANs that the trunk should include. Define one or more VLANs to be allowed in the trunk.
- Step 6 – Only use this step if step 3 above was used. Enter “switchport mode trunk” to tell the port to operate as a VLAN trunk and not as an access port.
- Step 7 – Enter “end” to exit configuration mode.
- Step 8 – Save the configuration to memory by entering “wr mem” and to the network if needed using “wr net.” The user may have to supply additional information to write configurations to the network depending on device configuration.
For Private VLAN Ports
- Step 1 – Enter “Interface” whereis the name Cisco has assigned the interface to be associated with the VLAN.
- Step 2 – This step is optional. Enter “description” whereis text describing the system connected to the interface in question. It is usually helpful to provide DNS hostname, IP Address, which port on the remote system is connected, and its function.
- Step 3 – This step depends on the equipment, IOS version, and requirements. Enter “switchport” if the interface should act as a switch port. Some hardware does not support switchport mode and can only be used as a router port. The user should check the documentation if he/she does not know the difference between a router port and a switch port.
- Step 4 – Enter “switchport private-vlan host association XX YY” where XX is the primary VLAN to be assigned, YY is the secondary VLAN to be associated with it.
- Step 5 – Enter “switchport mode private-vlan host” to force the port to operate as a private-vlan in host mode.
- Step 6 – Enter “end” to exit configuration mode.
- Step 7 – Save the configuration to memory by entering “wr mem” and to the network if needed using “wr net.” The user may have to supply additional information to write configurations to the network depending on device configuration.
The VLAN should now be properly implemented
on a Cisco IOS device.
No comments:
Post a Comment