Lab: Switch and PC Configuration

 Cisco Switch Configuration, PC IP Address Configuration, Packet Tracer Lab, Basic Network Configuration, Cisco IOS Commands

Learning how to configure network switches and end devices is an essential step in understanding computer networking. Cisco Packet Tracer provides a practical environment where beginners can build network topologies, configure IP addresses, and test connectivity between devices.

In this tutorial, you will learn how to configure two Cisco switches and two PCs, assign IP addresses, and verify network connectivity using basic Cisco IOS commands.

1. Network Topology

This lab consists of four devices:

  • S1: The first network switch.
  • S2: The second network switch.
  • PC-A: The first end device.
  • PC-B: The second end device.

The switches are connected to each other, and each PC connects to one switch.

Image 1: Network topology showing S1, S2, PC-A, PC-B, and all connected ports.

Network Connections

DeviceInterfaceConnected DeviceInterface
S1Fa0/1S2Fa0/1
S1Fa0/5PC-ANIC
S2Fa0/1S1Fa0/1
S2Fa0/10PC-BNIC

2. IP Addressing Table

Each device uses an IP address within the same IPv4 network.

DeviceInterfaceIP AddressSubnet Mask
S1VLAN 1192.168.1.1255.255.255.0
S2VLAN 1192.168.1.2255.255.255.0
PC-ANIC192.168.1.10255.255.255.0
PC-BNIC192.168.1.11255.255.255.0

The network address is 192.168.1.0/24. Since all devices belong to the same IP subnet, a router is not required for communication within this lab.

3. Configure Switch S1

The first step is to configure the hostname, management IP address, and connected interfaces on S1.

Step 1: Enter Global Configuration Mode

Open the CLI tab on S1 and enter:

enable
configure terminal
hostname S1

Step 2: Configure the Management IP Address

interface vlan 1
 ip address 192.168.1.1 255.255.255.0
 no shutdown
exit

Step 3: Configure the Switch-to-Switch Port

interface fastethernet 0/1
 switchport mode access
 no shutdown
exit

Step 4: Configure the PC-A Port

interface fastethernet 0/5
 switchport mode access
 no shutdown
exit

Step 5: Save the Configuration

end
copy running-config startup-config

4. Configure Switch S2

Next, configure S2 with its own hostname and management IP address.

Step 1: Enter Configuration Mode

enable
configure terminal
hostname S2

Step 2: Configure the Management IP Address

interface vlan 1
 ip address 192.168.1.2 255.255.255.0
 no shutdown
exit

Step 3: Configure the Switch-to-Switch Port

interface fastethernet 0/1
 switchport mode access
 no shutdown
exit

Step 4: Configure the PC-B Port

interface fastethernet 0/10
 switchport mode access
 no shutdown
exit

Step 5: Save the Configuration

end
copy running-config startup-config

Image 2: Cisco switch CLI configuration showing the commands for S1 and S2, including VLAN 1 management IP addresses and connected interfaces.

5. Configure End Devices PC-A and PC-B

After configuring the switches, assign static IPv4 addresses to both PCs.

Configure PC-A

  1. Click PC-A in Cisco Packet Tracer.
  2. Open the Desktop tab.
  3. Select IP Configuration.
  4. Choose Static.
  5. Enter the following values:

SettingValue
IP Address192.168.1.10
Subnet Mask255.255.255.0
Default GatewayLeave blank
DNS ServerLeave blank

Configure PC-B

Repeat the same steps on PC-B and enter:

SettingValue
IP Address192.168.1.11
Subnet Mask255.255.255.0
Default GatewayLeave blank
DNS ServerLeave blank

Image 3: Cisco Packet Tracer PC IP Configuration window showing the static IP address and subnet mask settings for PC-A and PC-B.

Important: Each device must have a unique IP address. Do not assign the same IP address to more than one device.

6. Verify the Switch Configuration

After completing the configuration, verify that the interfaces and management IP addresses are correct.

Check Interface IP Addresses

show ip interface brief

Check Port Status

show interfaces status

Check VLAN Membership

show vlan brief

Confirm that the ports used in this lab belong to VLAN 1 and that the relevant interfaces are operational.

7. Test Network Connectivity

The final step is to verify communication between the devices.

Test PC-A to PC-B

On PC-A, open Desktop → Command Prompt and run:

ping 192.168.1.11

Test Connectivity to the Switches

From PC-A, run:

ping 192.168.1.1
ping 192.168.1.2

If the pings fail, check the cable connections, IP addresses, subnet masks, switch port status, and VLAN membership. The first ping may occasionally time out while devices learn their Layer 2 addresses; repeat the test before troubleshooting further.

8. Common Problems and Troubleshooting

Problem 1: PC-A Cannot Reach PC-B

Possible causes:

  • Incorrect IP address or subnet mask.
  • Incorrect cable connections.
  • A switch interface is down.
  • The PCs are connected to ports assigned to different VLANs.

Solution: Verify the IP configuration on both PCs and use show interfaces status and show vlan brief on the switches.

Problem 2: Cannot Ping the Switch Management IP

Possible causes:

  • VLAN 1 is down.
  • The management IP address is incorrect.
  • No active port belongs to VLAN 1.

Solution: Run show ip interface brief and confirm that VLAN 1 is operational.

Problem 3: The Configuration Is Lost After Restarting

Cause: The running configuration was not saved to startup configuration.

Solution: Run:

copy running-config startup-config

Conclusion

This Cisco Packet Tracer lab demonstrates the basic steps required to configure two switches and two end devices. You learned how to set switch hostnames, configure management IP addresses, enable interfaces, assign static IP addresses to PCs, and test connectivity using the ping command.

These skills provide a foundation for more advanced networking topics, including VLAN configuration, trunk links, inter-VLAN routing, network troubleshooting, and network security.


إرسال تعليق

0 تعليقات