Lab 002 Configuring and Verifying IPv4 Addressing on Switches with VLANs
Watch Full Demo on YouTube:
Lab Objective:
The objective of this lab is to configure and verify IPv4 addressing on switches with VLANs, ensuring connectivity between computers within the same VLAN across multiple switches. By building this lab network you will be able to learn the basic commands needed to configure a switch with the default VLAN.
Lab Topology:
Equipment Required:
- 2x Cisco Switches (2960)
- 2x PCs with ethernet interface
- Console Cable
- Ethernet Cable
- Computer with Terminal emulation software e.g. PuTTY
IPv4 Address Table:
Device Name | Interface ID | IPv4 Address | Subnet Mask |
Switch 1 | VLAN 10 | 192.168.0.100 | 255.255.255.0 |
Switch 2 | VLAN 10 | 192.168.0.200 | 255.255.255.0 |
Host 1 | Fa0 | 192.168.0.1 | 255.255.255.0 |
Host 2 | Fa0 | 192.168.0.2 | 255.255.255.0 |
List of Command Summary:
Command | Command Description |
enable | enters privileged EXEC mode |
configure terminal | enters global configuration mode from privileged EXEC mode |
hostname [hostname] | Assign a device name to router |
interface [type number] | Change from global configuration mode to interface configuration mode |
ip address [ipv4-address] [subnetmask] | assign an IPv4 address to an interface |
no shutdown | enables an interface |
interface range [type number]-[type number] | This is used to enter interface configuration mode for a range of Ethernet interfaces |
switch mode access | set the operational mode of an interface to access mode |
switch access vlan [vlan-ID] | assigns a specific VLAN to an access port |
ping [ipv4-address] | Sends an ICMP (Internet Control Message Protocol) echo request to the specified address |
show running-config | save the running configuration to the startup-configuration file |
show ip interface brief | display a summary of all IPv4 addresses configured on the Router’s interfaces |
show vlan brief | displays a brief summary of the VLAN configuration on the switch including the VLAN ID, VLAN name, and port membership |
end | exit configuration mode |
exit | exits one level in the menu structure command |
Lab Task:
- Connect the switches and computers as per the topology diagram.
- Configure the appropriate hostname on each device as per topology.
- Configure VLANs on both switches:
- Create VLAN 10 on Switch 1 and Switch 2.
- Assign VLAN names (e.g., VLAN10).
- Configure VLAN interfaces with IP addresses as per IPv4 address table above.
- Configure switch ports:
- Assign ports on Switch 1 to VLAN 10.
- Assign ports on Switch 2 to VLAN 10.
- Verify that each switchport is in the appropriate VLAN
- Configure IP addresses on Host1&2:
- Configure Host 1 with IP address 192.168.0.1/24 and default gateway 192.168.0.100.
- Configure Host 2 with IP address 192.168.0.2/24 and default gateway 192.168.0.200.
- Verify connectivity:
- Test connectivity between PC 1 and PC 2 using the ping command.
- Ensure successful ping replies between the two computers.
- Save Configuration
Configuration Steps:
- Connect Switches and Computers:
- Connect Switch 1 and Switch 2 using an Ethernet cable.
- Connect each computer to Switch 1 and Switch 2 using Ethernet cables.
- Change the name of both switches according to the topology:
- On Switch 1:
- switch> enable
- switch# configure terminal
- switch(config)# hostname Switch1
- On Switch 2:
- switch> enable
- switch# configure terminal
- switch(config)# hostname Switch2
- On Switch 1:
- Configure VLANs:
- On Switch 1, create VLAN 10 and assign an IP address to the VLAN interface:
- Switch1(config)# vlan 10
- Switch1(config-vlan)# name VLAN10
- Switch1(config-vlan)# exit
- Switch1(config)# interface vlan 10
- Switch1(config-if)# ip address 192.168.0.100 255.255.255.0
- Switch1(config-if)# no shutdown
- Repeat the same configuration on Switch 2:
- Switch2(config)# vlan 10
- Switch2(config-vlan)# name VLAN10
- Switch2(config-vlan)# exit
- Switch2(config)# interface vlan 10
- Switch2(config-if)# ip address 192.168.0.200 255.255.255.0
- Switch2(config-if)# no shutdown
- On Switch 1, create VLAN 10 and assign an IP address to the VLAN interface:
- Configure Switch Ports:
- Assign ports on Switch 1 to VLAN 10:
- Switch1(config)# interface range FastEthernet0/23-24
- Switch1(config-if-range)# switchport mode access
- Switch1(config-if-range)# switchport access vlan 10
- Switch1(config-if-range)# exit
- Switch1(config)# interface FastEthernet0/1
- Switch1(config-if-range)# switchport mode access
- Switch1(config-if-range)# switchport access vlan 10
- Repeat the same configuration on Switch 2:
- Switch2(config)# interface range FastEthernet0/23-24
- Switch2(config-if-range)# switchport mode access
- Switch2(config-if-range)# switchport access vlan 10
- Switch2(config-if-range)# exit
- Switch2(config)# interface FastEthernet0/1
- Switch2(config-if-range)# switchport mode access
- Switch2(config-if-range)# switchport access vlan 10
- Assign ports on Switch 1 to VLAN 10:
- Verify VLAN Interface assignment:
- Issue this command to verify the VLAN assignment:
- show vlan brief
- Issue this command to verify the VLAN assignment:
- Configure IP Addresses on Computers:
- Configure Host 1 with IP address 192.168.0.1/24 and default gateway 192.168.0.100.
- Configure Host 2 with IP address 192.168.0.2/24 and default gateway 192.168.0.200.
- Verify Connectivity:
- Verify connectivity between PC 1 and PC 2 using the ping command:
- PC1> ping 192.168.0.2
- PC2> ping 192.168.0.1
- Verify connectivity between PC 1 and PC 2 using the ping command:
Don’t forget to save the running configuration on the device.
Conclusion:
In this lab, you have successfully configured and verified IPv4 addressing on switches with VLANs. By assigning ports to VLANs and configuring IP addresses on VLAN interfaces, you have established communication between computers within the same VLAN across multiple switches.
Packet Tracer Lab (Pre/Post configuration):
Download the file below and open the word document to access the Packet Tracer labs.