skip to main | skip to sidebar

Monday, July 7, 2008

VLAN Configuration

· VLANs are broadcast domains defined within switches to allow control of broadcast, multicast, unicast, and unknown unicast within a Layer 2 device.
· VLANs are defined on a switch in an internal database known as the VLAN Trunking Protocol (VTP) database. After a VLAN has been created, ports are assigned to the VLAN.
· VLANs are assigned numbers for identification within and between switches. Cisco switches have two ranges of VLANs, the normal range and extended range.
· VLANs have a variety of configurable parameters, including name, type, and state.
· Several VLANs are reserved, and some can be used for internal purposes within the switch.
Creation of an Ethernet VLAN
VLANs are created on Layer 2 switches to control broadcasts and enforce the use of a Layer 3 device for communications. Each VLAN is created in the local switch's database for use. If a VLAN is not known to a switch, that switch cannot transfer traffic across any of its ports for that VLAN. VLANs are created by number, and there are two ranges of usable VLAN numbers (normal range 1–1000 and extended range 1025–4096). When a VLAN is created, you can also give it certain attributes such as a VLAN name, VLAN type, and its operational state. To create a VLAN, use the following steps.
1. Configure VTP.
VTP is a protocol used by Cisco switches to maintain a consistent database between switches for trunking purposes. VTP is not required to create VLANs; however, Cisco has set it up to act as a conduit for VLAN configuration between switches as a default to make administration of VLANs easier. Because of this, you must first either configure VTP with a domain name or disable VTP on the switch. VTP is explained in detail in section "6-4: VLAN Trunking Protocol."
NOTE
For Catalyst 4000 and 6000 switches running IOS Supervisor 12.1(8a) or above (native IOS), you can configure the VTP parameters in global configuration mode as well.
o Specify a VTP name:
COS
set vtp domain domain-name
IOS
(vlan) vtp domain domain-name
-OR-
(global) vtp domain domain-name
o
o By default, the VTP is in server mode and must be configured with a domain name before any VLANs can be created. These commands specify the VTP domain name. For IOS switches, you enter vlan database mode, (vlan), by entering the command vlan database, at the privileged-level prompt.
o NOTE
o The global configuration command vtp domain is not available on all switches that run IOS.
-OR-
o Disable VTP synchronization:
COS
set vtp mode transparent
IOS
(vlan) vtp transparent
-OR-
(global) vtp mode transparent
o
o Another option is to disable VTP synchronization of the databases. Disabling it enables you to manage your local VTP database without configuring and relying on VTP. For Catalyst 4000 and 6000 switches running IOS Supervisor 12.1(8a) or above (native IOS), you can configure the VTP parameters in global configuration mode as well.
o NOTE
o The global configuration command vtp mode transparent is not available on all switches that run IOS.
-OR-
o Disable VTP:
COS
set vtp mode off
IOS
N/A
o
o With the introduction of COS version 7.1.1, an option now exists to disable VTP completely. Use the command set vtp mode off to turn off VTP. After doing so, you can administer the local VTP database.
2. Create the VLAN.
VLANs are created by number. The two ranges of VLANs are as follows:
o The standard range consists of VLANs 1 to 1000.
o The extended range consists of VLANs 1025 to 4096.
Extended VLANs are currently supported only on switches running COS software version 6.1 or greater. When you create a VLAN, you have many options to consider. Many options are valid only for FDDI and Token Ring VLANs. Some of the items configured deal with options, such as private VLANs, which are discussed in other sections in this book. VLANs are created using the set vlan command for COS devices or with the vlan command in vlan database mode for IOS switches. For Ethernet VLANs, you can also configure the standard parameters in Table 6-1.
Table 6-1 Configurable VLAN Parameters
Parameter
Description
name
A description of the VLAN up to 32 characters. If none is given, it defaults to VLAN00XXX, where xxx is the VLAN number.
mtu
The maximum transmission unit (packet size, in bytes) that the VLAN can use; valid values are from 576 to 18190. The MTU can extend up to 1500 for Ethernet, but beyond for Token Ring or FDDI. The default is 1500.
state
Used to specify whether the state of the VLAN is active or suspended. All ports in a suspended VLAN will be suspended and not allowed to forward traffic. The default state is active.

NOTE
Many other options are available during the VLAN configuration command; however, most of these deal with the configuration of FDDI and Token Ring VLANs. Because these are not widely used topologies, the options and descriptions of Token Ring and FDDI VLAN configuration and parameters have not been included in this book. For information on Token Ring or FDDI VLANs, refer to http://www.cisco.com/univercd/cc/td/doc/product/lan/cat5000/rel_6_3/config/vlans.htm.
c. Create a VLAN in the standard range:
COS
set vlan vlan-id [name name] [state state] [mtu mtu]
IOS
(vlan) vlan vlan-id [name vlan-name] [state {suspend active}] [mtu mtu-size]
(global) vlan vlan-id
(vlan-config) vlan vlan-id [mtu mtu-size] [name vlan-name] [state {suspend active}]
d.
e. The vlan-id specifies the VLAN by number. For COS you can specify a range of VLANs in the vlan-id section; you cannot configure the name for a range of VLANs, however, because each VLAN is to have a unique name. For IOS switches, VLANs are created in vlan database mode. For Catalyst 6000 and 4000 switches running Supervisor IOS 12.1(8a) and above, you can create VLANs in global configuration mode if the switch is in VTP transparent mode. To do this, enter the vlan vlan-id command to move to vlan-config mode. From vlan-config mode, you can manage the parameters of the VLANs.
f. NOTE
g. You cannot modify any of the parameters for VLAN 1.
h. Create a VLAN in the extended range.
Extended VLANs support VLANs up to 4096 in accordance with the 802.1Q standard. Currently only switches running COS 6.1 or greater can support creation and assignment of VLANs in the extended range. You cannot currently use VTP to manage VLANs in the extended range, and these VLANs cannot be passed over an Inter-Switch Link (ISL) trunk link.
1. Enable spanning-tree MAC reduction:
COS
set spantree macreduction enable
IOS
N/A
2.
3. To allow these switches to use the extended range, you must first enable spanningtree macreduction to allow the switch to support a large number of spanning-tree instances with a very limited number of MAC addresses and still maintain the IEEE 802.1D bridge ID requirement for each STP instance.
4. NOTE
5. After you have created a VLAN in the extended range, you cannot disable this feature unless you first delete the VLAN.
6. Create a VLAN in the extended range:
COS
set vlan vlan-id [name name] [state state] [mtu mtu]
IOS
N/A
7.
8. Here the vlan-id would be a number from 1025 to 4096. Numbers 1001 to 1024 are reserved by Cisco and cannot be configured.
9. CAUTION
10. For Catalyst 6000 series switches with FlexWAN cards, the system identifies these ports internally with VLAN numbers starting with 1025. If you have any FlexWAN modules, be sure to reserve enough VLAN numbers (starting with VLAN 1025) for all the FlexWAN ports you want to install. You cannot use these extended VLANs if you install FlexWAN ports.
Feature Example
In this example, the switches Access_1 and Distribution_1 are going to be configured with VLANs 5, 8, and 10 with the names Cameron, Logan, and Katie, respectively. Also the distribution switch will be configured with VLAN 2112 with the name Rush.
An example of the Catalyst OS configuration for Distribution 1 follows:Distribution_1 (enable)>set vtp mode transparentDistribution_1 (enable)>set vlan 5 name CameronDistribution_1 (enable)>set vlan 8 name LoganDistribution_1 (enable)>set vlan 10 name KatieDistribution_1 (enable)>set spantree macreduction enableDistribution_1 (enable)>set vlan 2112 name RushDistribution_1 (enable)>
An example of the Supervisor IOS configuration for Distribution 1 follows:Distribution_1#vlan databaseDistribution_1(vlan)#vtp transparentDistribution_1(vlan)#exitDistribution_1#conf tDistribution_1(config)#vlan 5 Distribution_1(config-vlan)# name CameronDistribution_1(config-vlan)#vlan 8 Distribution_1(config-vlan)# name LoganDistribution_1(config-vlan)# vlan 10Distribution_1(config-vlan)# name KatieDistribution_1(config-vlan)# endDistribution_1 #copy running-config startup-config
NOTE
For the Supervisor IOS, extended VLANs such as 2112 are not supported.
An example of the Layer 2 IOS configuration for Access 1 follows:Access_1#vlan databaseAccess_1 (vlan)#vtp transparentAccess_1 (vlan)#vlan 5 name CameronAccess_1 (vlan)#vlan 8 name LoganAccess_1 (vlan)#vlan 10 name KatieAccess_1 (vlan)#exitAccess_1#copy running-config startup-config
6-2: VLAN Port Assignments
· VLANs are assigned to individual switch ports.
· Ports can be statically assigned to a single VLAN or dynamically assigned to a single VLAN.
· All ports are assigned to VLAN 1 by default
· Ports are active only if they are assigned to VLANs that exist on the switch.
· Static port assignments are performed by the administrator and do not change unless modified by the administrator, whether the VLAN exists on the switch or not.
· Dynamic VLANs are assigned to a port based on the MAC address of the device plugged into a port.
· Dynamic VLAN configuration requires a VLAN Membership Policy Server (VMPS) client, server, and database to operate properly.
Configuring Static VLANs
On a Cisco switch, ports are assigned to a single VLAN. These ports are referred to as access ports and provide a connection for end users or node devices, such as a router or server. By default all devices are assigned to VLAN 1, known as the default VLAN. After creating a VLAN, you can manually assign a port to that VLAN and it will be able to communicate only with or through other devices in the VLAN. Configure the switch port for membership in a given VLAN as follows:
1. Statically assign a VLAN:
COS
set vlan number mod/port
IOS
(global) interface type mod/port
(interface) switchport access vlan number
2.
3. To change the VLAN for a COS device, use the set vlan command, followed by the VLAN number, and then the port or ports that should be added to that VLAN. VLAN assignments such as this are considered static because they do not change unless the administrator changes the VLAN configuration.
4. For the IOS device, you must first select the port (or port range for integrated IOS) and then use the switchport access vlan command followed by the VLAN number.
5. CAUTION
6. If the VLAN that the port is assigned to does not exist in the database, the port is disabled until the VLAN is created.
Configuring Dynamic VLANs
Although static VLANs are the most common form of port VLAN assignments, it is possible to have the switch dynamically choose a VLAN based on the MAC address of the device connected to a port. To achieve this, you must have a VTP database file, a VTP server, a VTP client switch, and a dynamic port. After you have properly configured these components, a dynamic port can choose the VLAN based on whichever device is connected to that port. Use the following steps to configure dynamic VLANs:
1. Create a VTP database file.
Using a text editor, such as WordPad or vi, create a VTP database file and place it on a VMPS or Remote Copy Protocol (RCP) server. The VTP database file contains the following elements:
o A header that includes a VMPS domain name
o The VMPS operational mode
o The fallback VLAN name
o A list of MAC address mapped to VLAN names
The basic outline of a VMPS database file is as follows:vmps domain Switchblock1vmps mode openvmps fallback defaultvmps no-domain-req deny!vmps-mac-addrs!!address 0001.0387.0943 vlan-name GroupAaddress 0050.0491.F950 vlan-name GroupBaddress 0050.DA8F.1134 vlan-name GroupC
The very first thing that should be in the VTP database file are the letters vmps followed by the word domain and a domain name. The domain name matches that of the VTP domain name of the switch(es) sending the VMPS request. (VTP is discussed further in section "6-4: VLAN Trunking Protocol.") This name is used in the request for VMPS mapping information. The next three lines in the file are information about how VMPS should operate. The mode open indicates whether a request comes in that is not in the MAC address list. The switch should place that device in a default VLAN. The next line specifies that VLAN by name. The name default is that of VLAN 1. You can also configure the mode as closed; if this is the case, the port will be suspended if the device is not in the MAC address table. The no-domain-req deny option states that any device that sends a request with no domain name should not be given any port VLAN mapping information. Each ! (exclamation point) is a comment and is ignored by the VMPS server.
The vmps-mac-addrs entry indicates the start of the MAC address to VLAN mapping. The entries are entered with the format address address vlan-name vlan_name, where the address is in dotted-hexadecimal format and the VLAN name is the exact name (including case) as found in the VLAN database of the requesting switch. When a request is sent, this mapping is returned to the requesting switch. The VLAN assignment is based on the name returned. If the name is not found on the local switch, the assignment is not made.
2. Configure the VMPS server.
a. (Optional) Set the VMPS download method:
COS
set vmps downloadmethod {rcp tftp}
IOS
N/A
b.
c. Specify how to download the VMPS database file using rcp or tftp. If you do not choose a method, the default is tftp.
d. Set the VMPS download server and filename:
COS
set vmps downloadserver ipaddress [filename]
IOS
N/A
e.
f. Configure the IP address of the RCP or TFTP server and specify the filename of the VMPS database.
g. Enable the VMPS server service:
COS
set vmps state enable
IOS
N/A
h.
i. When you enable the VMPS server service, it will read the file from the server into the memory of the switch and will then be able to respond to request from the VMPS client switches. Use the commands show vmps, show vmps mac, show vmps vlan, and show vmps statistics to verify the operation of the VMPS server.
j. NOTE
k. After the VMPS server service has been enabled and the VMPS information loaded into the memory of the server, the VMPS database file is no longer referenced. If you make changes to the VMPS database file, you must either disable and reenable the server service or reload the file with the command download vmps.
3. Configure the VMPS client:
COS
set vmps server ipaddress [primary]
IOS
(global) vmps server ipaddress primary
4.
5. Any switch that will have dynamic ports is considered a VMPS client. For this switch to request the dynamic VLAN information from the server, you must configure the client with the server address. Use the primary option to specify the IP address of the main VMPS server. You can also specify up to three other IP addresses for VMPS servers. Use the command show vmps server for COS and show vmps on IOS devices to confirm the server configuration.
6. NOTE
7. If the a switch is configured as a VMPS server and it will also have dynamic ports, it must also be configured as a client using Step 3 and pointing to its own IP address as server.
8. Configure the port for dynamic VLAN assignments:
COS
set port membership mod/port dynamic
IOS
(interface) switchport access dynamic
9.
10. This places the port in dynamic VLAN mode. The switch must first be configured as a client (Step 3) before you configure a port as dynamic. After this has been configured, the port is assigned to the local switch's VLAN that has a name that matches the one mapped to the MAC address of the attached device in the VMPS database.
Verifying VLAN Assignments
After configuring a port for VLAN assignments, use one of the following commands to verify the VLAN port assignments:
COS
show port
IOS
(privileged) show interface type mod/port switchport
-OR-
(privileged)show interface status

NOTE
The command show interface status is not available on all switches that run IOS.
Feature Example
In this example, ports for the switches Access_1 and Distribution_1 are assigned as follows:
· Static assignments for ports 1 and 2 on the access switch and 3/1–48 on the distribution switch into VLAN 5
· Static assignments for ports 3 and 4 on the access switch and 4/1–48 on the distribution switch into VLAN 8
· Static assignments for ports 5 and 6 on the access switch and 5/1–12 and 5/18–24 on the distribution switch into VLAN 10
Distribution_1 will be assigned the IP address 10.1.1.1 and will serve as a VMPS server and get a file called vmpsconfig.txt (shown at the end of the example) from the server 10.1.1.101.
Ports 13–16 will be dynamic on the access switch, and ports 5/13-17 will be dynamic on the Distribution_1 server. Figure 6-1 shows the connections and assignments associated with this example.
Figure 6-1 VLAN Port Assignments on Access_1 and Distribution_1
An example of the Catalyst OS configuration for Distribution_1 follows:Distribution_1 (enable)>set vlan 5 3/1-48Distribution_1 (enable)>set vlan 8 4/1-48Distribution_1 (enable)>set vlan 10 5/1-12,5/18-24Distribution_1 (enable)>set vmps downloadserver 10.1.1.101 vmpsconfig.txtDistribution_1 (enable)>set int sc0 10.1.1.1/24Distribution_1 (enable)>set vmps enableDistribution_1 (enable)>set vmps server 10.1.1.1Distribution_1 (enable)> set port membership 5/13-17 dynamic
An example of the Supervisor IOS configuration for Distribution_1 follows:Distribution_1(config)#interface range fastethernet 3/1 - 48 Distribution_1(config-if)#switchportDistribution_1(config-if)#switchport mode accessDistribution_1(config-if)#switchport access vlan 5Distribution_1(config-if)#no shutDistribution_1(config)#interface range fastethernet 2/1 - 48 Distribution_1(config-if)#switchportDistribution_1(config-if)#switchport mode accessDistribution_1(config-if)#switchport access vlan 8Distribution_1(config-if)#no shutDistribution_1(config)#interface range fastethernet 5/1 - 12 , 5/18 - 24Distribution_1(config-if)#switchportDistribution_1(config-if)#switchport mode accessDistribution_1(config-if)#switchport access vlan 10Distribution_1(config-if)#no shutDistribution_1(config-if)# endDistribution_1 #copy running-config startup-config
NOTE
For the Supervisor IOS running on a Catalyst 6000 or Catalyst 4000, dynamic VLAN services are currently not supported. These switches cannot be configured with dynamic access ports or to act as a VMPS server.
An example of the Layer 2 IOS configuration for Access_1 follows:Access_1(config)#interface fastethernet 0/1Access_1(config-if)#switchport access vlan 5Access_1(config-if)#interface fastethernet 0/2Access_1(config-if)#switchport access vlan 5Access_1(config-if)#interface fastethernet 0/3Access_1(config-if)#switchport access vlan 8Access_1(config-if)#interface fastethernet 0/4Access_1(config-if)#switchport access vlan 8Access_1(config-if)#interface VLAN 1Access_1(config-if)#ip address 10.1.1.2 255.255.255.0Access_1(config-if)#vmps server 10.1.1.1Access_1(config)#interface fastethernet 0/5Access_1(config-if)#switchport access dynamicAccess_1(config-if)#interface fastethernet 0/6Access_1(config-if)#switchport access vlan dynamicAccess_1(config-if)# endAccess_1 #copy running-config startup-config
An example of the VMPS database file vmpsconfig.txt follows:vmps domain Switchblock1vmps mode openvmps fallback defaultvmps no-domain-req allow!vmps-mac-addrs

0 comments: