You are on page 1of 14

Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology

Computer Networks 2 - Labs

Contents
Lab 1: Introduction to networking materials and software tools

Lab 2: Practice on Cisco network devices

Lab 3: Building a complete network on Packet Tracer

Lab 4: LAN-to-LAN Connections

Lab 5: Advanced LAN Switching Configuration - VLANs

Lab 6: Building Inter-VLAN Network with a Router and Layer-3 Switch

Lab 7: Basic Router Configuration

Lab 8: RIP Version 2 and Debugging

Lab 9: Configure OSPF on a multi-access network

Lab 10: BGP - inter-autonomous system routing protocol

Lab 11: Wireless Network and AP Configuration

Lab 12: Using a network management and monitoring tool

Computer Networks 2 – Laboratories 1

VLANs I. the interface providing updated VTP information. II. Configuring VLANs on Cisco Catalyst 2960 Switch ◦ Configuring VTP Domain Before you create VLANs. the switch learns the domain name from the VTP server in the domain. Command Purpose Step 1 configure terminal Enter global configuration mode. transparent or off). Objectives: • This lab describes how to configure normal-range VLANs (VLAN IDs 1 to 1005) and extended-range VLANs (VLAN IDs 1006 to 4094) on the Catalyst 2960 Switches. 1801 IS Router) will be given at Lab time. the domain name. unknown: an unknown database type. Step 2 vtp domain domain-name Configure the VTP administrative-domain name. You use the vtp global configuration command to set the VTP password. The name can be 1 to 32 characters. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Lab 5: Advanced LAN Switching Configuration . • Describes the features and interfaces that can be configured on the VLANs assigned to the switch ports on Cisco 1801 Integrated-Services Router. If the switch has a trunk connection to a VTP domain. mst: the multiple spanning tree (MST) database. It includes information about VLAN membership modes. Introduction to VLAN Configuration on Cisco devices 1. This command is optional for modes other than server mode. VLAN trunks (Dynamic VLAN assignment from a VLAN Membership Policy Server (VMPS) is actually ignored). • Cisco devices (8-port Catalyst 2960 Switch. All switches operating in VTP server or client mode under the same administrative responsibility must be configured with the same domain name. VTP server mode requires a domain name. you must decide whether to use VLAN Trunking Protocol (VTP) to maintain global VLAN configuration for your network. server. the VTP file name. and the mode. Step 3 vtp mode{client|server|transparent|off} Configure the switch for VTP mode (client. and to disable or enable pruning. {vlan|mst|unknown} (Optional) Configure the database: vlan: the VLAN database is the default if none are configured. Computer Networks 2 – Laboratories 2 . VLAN configuration modes. the version. You should configure the VTP domain before configuring other VTP parameters.

Step 7 copy running-config startup-config (Optional) Save the configuration in the startup configuration file. Step 4 show vtp status Verify your entries in the VTP Pruning Mode field of the display. Command Purpose show vtp counters Display counters about VTP messages that have been sent and received. You need to enable pruning on only one switch in VTP server mode. Step 2 vtp pruning Enable pruning in the VTP administrative domain. the current VTP revision. the VTP domain does not function properly if you do not assign the same password to each switch in the domain. show vtp devices[conflict] Display information about all VTP version 3 devices in the domain. Note Only VTP mode and domain name are saved in the switch running configuration and can be copied to the startup configuration file. The show vtp devices command does not display information when the switch is in transparent or off mode. pruning is disabled. The password can be 8 to 64 characters. show vtp status Display the VTP switch configuration information. By default. Step 3 end Return to privileged EXEC mode. Command Purpose Step 1 configure terminal Enter global configuration mode. Step 6 show vtp status Verify your entries in the VTP Operating Mode and the VTP Domain Name fields of the display. Conflicts are VTP version 3 devices with conflicting primary servers. show vtp password Display the VTP password. show vtp interface[interface-id] Display VTP status and configuration for all interfaces or the specified interface. ◦ Enabling VTP Pruning Pruning increases available bandwidth by restricting flooded traffic to those trunk links that the traffic must use to access the destination devices. Step 5 end Return to privileged EXEC mode. Computer Networks 2 – Laboratories 3 . Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Step 4 vtp password yourpassword (Optional) Set the password for the VTP domain. The form of the password displayed depends on whether or not the hidden keyword was entered and if encryption is enabled on the switch. If you configure a VTP password. ◦ Monitoring VTP You monitor VTP by displaying VTP configuration information: the domain name. You can also display statistics about the advertisements sent and received by the switch. and the number of VLANs. You can only enable VTP pruning on a switch in VTP server mode.

any ports assigned to that VLAN become inactive. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology ◦ Configuring VLANs All the PCs in a particular IP subnet belong to the same VLAN. Computer Networks 2 – Laboratories 4 . Step 5 remote-span (Optional) Configure the VLAN as the RSPAN VLAN for a remote SPAN session. Step 2 no vlan vlan-id Remove the VLAN by entering the VLAN ID. If no name is entered for the VLAN. Step 2 vlan vlan-id Enter a VLAN ID. the VLAN configuration is saved in the running configuration file as well as in the VLAN database. Command Purpose Step 1 configure terminal Enter global configuration mode. When you delete a VLAN. the VLAN is removed from the VLAN database for all switches in the VTP domain. Deleting a VLAN When you delete a VLAN from a switch that is in VTP server mode. and enter VLAN configuration mode. Step 4 mtu mtu-size (Optional) Change the MTU size (or other VLAN characteristic). Assigning Static-Access Ports to a VLAN You can assign a static-access port to a VLAN without having VTP globally propagate VLAN configuration information by disabling VTP (VTP transparent mode). Step 5 copy running-config startup config (Optional) If the switch is in VTP transparent mode. If you assign an interface to a VLAN that does not exist. or enter an existing VLAN ID to modify that VLAN. Configuring Normal-Range VLANs Command Purpose Step 1 configure terminal Enter global configuration mode. Step 6 end Return to privileged EXEC mode. This saves the configuration in the switch startup configuration file. For example. the VLAN configuration is saved in the running configuration file as well as in the VLAN database. the default is to append the vlan-id with leading zeros to the word VLAN. the new VLAN is created. Step 3 name vlan-name (Optional) Enter a name for the VLAN. Step 4 show vlan brief Verify the VLAN removal. Step 7 show vlan{name vlan-name | id vlan-id} Verify your entries. VLAN0004 is a default VLAN name for VLAN 4. Enter a new VLAN ID to create a VLAN. Step 8 copy running-config startup config (Optional) If the switch is in VTP transparent mode. Step 3 end Return to privileged EXEC mode. Interface VLAN membership on the switch is assigned manually on an interface-by-interface basis. This saves the configuration in the switch startup configuration file.

The range is 1006 to 4094. only the mtu mtu-size. Step 5 remote-span (Optional) Configure the VLAN as the RSPAN VLAN. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Command Purpose Step 1 configure terminal Enter global configuration mode Step 2 interface interface-id Enter the interface to be added to the VLAN. Step 5 end Return to privileged EXEC mode. Step 2 vtp mode transparent Configure the switch for VTP transparent mode. To save extended- range VLAN configurations. Note This step is not required for VTP version 3. Note With VTP version 3. Displaying VLANs Command Purpose Computer Networks 2 – Laboratories 5 . Valid VLAN IDs are 1 to 4094. Step 3 vlan vlan-id Enter an extended-range VLAN ID and enter VLAN configuration mode. Step 7 show interfaces interface-id switchport Verify your entries in the Administrative Mode and the Access Mode VLAN fields of the display. Note Although all VLAN commands appear in the CLI help. the VLAN configuration is also saved in the VLAN database. Step 8 copy running-config startup-config (Optional) Save your entries in the configuration file. if the switch resets. Step 4 switchport access vlan vlan-id Assign the port to a VLAN. and the extended-range VLAN IDs will not be saved. and remote-span commands are supported for extended- range VLANs. Configuring Extended-Range VLANs Command Purpose Step 1 configure terminal Enter global configuration mode. Step 3 switchport mode access Define the VLAN membership mode for the port (Layer 2 access port). Step 8 copy running-config startup config Save your entries in the switch startup configuration file. Step 7 show vlan vlan-id Verify that the VLAN has been created. Step 6 end Return to privileged EXEC mode. you need to save the VTP transparent mode configuration and the extended-range VLAN configuration in the switch startup configuration file. Otherwise. disabling VTP. Step 6 show running-config interface interface-id Verify the VLAN membership mode of the interface. Step 4 mtu mtu-size (Optional) Modify the VLAN by changing the MTU size. it will default to VTP server mode.

Step 7 show interfaces interface-id switchport Display the switchport configuration of the interface in the Administrative Computer Networks 2 – Laboratories 6 . The default switchport mode for all Ethernet interfaces is dynamic auto. and enter interface configuration mode. The interface becomes a nontrunk interface regardless of whether or not the neighboring interface is a trunk interface. which is used if the interface stops trunking. You must manually configure the neighboring interface as a trunk interface to establish a trunk link. trunk: Set the interface in permanent trunking mode and negotiate to convert the link to a trunk link even if the neighboring interface is not a trunk interface. Step 5 switchport trunk native vlan vlan-id Specify the native VLAN for IEEE 802. You can use this command only when the interface switchport mode is access or trunk. desirable. dynamic desirable: Set the interface to a trunk link if the neighboring interface is set to trunk. switchport mode dynamic Makes the interface able to convert the link to a trunk link. ◦ Configuring VLAN Trunks Mode Function switchport mode access Puts the interface (access port) into permanent nontrunking mode and negotiates to convert the link into a nontrunk link. The interface becomes a trunk desirable interface if the neighboring interface is set to trunk. or auto mode. Step 6 end Return to privileged EXEC mode. dynamic auto: Set the interface to a trunk link if the neighboring interface is set to trunk or desirable mode. switchport mode trunk Puts the interface into permanent trunking mode and negotiates to convert the neighboring link into a trunk link. switchport mode dynamic Makes the interface actively attempt to convert the link to a trunk link.1Q trunks. desirable. or auto mode. This is the default. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology show interfaces[vlan vlan-id] Display characteristics for all interfaces or for the specified VLAN configured on the switch. Step 4 switchport access vlan vlan-id (Optional) Specify the default VLAN. The interface becomes a trunk interface even if the neighboring interface is not a trunk interface. Step 2 interface interface-id Specify the port to be configured for trunking. switchport nonegotiate Prevents the interface from generating DTP frames. Step 3 switchport mode {dynamic{auto | Configure the interface as a Layer 2 trunk (required only if the interface is a desirable} | trunk} Layer 2 access port or to specify the trunking mode). Configuring an Ethernet Interface as a Trunk Port Command Purpose Step 1 configure terminal Enter global configuration mode. The interface becomes a trunk interface if auto the neighboring interface is set to trunk or desirable mode. show vlan [id vlan-id] Display parameters for all VLANs or the specified VLAN on the switch.

Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Mode and the Administrative Trunking Encapsulation fields of the display. Step 2 interface interface-id Select the trunk port for which VLANs should be pruned. Step 5 Show interfaces interface-id switchport Verify your entries in the Pruning VLANs Enabled field of the display. Step 2 interfaceinterface-id Specify the port to be configured. follow these steps to remove VLANs from the pruning-eligible list on a trunk port: Command Purpose Step 1 configure terminal Enter global configuration mode. the lower one first. Step 7 copy running-config startup-config (Optional) Save your entries in the configuration file. Defining the Allowed VLANs on a Trunk Command Purpose Step 1 configure terminal Enter global configuration mode. and enter interface configuration mode. Do not enter any spaces between comma-separated VLAN parameters or in hyphen-specified ranges. Step 6 copy running-config startup-config (Optional) Save your entries in the configuration file. except|remove} vlan-list The vlan-list parameter is either a single VLAN number from 1 to 4094 or a range of VLANs described by two VLAN numbers. except | none | remove} vlan-list Separate nonconsecutive VLAN IDs with a comma and no spaces. Step 5 end Return to privileged EXEC mode.. Step 8 show interfaces interface-id trunk Display the trunk configuration of the interface. Step 3 switchport mode trunk Configure the interface as a VLAN trunk port. Step 4 end Return to privileged EXEC mode. Step 9 copy running-config startup-config (Optional) Save your entries in the configuration file.. Step 3 switchport trunk pruning vlan {add | Configure the list of VLANs allowed to be pruned from the trunk. Step 6 show interfaces interface-id switchport Verify your entries in the Trunking VLANs Enabled field of the display. Step 4 switchport trunk allowed vlan {add |all | (Optional) Configure the list of VLANs allowed on the trunk. VLANs that are pruning-ineligible receive flooded traffic. All VLANs are allowed by default. Beginning in privileged EXEC mode.vlan[. and enter interface configuration mode. The default list of VLANs allowed to be pruned contains VLANs 2 to 1001. Extended-range VLANs (VLAN IDs 1006 to 4094) cannot be pruned.vlan[. Computer Networks 2 – Laboratories 7 . use a [. separated by a hyphen. Valid IDs are 2 to 1001.]] hyphen to designate a range of IDs.

Step 2 interface interface-id Define the interface that is configured as the IEEE 802. The native VLAN is VLAN 1 by default. In the display. Step 5 show interfaces interface-id switchport Verify your entries in the Trunking Native Mode VLAN field. Step 6 show vlan Verify that the VLANs exist in the database on Switch A. Command Purpose Step 1 configure terminal Enter global configuration mode. Step 3 switchport trunk native vlan vlan-id Configure the VLAN that is sending and receiving untagged traffic on the trunk port. Configuring Trunk Ports for Load Sharing Command Purpose Step 1 configure terminal Enter global configuration mode on Switch A. Step 2 vtp domain domain-name Configure a VTP administrative domain. For vlan-id. and enter interface configuration mode. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Configuring the Native VLAN for Untagged Traffic A trunk port configured with IEEE 802. Step 6 copy running-config startup-config (Optional) Save your entries in the configuration file. check the VTP Operating Mode and the VTP Domain Name fields. Step 5 show vtp status Verify the VTP configuration on both Switch A and Switch B. Computer Networks 2 – Laboratories 8 . Step 3 vtp mode server Configure Switch A as the VTP server. Step 4 end Return to privileged EXEC mode.1Q trunk. the switch forwards untagged traffic in the native VLAN configured for the port. the range is 1 to 4094. By default. Step 4 end Return to privileged EXEC mode. The domain name can be 1 to 32 characters.1Q tagging can receive both tagged and untagged traffic.

Step 8 interface interface-id_1 Define the interface to be configured as a trunk. Step 19 interface interface-id_2 Define the interface to set the STP port priority. Step 9 switchport mode trunk Configure the port as a trunk port. and enter interface configuration mode. Spanning-tree VLAN port priority (configurable on a per-VLAN basis) 128. Spanning-tree port cost (configurable on a per-interface basis) 1000 Mb/s: 4. Verify that Switch B has learned the VLAN configuration. Spanning-tree mode PVST+. Step 22 show running-config Verify your entries. Spanning-tree port priority (configurable on a per-interface basis) 128. 10 Mb/s: 100. Step 23 copy running-config startup-config (Optional) Save your entries in the configuration file. ◦ Default Spanning-Tree Configuration Feature Default Setting Enable state Enabled on VLAN 1. and enter interface configuration mode. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Step 7 configure terminal Enter global configuration mode. 100 Mb/s: 19.) Switch priority 32768. Computer Networks 2 – Laboratories 9 . Step 18 exit Return to global configuration mode. Step 21 end Return to privileged EXEC mode. Step 20 spanning-tree vlan 3-6 port-priority 16 Assign the port priority of 16 for VLANs 3 through 6. Step 15 configure terminal Enter global configuration mode on Switch A. Step 16 interface interface-id_1 Define the interface to set the STP port priority. and enter interface configuration mode. Step 13 Repeat Steps 7 through 10 on Switch B to configure the trunk ports that connect to the trunk ports configured on Switch A. Step 12 Repeat Steps 7 through 10 on Switch A for a second port in the switch stack. Step 11 show interfaces interface-id_1switchport Verify the VLAN configuration. Step 17 spanning-tree vlan 8-10 port-priority 16 Assign the port priority of 16 for VLANs 8 through 10. VTP passes the VTP and VLAN information to Switch B. (Rapid PVST+ and MSTP are disabled. Step10 end Return to privileged EXEC mode. Step14 show vlan When the trunk links come up.

2. 10 Mb/s: 100. propagates it throughout the administrative domain. Forward-delay time: 15 seconds. Configure VLANs on Cisco router 1801 Command Purpose Step 1 vlan ? Enters VLAN configuration mode. 100 Mb/s: 19. Spanning-tree timers Hello time: 2 seconds. Maximum-aging time: 20 seconds. show spanning-tree interface interface-id Displays spanning-tree information for the specified interface.4094. Router(config-vlan)#exit Computer Networks 2 – Laboratories 10 . show spanning-tree detail Displays a detailed summary of interface information. and returns to global configuration Example: mode. Example: Router(config)#vlan 2 Router(config-vlan)# Step 3 exit Updates the VLAN database. Example: Router# config t Router(config)#vlan ? WORD ISL VLAN IDs 1-4094 accounting VLAN accounting configuration ifdescr VLAN subinterface ifDescr Step 2 ISL VLAN ID Adds VLANs. show spanning-tree summary [totals] Displays a summary of interface states or displays the total lines of the STP state section. Transmit hold count: 6 BPDUs ◦ Displaying the Spanning-Tree Status Command Purpose show spanning-tree active Displays spanning-tree information on active interfaces only. with identifiers ranging from 1. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Spanning-tree VLAN port cost (configurable on a per-VLAN basis) 1000 Mb/s: 4.

show vlan-switch: Entered from privileged EXEC mode. Computer Networks 2 – Laboratories 11 . Displays summary configuration information for all configured VLANs. Displays detailed configuration information for all configured VLANs. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology Router(config)# Verify Your VLAN Configuration show: Enteredfrom VLAN database mode.

Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology III. Lab practice 1. Network Layout Computer Networks 2 – Laboratories 12 .

0/24 Computer Networks 2 – Laboratories 13 .59. no password) on Switch and Switching Router.x1 – .51 to . subnet=10. Ex: group 5 will dispose hosts from .10.11. • Create 3 VLANs matching the LAN1 Layout configured on Switch 2960 and LAN2 Layout configured on Router: • Grouping BSD hosts into the VLAN id=11. Lab steps Note: To avoid the conflict of IP address from manual configuration once two group connecting together. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology 2. • Configure VTP domain netlab (mode server. where x is group number. each group will take the host address from range .x9. name=bsd. Verify your entries in the VTP Operating Mode and the VTP Domain Name fields of the display.

• Trunking Switch to Switch with the neighbor group by setting one more port as trunk port. • Trunking Switch to Router.0/24 • Grouping WINDOWS hosts into the VLAN id=13. • Configuring an Ethernet Interface as a Trunk Port on Switch and Switching Router. 3.10.13. • Monitor VTP by displaying VTP configuration information: the domain name. • Displaying the Spanning-Tree Status. name=linux. Computer Networks 2 – Laboratories 14 . Connect them together.0/24 • Assign Static-Access Ports to a VLAN. the current VTP revision. and the number of VLANs. • Change the IP configuration on PC to adapt the VLAN port assignment (admin privilege). name=windows. Result • Finish your work by reporting your network status and explaining your solution on place. Check the connectivity. Check the connectivity by pinging to the hosts in the same VLAN. subnet=10. subnet=10. freely decided.0. • Define the Allowed-VLANs on a Trunk. • Remove VLAN id=11 from the pruning-eligible list on a trunk port of Switch and Router. • Display and check the correctness of all VLAN Configuration. • Reset all devices to factory default.10. subnet=10.12.0/24. Faculty of Computer Science and Engineering – Ho Chi Minh City University of Technology • Grouping LINUX hosts into the VLAN id=12. • Configure another Trunk Ports for Load Sharing on Switch and Router. • Configure the Native VLAN id=13 for Untagged Traffic. • Configure Extended-Range VLAN id=1008.10. name=extended. Remove the BSD from the Allowed-VLANs list. Re-check the connectivity of two hosts of the same VLAN.