Setting up Vlans

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 SWITCHIP ADDRESS WITH A /24 SUBNET
S2VLAN1/VLAN2 SVI VLANS 1 & 2192.168.1.2 & 192.168.2.2
PC1VLAN1FastEthernet 0/11192.168.1.11
PC2VLAN1FastEthernet 0/12192.168.1.12
PC21VLAN2FastEthernet 0/14192.168.2.21
PC22VLAN2FastEthernet 0/17192.168.2.22
Diagram Info/IP address schema

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
SVI VLAN1 Completed.

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
SVI VLAN2 Completed.

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
Successful ping test to PC22 on 192.168.2.22/24

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