A switch is a network device used to segment a network into sub-networks, called subnets or LAN segments. It filters and forwards packets between LAN segments based on the MAC address. This exercise demonstrates how to configure a switch, set up VLANs (Virtual Local Area Networks), and verify network connectivity using Packet Tracer.
Open Packet Tracer and select a switch (PT-Switch) from the device list.
Commands:
switch> en
switch# conf t
switch(config)# hostname sh
sh(config)# exit
$
to exit.Command:
sh(config)# banner motd $
Commands:
sh# conf t
sh(config)# line con 0
sh(config-line)# password 123
sh(config-line)# login
sh(config-line)# exit
Command:
sh# copy run startup-config
After connecting computers with routers using copper straight-through cables, we can simulate network connectivity by transferring a simple PDU (Protocol Data Unit) from PC0 to PC1. The following procedure helps in configuring the router to handle the data flow between multiple devices.
enable
to enter privileged mode.config t
to access the configuration terminal.Configure the router’s interfaces and set IP addresses for both FastEthernet0/0 and FastEthernet0/1.
Commands:
Router> enable
Router# config t
Router(config)# interface FastEthernet0/0
Router(config-if)# ip address 192.168.10.1 255.255.255.0
Router(config-if)# no shutdown
Router(config)# interface FastEthernet0/1
Router(config-if)# ip address 192.168.20.1 255.255.255.0
Router(config-if)# no shutdown
Assign IP addresses to each PC in the network and set the default gateway.
192.168.10.2
, Gateway: 192.168.10.1
192.168.20.2
, Gateway: 192.168.20.1
Device Name | IP Address (FastEthernet0/0) | Subnet Mask | IP Address (FastEthernet0/1) | Subnet Mask |
---|---|---|---|---|
Router1 | 192.168.10.1 | 255.255.255.0 | 192.168.20.1 | 255.255.255.0 |
Device Name | IP Address | Subnet Mask | Gateway |
---|---|---|---|
PC0 | 192.168.10.2 | 255.255.255.0 | 192.168.10.1 |
PC1 | 192.168.20.2 | 255.255.255.0 | 192.168.20.1 |
A Virtual Local Area Network (VLAN) is a custom network created from one or more existing LANs, enabling a group of devices from multiple networks (wired or wireless) to be combined into a single logical network. VLANs can be managed like a physical network, and the equipment must support VLAN configurations.
192.168.10.1
.Add these VLANs in the VLAN Database.
Process:
192.168.10.1
to 192.168.10.3
under VLAN-STUDENT.192.168.10.4
to 192.168.10.6
under VLAN-FACULTY.192.168.10.1
to 192.168.10.3
.Select the host with IP 192.168.10.1
, go to Desktop → Command Prompt, and run the following command:
ping 192.168.10.3
This confirms that the VLAN is functioning properly, allowing communication within the VLAN groups.