UCCN1003 Data Communications and NetworksLab 05: Virtual LAN (VLAN) and VLAN Trunking Protocol (VTP)Instructions:    1. Re...
A managed switch, such as Cisco 2950 and 2960 series switch, can be configured to suit certainLAN requirement.   1. Drag a...
5. Some of the switch commands are quite similar to the router commands. Please try out     some of the following commands...
2. Type the following commands in Switch0. What do you observe?Switch0#clear mac-address-tableSwitch0#show mac-address-tab...
Switch0(config)#vlan 3Switch0(config-vlan)#name MarketingSwitch0(config-vlan)#exitSwitch0(config)#exit  3. Type the follow...
7. Type “show vlan” again. Recording the difference. You should observe that various      switch ports have been assigned ...
3. Change the IP address of PC3 to 192.168.2.3, and the IP of PC4 to 192.168.2.4. Set the      default gateway of both PCs...
Switch0#show vlan brief  4. In Router0, type the following command to “clean up” the IP addresses.Router(config)#int fa0/0...
Switch0#show mac-address-tableExercise 6: Integrated VLAN with other SwitchesWe use 2 switches to form an integrated VLAN ...
Switch1(config-if)#switchport mode trunkSwitch1(config-if)#exit  5. Set VLAN 2 and VLAN 3 in Switch1. Set the Fa0/12 to VL...
VTP is a Cisco proprietary Layer 2 messaging protocol that manages the addition, deletion, andrenaming of Virtual Local Ar...
Switch1#show vtp statusSwitch2#show vtp status  7. Set VTP client and VTP domain name in Switch2. (Note: A VTP client in a...
13. Check the VLAN status of three switches again.Switch0#show vlan briefSwitch1#show vlan briefSwitch2#show vlan brief  1...
Router(config)#int fa0/0.3Router(config-subif)#encapsulation dot1q 10Router(config-subif)#ip address 192.168.10.254 255.25...
Upcoming SlideShare
Loading in …5
×

Uccn1003 -may10_-_lab_05_-_vlan_and_vtp-updated-14.7.2010

1,045 views
982 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,045
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
61
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Uccn1003 -may10_-_lab_05_-_vlan_and_vtp-updated-14.7.2010

  1. 1. UCCN1003 Data Communications and NetworksLab 05: Virtual LAN (VLAN) and VLAN Trunking Protocol (VTP)Instructions: 1. Read the “Introduction” section for the background. 2. Perform all the lab exercises, starting with exercise 1. 3. Follow all the steps. 4. Record the results in all italic bold actions (by screen capture or copying). 5. Paste your screen captures on a Word Document and save it. 6. Answer all the questions in italic. 7. Write your answer in the same Word Document. 8. Please follow the sequence of the exercises, and don’t skip any step. 9. Please keep your word document. You will need it for your tests and exam. 10. Please try to understand the exercises and the commands, and don’t just type the commands “blindly” without much studies and understanding.Introduction to VLAN and VTPThis lab introduces the configuration for Cisco managed switch. One of the major functionprovided by managed switch is the configuration of virtual LAN.A virtual LAN, commonly known as a VLAN, is a group of hosts with a common set ofrequirements that communicate as if they were attached to the “broadcast domain”, regardless oftheir physical location. A VLAN has the same attributes as a physical LAN, but it allows for endstations to be grouped together even if they are not located on the same network switch. Networkreconfiguration can be done through software instead of physically relocating devices.VLANs are created to provide the segmentation services traditionally provided by routers inLAN configurations. VLANs address issues such as scalability, security, and networkmanagement. Routers in VLAN topologies provide broadcast filtering, security, addresssummarization, and traffic flow management. By definition, switches may not bridge IP trafficbetween VLANs as it would violate the integrity of the VLAN broadcast domain.VLAN Trunking Protocol (VTP) is a Cisco proprietary Layer 2 messaging protocol that managesthe addition, deletion, and renaming of Virtual Local Area Networks (VLAN) on a network-widebasis. Ciscos VLAN Trunk Protocol reduces administration in a switched network. When a newVLAN is configured on one VTP server, the VLAN is distributed through all switches in thedomain. This reduces the need to configure the same VLAN everywhere.Exercise 1: Some Introductory Switch Commands 1
  2. 2. A managed switch, such as Cisco 2950 and 2960 series switch, can be configured to suit certainLAN requirement. 1. Drag a Cisco 2960 switch (not 2950-24) and a PC into the Packet Tracer workspace. 2. Connect a rollover cable between PC0 (RS-232) and Swich0 (console port). 3. Double click on PC0, click on “Desktop” tab, and then click on “Terminal”. Set the parameters as the following figure and click “OK”. 4. Again, this is to remind you that, as in router, CLI tab of switch does not exist in the real world. To configure a managed switch such Cisco 2960, you have to use Hyperterminal (or similar software) to access the switch console port with a rollover cable. Now, you are ready for some basic switch commands 2
  3. 3. 5. Some of the switch commands are quite similar to the router commands. Please try out some of the following commands.Switch>enSwitch#show flash:Switch#show versionSwitch#show runSwitch#show history 6. As in router, you can also put the “enable” password in the switch.Switch#conf tSwitch(config)#hostname Switch0Switch0(config)#enable password uccn1003Switch0(config)#exitSwitch0#disableSwitch0>enPassword: (type in “uccn1003”)Switch0#show runExercise 2: Checking MAC Address Table 1. Connect 4 PCs to Switch0 as shown in the following figure. Connect PC1 to Fa0/1 of Switch0. Then connect PC2 to Fa0/2. Connect PC3 to Fa0/3 and PC4 to Fa0/4. Set the IP address and subnet mask to PCs according to the figure. 3
  4. 4. 2. Type the following commands in Switch0. What do you observe?Switch0#clear mac-address-tableSwitch0#show mac-address-table 3. Ping all other PCs from PC1. If the pings are not successful, troubleshoot the network. If the pings are successful, type “show mac-address-table” at Switch0 again. What do you observe this time?Switch0#show mac-address-table 4. Now check the MAC addresses of all the PCs and compare the MAC addresses with the MAC addresses of the MAC table of Switch0. Do the MAC addresses match with switch ports?PC>ipconfig /allExercise 3: Configuring Static VLANsIf you create 2 VLANs within a managed switch, you have actually two LANs that do notcommunicate with each other though 2 LANs share the same switch physically. 1. Type the following command to check the current status of VLANs in Switch0.Switch0#show vlan 2. Type the following to create two VLANs with names.Switch0#config tSwitch0(config)#vlan 2Switch0(config-vlan)#name FinanceSwitch0(config-vlan)#exit 4
  5. 5. Switch0(config)#vlan 3Switch0(config-vlan)#name MarketingSwitch0(config-vlan)#exitSwitch0(config)#exit 3. Type the following commands in Switch0 and compare the output with ex3.1. You should observe the two “new” VLANs.Switch0#show vlan 4. Assign switch port fa0/1 and fa0/2 to VLAN 2 by typing the following commands.Switch0#config tSwitch0(config)#int fa0/1Switch0(config-if)#switchport access vlan 2Switch0(config-if)#exitSwitch0(config)#int fa0/2Switch0(config-if)#switchport access vlan 2Switch0(config-if)#exit 5. Type “show vlan” again. Recording the difference. 6. If you feel that assigning switch ports one by one to a particular VLAN is rather tedious and inconvenient. The following commands provide “batch assigning” of switch ports to a particular VLAN. We assign Fa0/3 to Fa0/5 to VLAN 3.Switch0(config)#int range fa0/3–5Switch0(config-if-range)#switchport access vlan 3Switch0(config-if-range)#end 5
  6. 6. 7. Type “show vlan” again. Recording the difference. You should observe that various switch ports have been assigned to VLAN 2 and VLAN 3. 8. Ping all other PCs with PC1. Do you successfully ping all the PCs? If not, use PC3 to ping all other PCs too. What have you noticed with the pings? 9. Type “show mac-address-table” to check the status of MAC address table.Switch0#show mac-address-tableExercise 4: Routing between VLANsYou need a router for the VLANs to communicate with each other. However, to do that, we haveto make a few changes to the original configuration. Please note that routing of VLANs DONOT VIOLATE the subnet rules. On the contrary, VLANs follow all the subnet rules. 1. Drag a Cisco 2811 router into the workspace. Connect Fa0/1 of Router0 to Fa0/5 of Switch0. Then, connect Fa0/0 of Router0 to Fa0/6 of Switch0. 2. Set switch Fa0/6 of Switch0 to VLAN 2 (from VLAN 1). Now Fa0/1, Fa0/2, and Fa0/6 belong to VLAN 2. Fa0/5 of Switch0 has already been set to VLAN 3.Switch0#config tSwitch0(config)#int fa0/6Switch0(config-if)#switchport access vlan 2Switch0(config-if)#exit 6
  7. 7. 3. Change the IP address of PC3 to 192.168.2.3, and the IP of PC4 to 192.168.2.4. Set the default gateway of both PCs to 192.168.2.254. (Note: We have to change the IP addresses of PC3 and PC4 so that they have a different network ID as compared to PC1 and PC2. Remember the subnet rule that stated clearly that router won’t accept IP address of different router ports with the same network ID). 4. Also, set the default gateway of PC1 and PC2 to 192.168.1.254. 5. For Router0, set the IP of Fa0/1 to 192.168.2.254. Set the IP of Fa0/0 to 192.168.1.254. 6. Use PC1 to ping all other PCs. You should be able to ping them. If not, please troubleshoot the network.Exercise 5: Routing with Trunking ModeInstead of connecting 2 cables from Switch0 to the router, we will use only 1 cable to connectbetween Switch0 and router. By using a special “trunk”, we are able to “link” all the VLANs tothe router with just 1 cable. You can imagine a “trunk” as a big pipe loaded with a few Ethernetcables. 1. Erase the two cables connecting between Switch0 and Router0. 2. Connect Fa0/24 of Switch0 to Fa0/0 of Router0 3. Change Fa0/5 and Fa0/6 of Switch0 back to VLAN 1. Use “show vlan brief” to check and to make sure these two switch ports have been assigned to VLAN 1.Switch0(config)#int range fa 0/5 – 6Switch0(config-range)#switchport access vlan 1Switch0(config-range)#end 7
  8. 8. Switch0#show vlan brief 4. In Router0, type the following command to “clean up” the IP addresses.Router(config)#int fa0/0Router(config-if)#no ip addrRouter(config-if)#int fa0/1Router(config-if)#no ip addrRouter(config-if)#exit 5. Now, we need to set the connection between Switch0 and Router0 to trunk mode. It comes in two parts: the switch and the router. 6. In Switch0, type the following command to turn Fa0/24 into trunk mode.Switch0#conf tSwitch0(config)#int fa0/24Switch0(config-if)#switchport mode trunkSwitch0(config-if)#exit 7. At Router0, type in the following commands.Router#config tRouter(config)#int fa0/0Router(config-if)#no shutdownRouter(config-if)#int fa0/0.1Router(config-subif)#encapsulation dot1q 2Router(config-subif)#ip address 192.168.1.254 255.255.255.0Router(config-subif)#int fa0/0.2Router(config-subif)#encapsulation dot1q 3Router(config-subif)#ip address 192.168.2.254 255.255.255.0Router(config-subif)#endRouter#show run 8. Explanation for the router commands: i) “int fa0/0.1” and “int fa0/0.2” = sub-interfaces of the physical port “fa0/0”. One physical port can have many sub-interfaces (e.g “int fa0/0.3” to “int fa0/0.100”). ii) “encapsulation dot1q 3” = “encapsulation dot1q” is the command for the special trunking mode in router. “3” = VLAN number. iii) Since we have two “virtual” cable in 1 physical cable, we still require two gateway IP addresses for two VLANs. 9. Use PC1 to ping all other PCs. PC1 should be able to ping all other PCs. If not, please troubleshoot the network. 10. After you have successfully ping all the PCs. Type “show mac-address-table” to examine the status of the MAC address table of Switch0. 8
  9. 9. Switch0#show mac-address-tableExercise 6: Integrated VLAN with other SwitchesWe use 2 switches to form an integrated VLAN 2 and VLAN 3. 1. Add another switch (2960) to the network according to the above diagram. (Note: Though Router0 has been moved, the function still remains as in Exercise 5). 2. Connect Gig1/1 (GigabitEthernet, 1000Mbps) of Switch0 to Gig1/1 of Switch1. Connect PC5 to Fa0/12 of Switch1. Connect PC6 to Fa0/13 of Switch1. (Note: We can connect a trunk between the FastEthernet ports of two switches. However, GigabitEthernet ports provide better bandwidth for a trunk.) 3. Set the IP address, subnet mask, and gateway IP of PC5 and PC6. 4. Set Gig1/1 of both Switch1 and Switch0 to trunk mode. As in the trunk of Switch0 and Router0. This trunk of Switch0 and Switch1 will act like a “big” pipe that carries a few virtual cables for the VLANs.Switch0#conf tSwitch0(config)#int gig1/1Switch0(config-if)#switchport mode trunkSwitch0(config-if)#exitswitch#conf tswitch(config)#hostname Switch1Switch1(config)#int gig1/1 9
  10. 10. Switch1(config-if)#switchport mode trunkSwitch1(config-if)#exit 5. Set VLAN 2 and VLAN 3 in Switch1. Set the Fa0/12 to VLAN 2 and Fa0/13 to VLAN 3. Type “show vlan brief” to check whether the VLANs and the port assignment have been done properly.Switch1#conf tSwitch1(config)#vlan 2Switch1(config-vlan)#exitSwitch1(config)#vlan 3Switch1(config-vlan)#exitSwitch1(config)#int fa0/12Switch1(config-if)#switchport access VLAN 2Switch1(config-if)#exitSwitch1(config)#int fa0/13Switch1(config-if)#switchport access VLAN 3Switch1(config-if)#endSwitch1#show vlan brief 6. Use PC5 to ping all other PCs. PC5 should be able to ping all other PCs. If not, please troubleshoot the network. 7. Use the “simulation mode” (as shown in the following figure) to trace how the ICMP data packet travel from PC6 to PC5.Exercise 7: VLAN Trunking Protocol (VTP) 10
  11. 11. VTP is a Cisco proprietary Layer 2 messaging protocol that manages the addition, deletion, andrenaming of Virtual Local Area Networks (VLAN) on a network-wide basis. Which means ifyou add (or delete or rename) a VLAN in a switch, and every other switch will have the newVLAN. Without VTP, the addition and deletion of VLAN have to be done one switch by oneswitch. VTP only works with switches linking together via trunk mode. 1. Add a third switch (2960) to the network according to the above diagram. (Note: Though PC6 has been moved, the function still remains as in Exercise 6). 2. Connect Gig1/2 of Switch1 to Gig1/2 of Switch2. Connect PC7 to Fa0/20 of Switch1. Connect PC8 to Fa0/2 of Switch2. Connect PC9 to Fa0/10 of Switch2. 3. Set Gig1/2 of Switch1 and Switch2 to trunk mode. 4. Set the IP address of PC7 and PC9 according to the above figure. Put the gateway IP of PC7 and PC9 to be 192.168.10.254. Set IP address and gateway IP of PC8 too. 5. Check the VLAN status of three switches (“show vlan brief”) and make a record.Switch0#show vlan briefSwitch1#show vlan briefSwitch2#show vlan brief 6. Check the VTP status of three switches and make a record.Switch0#show vtp status 11
  12. 12. Switch1#show vtp statusSwitch2#show vtp status 7. Set VTP client and VTP domain name in Switch2. (Note: A VTP client in a particular domain can’t add, delete or rename VLAN. Only a VTP server of the domain can perform the task of adding, deleting and renaming VLAN. VTP clients just “follow” VTP server of the same domain. Same domain means both VTP server and VTP client must have the same VTP domain name.)Switch2#conf tSwitch2(config)#vtp mode clientSwitch2(config)#vtp domain uccn1003 8. Set VTP client and VTP domain name in Switch1.Switch1#conf tSwitch1(config)#vtp mode clientSwitch1(config)#vtp domain uccn1003 9. Set VTP server and VTP domain name in Switch0. (Note: Switch0 may have automatically been set to domain uccn1003. Please type the commands just to make sure…)Switch0#conf tSwitch0(config)#vtp mode serverSwitch0(config)#vtp domain uccn1003 10. Check the VLAN status of three switches (“show vlan brief”) and make a record. Compare this record with the record you have made in ex7.5.Switch0#show vlan briefSwitch1#show vlan briefSwitch2#show vlan brief 11. You should have notice that Switch1 and Switch2 have the “additional” VLAN (VLAN 2 and VLAN 3) as in Switch0. However, the “switch port assignment” is different. (Please note that VTP does not perform the switch port assignment to VLAN for you. VTP ONLY perform addition, deletion, and rename of VLAN, NOT switch port assignment). 12. Add VLAN 10 and VLAN 20 to Switch0.Switch0#conf tSwitch0(config)#vlan 10Switch0(config-vlan)#exitSwitch0(config)#vlan 20Switch0(config-vlan)#end 12
  13. 13. 13. Check the VLAN status of three switches again.Switch0#show vlan briefSwitch1#show vlan briefSwitch2#show vlan brief 14. Delete VLAN 20 and rename VLAN 10 to “Technical”.Switch0#conf tSwitch0(config)#no VLAN 20Switch0(config)#vlan 10Switch0(config-vlan)#name TechnicalSwitch0(config-vlan)#end 15. Check the VLAN status of three switches again. VLAN 20 should be deleted and the name VLAN 10 has been changed to “Technical” for all three switches.Switch0#show vlan briefSwitch1#show vlan briefSwitch2#show vlan brief 16. Assign Fa0/20 of Switch1 to VLAN 10.Switch1#conf tSwitch1(config)#int fa0/20Switch1(config-if)#switchport access vlan 10Switch1(config-if)#endSwitch1#show vlan brief 17. Assign Fa0/2 of Switch2 to VLAN 2. Assign Fa0/10 of Switch2 to VLAN 10Switch2#conf tSwitch2(config)#int fa0/2Switch2(config-if)#switchport access vlan 2Switch2(config-if)#exitSwitch2(config)#int fa0/10Switch2(config-if)#switchport access vlan 10Switch2(config-if)#endSwitch2#show vlan brief 18. VLAN 10 is still unknown to Router0. Type in the following commands in Router0 so that VLAN 10 will have the gateway IP in Router0.Router#config t 13
  14. 14. Router(config)#int fa0/0.3Router(config-subif)#encapsulation dot1q 10Router(config-subif)#ip address 192.168.10.254 255.255.255.0Router(config-subif)#endRouter#show ip int brief 8. Use PC9 to ping all other PCs. PC9 should be able to ping all other PCs. If not, please troubleshoot the network. 9. Use the “simulation mode” to trace how the ICMP data packet travel from PC9 to PC8.Exercise 8: VLAN Routing with 2 Routers (Homework)Build and configure the following network so that PC13 can ping any PC in the network (Add ontop of what you have finished in Exercise 7). Use RIP for dynamic routing. Configure theappropriate gateway IP, VLANs, trunking, and subnets based on your own design choice, if it isnot indicated in the following figure. 14

×