This will be the first of a number of articles demonstrating how to setup Vlans, Trunk Ports, and ROS (Router on a stick)
NAME | VLAN | INTERFACE ON SWITCH | IP ADDRESS WITH A /24 SUBNET |
S2 | VLAN1/VLAN2 | SVI VLANS 1 & 2 | 192.168.1.2 & 192.168.2.2 |
PC1 | VLAN1 | FastEthernet 0/11 | 192.168.1.11 |
PC2 | VLAN1 | FastEthernet 0/12 | 192.168.1.12 |
PC21 | VLAN2 | FastEthernet 0/14 | 192.168.2.21 |
PC22 | VLAN2 | FastEthernet 0/17 | 192.168.2.22 |
PCs already have their IP addresses set, we’re going to start with setting up SVIs on the switch and assigning them IP addresses.
Setting up VLAN 1:
interface vlan1
ip address 192.168.1.2 255.255.255.0
shut
no shut

After I’ve setup and configured the interface, I like to shut down and then start up the interface again to be sure the setting have updated correctly.
Setting up VLAN 2:
interface vlan2
ip address 192.168.2.2 255.255.255.0
shut
no shut

Confirmed that SVIs are setup correctly:
show ip interface brief

Assign ports fe0/14 and fe0/17 to VLAN2:
Now I’ll configure ports fe0/17 and fe0/17 to only tag and allow traffic for VLAN2.
interface fastEthernet 0/14
switchport mode access
switchport access vlan 2
interface fastEthernet 0/17
switchport mode access
switchport access vlan 2

Ping test between PC21 and PC22
ping 192.168.2.22

For confirmation, I’ll now put PC21 into the same subnet as VLAN1 (192.168.1.21/24) but keep the switchport FE0/14 in VLAN2 and I’ll try and ping PC1 (192.168.1.11/24). The ping test should time out (fail) as PC21 is still in a different VLAN to PC11.
ping 192.168.1.11
