Scenario
You will create a VLAN on SW1. This is common in enterprises where different types of traffic are separated for security and efficiency. In our case we are just creating a single Data VLAN 20.
Pre-requisite
● Power On, devices LnxPC1, WindowsPC1, SW1, and R1
Tasks & Detailed Steps
1. Access SW1 and assign hostname:
Connect via console, then enter privileged mode:
Switch> enable
Switch# configure terminal
Switch(config)# hostname SW1
SW1(config)#
|
2. Create VLAN:
For Data (VLAN 20):
SW1(config)# vlan 20
SW1(config-vlan)# name Data
SW1(config-vlan)# exit
|

3. Assign Ports:
Set Ports Gi0/0, Gi0/1 and Gi0/2 as Access (for user devices on VLAN 20):
SW1(config)# interface GigabitEthernet 0/0
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 20
SW1(config-if)# exit
SW1(config)# interface GigabitEthernet 0/1
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 20
SW1(config-if)# exit
SW1(config)# interface GigabitEthernet 0/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 20
SW1(config-if)# exit
SW1(config)# exit
SW1# write memory
|

4. Verification:
Run:
Expected Output:
Interfaces Gi0/0, Gi0/1 and Gi0/2 assigned to VLAN 20 |

Again verify the PING connectivity from the gateway router R1 to both the WindowsPC1 and the LnxPC1
On R1:
