Networking Protocols Lab - Week 8 - Faculty of Engineering Technology
Document Details
Uploaded by AdroitEinsteinium2135
BAU
Tags
Related
- Computer Networking: A Top-Down Approach PDF
- Computer Networking: A Top-Down Approach 8th Edition 2020 PDF
- Troubleshooting Common Network Issues PDF
- Networking Ports, Protocols, and Services PDF
- Computer Networking: A Top-Down Approach 6th Edition PDF
- Computer Networking: A Top-Down Approach (8th Edition) PDF
Summary
This document is a course plan for a networking protocols lab in a computer and networks engineering course. It outlines the course name, instructor, office details, and schedule. The document also introduces VLANs (Virtual Local Area Networks) and inter-VLAN routing, defining their key concepts and applications in a network environment.
Full Transcript
# Networking Protocols Lab. ## **First: Basic Information** **College:** Faculty of Engineering Technology **Department:** Computer and Networks Engineering **Course:** Networks Protocols Lab **Course Title:** Networks Protocols Lab **Course Code:** 30106432 **Credit Hours:** 1 **Prerequisite:**...
# Networking Protocols Lab. ## **First: Basic Information** **College:** Faculty of Engineering Technology **Department:** Computer and Networks Engineering **Course:** Networks Protocols Lab **Course Title:** Networks Protocols Lab **Course Code:** 30106432 **Credit Hours:** 1 **Prerequisite:** 30106431 ### **Instructor** **Instructor Name:** Dr. Belal Ayyoub **Office Number:** B17 F4 **Office Telephone (Ext):** 515 **Email:** [email protected]. **Office Hours:** **Class Times:** | Building | Day | Start Time | End Time | Room Number | |---|---|---|---|---| | 17 | Tue-Wed | 16 | 18 | 9 | | 17 | Sun-Tue-ThR | 10 | 11 | 9 | ## **Week 8** ### **Lab 7: VLANs and Inter-VLAN Routing** Network performance is an important factor in the productivity of an organization. One of the technologies used to improve network performance is the separation of large broadcast domains into smaller domains. By design, routers block broadcast traffic at an interface. However, routers normally have a limited number of LAN interfaces. A router's primary role is to move information between networks, not provide network access to end devices. The role of providing access into a LAN is normally reserved for an access layer switch. A virtual local area network (VLAN) can be created on a Layer 2 switch to reduce the size of broadcast domains, similar to a Layer 3 device. VLANs are commonly incorporated into network design making it easier for a network to support the goals of an organization. While VLANs are primarily used within switched local area networks, modern implementations of VLANs allow them to span MANs and WANs. Because VLANs segment the network, a Layer 3 process is required to allow traffic to move from one network segment to another. This Layer 3 routing process can either be implemented using a router or a Layer 3 switch interface. The use of a Layer 3 device provides a method for controlling the flow of traffic between network segments, including network segments created by VLANs. The first part of this chapter will cover how to configure, manage, and troubleshoot VLANs and VLAN trunks. The second part of this chapter focuses on implementing inter-VLAN routing using a router. InterVLAN routing on a Layer 3 switch is covered in a later course. ### **VLAN Definitions** - VLANs allow an administrator to segment networks based on factors such as function, project team, or application, without regard for the physical location of the user or device. - VLANs enable the implementation of access and security policies according to specific groupings of users. - A VLAN is a logical partition of a Layer 2 network. - Multiple partitions can be created, allowing for multiple VLANs to co-exist. - Each VLAN is a broadcast domain, usually with its own IP network. - VLANs are mutually isolated, and packets can only pass between them via a router. - The partitioning of the Layer 2 network takes place inside a Layer 2 device, usually via a switch. - The hosts grouped within a VLAN are unaware of the VLAN’s existence. ### **Types of VLANs** - **Data VLAN:** user-generated traffic. - **Default VLAN:** all switch ports become part of this VLAN until switch is configured, show vlan brief. - **Native VLAN:** used for untagged traffic. - **Management VLAN:** used to access management capabilities. ### **VLAN 1** - **Switch show vlan brief** | VLAN Name | Status | Ports | |---|---|---| | 1 | default | active | Fa0/1, Fa0/2, Fa0/3, Fa0/4<br>Fa0/5, Fa0/6, Fa0/7, Fa0/8<br>Fa0/9, Fa0/10, Fa0/11, Fa0/12<br>Fa0/13, Fa0/14, Fa0/15, Fa0/16<br>Fa0/17, Fa0/18, Fa0/19, Fa0/20<br>Fa0/21, Fa0/22, Fa0/23, Fa0/24<br>Gi0/1, Gi0/2 | | 1002 | fddi-default | act/unsup | | | 1003 | token-ring-default | act/unsup | | | 1004 | fddinet-default | act/unsup | | | 1005 | trnet-default | act/unsup | | - All ports assigned to VLAN 1 by default. - Native VLAN is VLAN 1 by default. - Management VLAN is VLAN 1 by default. - **Switch port configured to support voice traffic:** * The port sends CDP frames to provide information used by the IP phone. * The port forwards frames associated with VLAN 150. - **Switch configured to support voice traffic:** * Uses VLAN 150 for voice VLAN * Prioritizes voice traffic ### **VLAN Trunk** - A VLAN trunk is a point-to-point link that carries more than one VLAN. - A VLAN trunk is usually established between switches so same-VLAN devices can communicate, even if physically connected to different switches. - A VLAN trunk is not associated to any VLANs; neither is the trunk ports used to establish the trunk link. - Cisco IOS supports IEEE802.1q, a popular VLAN trunk protocol. ### **Controlling Broadcast Domains with VLANs** - VLANs can be used to limit the reach of broadcast frames. - A VLAN is a broadcast domain of its own. - A broadcast frame sent by a device in a specific VLAN is forwarded within that VLAN only. - VLANs help control the reach of broadcast frames and their impact in the network. - Unicast and multicast frames are forwarded within the originating VLAN. ### **Tagging Ethernet Frames for VLAN Identification** - Frame tagging is the process of adding a VLAN identification header to the frame. - It is used to properly transmit multiple VLAN frames through a trunk link. - Switches tag frames to identify the VLAN to which they belong. - Different tagging protocols exist; IEEE 802.1Q is a very popular example. - The protocol defines the structure of the tagging header added to the frame. - Switches add VLAN tags to the frames before placing them into trunk links and remove the tags before forwarding frames through non-trunk ports. - When properly tagged, the frames can transverse any number of switches via trunk links and still be forwarded within the correct VLAN at the destination. ### **VLANs in a Multi-Switched Environment Native VLANs and 802.1Q Tagging** - Control traffic sent on the native VLAN should not be tagged. - Frames received untagged, remain untagged and are placed in the native VLAN when forwarded. - If there are no ports associated to the native VLAN and no other trunk links, an untagged frame is dropped. - When configuring a switch port on a Cisco switch, configure devices so that they do not send tagged frames on the native VLAN. - In Cisco switches, the native VLAN is VLAN 1, by default. ## **VLAN Ranges on Catalyst Switches** - Cisco Catalyst 2960 and 3560 Series switches support over 4,000 VLANs. - VLANs are split into two categories: - **Normal Range VLANs** * VLAN numbers from 1 to 1,005 * Configurations stored in the vlan.dat (in the flash memory) * IDs 1002 through 1005 are reserved for Token Ring and Fiber VLANs, automatically created and cannot be removed. - **Extended Range VLANs:** * VLAN numbers from 1,006 to 4,096 * Configurations stored in the running configuration (NVRAM) * VLAN Trunking Protocol (VTP) does not learn extended VLANs. ### **Creating a VLAN** **Cisco Switch IOS Commands** 1. Enter global configuration mode. 2. Create a VLAN with a valid id number 3. Specify a unique name to identify a VLAN. 4. Return to the privileged EXEC mode. **Create a VLAN** 1. S1# configure terminal 2. S1(config)# vlan vlan-id 3. S1(config-vlan)# name vlan-name 4. S1(config-vlan)# end ### **Assigning Ports to VLANs** **Cisco Switch IOS Commands** 1. Enter global configuration mode. 2. Enter interface configuration mode. 3. Set the port to access mode. 4. Assign the port to a VLAN. 5. Return to the privileged EXEC mode. **Assign Ports to VLANs** 1. S1# configure terminal 2. S1(config)# interface interface\_id 3. S1(config-if)# switchport mode access 4. S1(config-if)# switchport access vlan vlan\_id 5. S1(config-if)# end ### **Deleting VLANs** In the figure, the no vlan vlan-id global configuration mode command is used to remove VLAN 20 from the switch. Switch S1 had a minimal configuration with all ports in VLAN 1 and an unused VLAN 20 in the VLAN database. The show vlan brief command verifies that VLAN 20 is no longer present in the vlan.dat file after using the no vlan 20 command. **Caution:** Before deleting a VLAN, reassign all member ports to a different VLAN first. Any ports that are not moved to an active VLAN are unable to communicate with other hosts after the VLAN is deleted and until they are assigned to an active VLAN. Alternatively, the entire vlan.dat file can be be deleted using the delete flash:vlan.dat privileged EXEC mode command. The abbreviated command version (delete vlan.dat) can be used if the vlan.dat file has not been moved from its default location. After issuing this command and reloading the switch, the previously configured VLANs are no longer present. This effectively places the switch into its factory default condition with regard to VLAN configurations. **Note:** For a Catalyst switch, the erase startup-config command must accompany the delete vlan.dat command prior to reload to restore the switch to its factory default condition. ### **VLAN Show Commands** **Cisco IOS CLI Command Syntax** - show vlan (brief | id vlan-id | name vlan-name | summary) - **brief** - Display one line for each VLAN with the VLAN name, status, and its ports. - **id vlan-id** - Display information about a single VLAN identified by VLAN ID number. For vlan-id, the range is 1 to 4094. - **name vlan-name** - Display information about a single VLAN identified by VLAN name. The VLAN name is an ASCII string from 1 to 32 characters. - **summary -** Display VLAN summary information. **Cisco IOS CLI Command Syntax** - show interfaces (interface-id | vlan vlan-id) | switchport **Valid Interfaces Include:** * Physical ports (including type, module and port number) and port channels. * Port-channel range is 1 to 6. * **vlan vlan-id** - VLAN identification. The range is 1 to 4094. * **switchport** - Display the administrative and operational status of a switching port, including port blocking and port protection settings. ### **Packet Tracer – Configuring VLANs** - **Topology** | | | | | | |---|---|---|---|---| | PC1 172.17.10.21 VLAN 10 | G0/1 | S1 | G0/2 | PC4 172.17.10.24 VLAN 10 | | | F0/11 | | F0/11 | | | PC2 172.17.20.22 VLAN20 | F0/18 | S2 | F0/18 | PC5 172.17.20.25 VLAN 20| | | | | F0/6 | PC6 172.17.30.26 VLAN 30 | | PC3 172.17.30.23 VLAN 30 | | | | | | | | | | | - **Addressing Table** | Device | Interface | IP Address | Subnet Mask | VLAN | |---|---|---|---|---| | PC1 | NIC | 172.17.10.21 | 255.255.255.0 | 10 | | PC2 | NIC | 172.17.20.22 | 255.255.255.0 | 20 | | PC3 | NIC | 172.17.30.23 | 255.255.255.0 | 30 | | PC4 | NIC | 172.17.10.24 | 255.255.255.0 | 10 | | PC5 | NIC | 172.17.20.25 | 255.255.255.0 | 20 | | PC6 | NIC | 172.17.30.26 | 255.255.255.0 | 30 | **Objectives** - **Part 1: Verify the Default VLAN Configuration** - **Part 2: Configure VLANs Part 3: Assign VLANs to Ports** **Part 1: Verify VLANs** 1. **Display the current VLANs.** - On S1, issue the command that will display all VLANs configured. There should be ten VLANS in total. - Notice how all 24 access ports on the switch are assigned to VLAN 1. 2. **Verify loss of connectivity between PCs on the same network.** - Although PC1 and PC4 are on the same network, they cannot ping one another. This is because the ports connecting the switches are assigned to VLAN 1 by default. In order to provide connectivity between the PCs on the same network and VLAN, trunks must be configured. **Part 2: Configure Trunks** 1. **Configure trunking on S1 and use VLAN 99 as the native VLAN.** - Configure G0/1 and G0/2 interfaces on S1 for trunking. - Configure VLAN 99 as the native VLAN for G0/1 and G0/2 interfaces on S1. 2. **Verify trunking is enabled on S2 and S3.** - On S2 and S3, issue the show interface trunk command to confirm that DTP has successfully negotiated trunking with S1 on S2 and S3. The output also displays information about the trunk interfaces on S2 and S3. 3. **Correct the native VLAN mismatch on S2 and S3.** - Configure VLAN 99 as the native VLAN for the appropriate interfaces on S2 and S3. - Issue show interface trunk command to verify the correct native VLAN configuration. 4. **Verify configurations on S2 and S3.** - Issue the show interface interface switchport command to verify that the native VLAN is now 99. - Use the show vlan command to display information regarding configured VLANs. Why is port G0/1 on S2 no longer assigned to VLAN 1? ### **IP Addressing Issues with VLAN** Each VLAN must correspond to a unique IP subnet. If two devices in the same VLAN have different subnet addresses, they cannot communicate. This is a common problem, and it is easy to solve by identifying the incorrect configuration and changing the subnet address to the correct one. In Figure 1, PC1 cannot connect to the Web/TFTP server shown. - **Troubleshoot VLANs and Trunks Common Problems with Trunks** Trunking issues are usually associated with incorrect configurations. **The most common type of trunk configuration errors are:** - Native VLAN mismatches - Trunk mode mismatches - Allowed VLANs on Trunks **Allowed VLANs on Trunks** If a trunk problem is detected, the best practice guidelines recommend to troubleshoot in the order shown above. | Problem | Result | Example| |---|---|---| | Native VLAN Mismatches | Poses a security risk and creates unintended results. | For example, one port is defined as VLAN 99 and the other is defined as VLAN 100. | | Trunk Mode Mismatches | Causes loss of network connectivity. | For example, both local and peer switchport modes are configured as dynamic auto. | | Allowed VLANs on Trunks| Causes unexpected traffic or no traffic to be sent over the trunk.| The list of allowed VLANs does not support current VLAN trunking requirements. | ### **What is Inter-VLAN Routing?** VLANs are used to segment switched networks. Layer 2 switches, such as the Catalyst 2960 Series, can be configured with over 4,000 VLANs. A VLAN is a broadcast, domain, so computers on separate VLANs are unable to communicate without the intervention of a routing device. Layer 2 switches have very limited IPv4 and IPv6 functionality and cannot perform the dynamic routing function of routers. While Layer 2 switches are gaining more IP functionality, such as the ability to perform static routing, this is insufficient to handle these large number of VLANs. Any device that supports Layer 3 routing, such as a router or a multilayer switch, can be used to perform the necessary routing functionality. Regardless of the device used, the process of forwarding network traffic from one VLAN to another VLAN using routing is known as inter-VLAN routing. **There are three options for inter-VLAN routing:** - Legacy inter-VLAN routing - Router-on-a-Stick - Layer 3 switching using SVIs ### **Legacy Inter-VLAN Routing** Router-based inter-VLAN routing is a process for forwarding network traffic from one VLAN to another VLAN using a router. **In the past:** - Actual routers were used to route between VLANs. - Each VLAN was connected to a different physical router interface. - Packets would arrive on the router through one interface, be routed and leave through another. - Because the router interfaces were connected to VLANs and had IP addresses from that specific VLAN, routing between VLANs was achieved. - Large networks with large number of VLANs required many router interfaces ### **Router-on-a-Stick Inter-VLAN Routing** - The router-on-a-stick approach uses only one of the router's physical interface. - One of the router's physical interfaces is configured as a 802.1Q trunk port so it can understand VLAN tags. - Logical subinterfaces are created; one subinterface per VLAN. - Each subinterface is configured with an IP address from the VLAN it represents. - VLAN members (hosts) are configured to use the subinterface address as a default gateway. **Router interface configured to operate as a trunk link and is connected to a trunked switch port. The router performs inter-VLAN routing by accepting VLAN-tagged traffic onthe trunk interface coming from the adjacent switch, and then, internally routing between the VLANs using subinterfaces. The router then forwards the routed traffic, VLAN-tagged for the destination VLAN, out the same physical interface as it used to receive the traffic.** ### **Configure Legacy Inter-VLAN Routing: Switch Configuration** - Legacy inter-VLAN routing requires routers to have multiple physical interfaces. - Each one of the router's physical interfaces is connected to a unique VLAN. - Each interface is also configured with an IP address for the subnet associated with the particular VLAN. - Network devices use the router as a gateway to access the devices connected to the other VLANs. ### **Configure Router-on-a-Stick: Switch Configuration** To enable inter-VLAN routing using router-on-a stick, start by enabling trunking on the switch port that is connected to the router. **In the figure, router R1 is connected to switch S1 on trunk port F0/5. VLANs 10 and 30 are added to switch S1.** Because switch port F0/5 is configured as a trunk port, the port does not need to be assigned to any VLAN. To configure switch port F0/5 as a trunk port, execute the switchport mode trunk command in interface configuration mode for port F0/5. **The router can now be configured to perform inter-VLAN routing.** ### **Packet Tracer – Configuring Router-on-a-Stick InterVLAN Routing** - **Topology** | | | | | | |---|---|---|---|---| | G0/0 R1 | G0/1 | F0/11 S1 | F0/6| PC3 VLAN 30 172.17.30.0/24 | | | F0/11 | | | | | F0/5 | F0/1 | S2 | F0/18 | PC1 VLAN 10 172.17.10.0/24 | | | | | | | - **Addressing Table** | Device | Interface | IPv4 Address | Subnet Mask | Default Gateway | |---|---|---|---|---| | R1 | G0/0.10 | 172.17.10.1 | 255.255.255.0 | N/A | | R1| G0/0.30 | 172.17.30.1 | 255.255.255.0 | N/A | | PC1 | NIC | 172.17.10.10 | 255.255.255.0 | 172.17.10.1 | | PC2 | NIC | 172.17.30.10 | 255.255.255.0 | 172.17.30.1 | **Objectives** - **Part 1: Test Connectivity without Inter-VLAN Routing ** - **Part 2: Add VLANs to a Switch** - **Part 3: Configure Subinterfaces** - **Part 4: Test Connectivity with Inter-VLAN Routing** **Scenario** In this activity, you will check for connectivity prior to implementing inter-VLAN routing. You will then configure VLANs and inter-VLAN routing. Finally, you will enable trunking and verify connectivity between VLANs. **Part 1: Test Connectivity Without Inter-VLAN Routing** 1. **Ping between PC1 and PC3.** - Wait for switch convergence or click Fast Forward Time a few times. When the link lights are green for PC1 and PC3, ping between PC1 and PC3. Because the two PCs are on separate networks and R1 is not configured, the ping fails. 2. **Switch to Simulation mode to monitor pings.** - Switch to Simulation mode by clicking the Simulation tab or pressing Shift+S. - Click Capture/Forward to see the steps the ping takes between PC1 and PC3. Notice how the ping never leaves PC1. What process failed and why? **Part 2: Add VLANs to a Switch** 1. **Create VLANs on S1.** - Return to Realtime mode and create VLAN 10 and VLAN 30 on S1. 2. **Assign VLANs to ports.** - Configure interface F0/6 and F0/11 as access ports and assign VLANs. - Assign PC1 to VLAN 10. - Assign PC3 to VLAN 30. - Issue the show vlan brief command to verify VLAN configuration. 3. **Test connectivity between PC1 and PC3.** - From PC1, ping PC3. The pings should still fail. Why were the pings unsuccessful? **Part 3: Configure Subinterfaces** 1. **Configure subinterfaces on R1 using the 802.1Q encapsulation.** - Create the subinterface G0/0.10. - Set the encapsulation type to 802.1Q and assign VLAN 10 to the subinterface. - Refer to the Address Table and assign the correct IP address to the subinterface. - Repeat for the G0/0.30 subinterface. 2. **Verify Configuration.** - Use the show ip interface brief command to verify subinterface configuration. Both subinterfaces are down. Subinterfaces are virtual interfaces that are associated with a physical interface. Therefore, in order to enable subinterfaces, you must enable the physical interface that they are associated with. - Enable the G0/0 interface. Verify that the subinterfaces are now active. **Part 4: Test Connectivity with Inter-VLAN Routing** 1. **Ping between PC1 and PC3.** - From PC1, ping PC3. The pings should still fail. 2. **Enable trunking.** - On S1, issue the show vlan command. What VLAN is G0/1 assigned to? - Because the router was configured with multiple subinterfaces assigned to different VLANs, the switch port connecting to the router must be configured as a trunk. Enable trunking on interface G0/1. - How can you determine that the interface is a trunk port using the show vlan command? - Issue the show interface trunk command to verify the interface is configured as a trunk. 3. **Switch to Simulation mode to monitor pings.** - Switch to Simulation mode by clicking the Simulation tab or pressing Shift+S. - Click Capture/Forward to see the steps the ping takes between PC1 and PC3. - You should see ARP requests and replies between S1 and R1. Then ARP requests and replies between R1 and S3. Then PC1 can encapsulate an ICMP echo request with the proper data-link layer information and R1 will route the request to PC3. - Note: After the ARP process finishes, you may need to click Reset Simulation to see the ICMP process complete.