Configure Router to handle traffic from VLANs.

This how to is a continuation of  the previous howto . You can download the PacketTracer file from here.

In this how to a router will be configured to handle traffic from all VLANs. The router will handle traffic from all networks created by the VLANs. Each host on each VLAN will be then be able to ping the router’s IP address. The router’s IP address for hosts on different VLANs will belong to the network the VLAN operates in. In other words a host in the VLAN 50 will have as default gateway and so forth with the rest of the hosts on the different VLANs.



Create Trunk between Switch 1 and Router 1. Run the following commands on Switch 1

interface fastEthernet 0/2
switchport mode trunk
switchport trunk allowed vlan 1-99,150

Configure the router.

For VLAN 50

interface fastEthernet 0/0.50
encapsulation dot1Q 50
ip address

For VLAN 60

interface fastEthernet 0/0.60
encapsulation dot1Q 60
ip address

For VLAN 99

interface fastEthernet 0/0.99
encapsulation dot1Q 99
ip address

For VLAN 150

interface fastEthernet 0/0.150
encapsulation dot1Q 150
ip address
Share Button

Create VLANS – Trunking, Two Switch Configuration, Change native VLAN

In this how to, two switches are configured to communicate with VLANs. For not ignore the router. Each Switch is configured with the same VLANs, otherwise they will not know how to exist.. In addition, we are going to create a Trunk for both switches to communicate all VLANs between them. Download the PacketTracer file


Configure both switches to have the same VLANs. The process and VLAN creation will be exactly the same as with the  the commands found on the previous how to. However, on this switch we will add an additional VLAN for VoIP.  Below are the commands.

Create the VLANs, 50(students), 60(teachers), 99(mgt), 150(voice)

configure terminal
vlan 50
name students
vlan 60
name teachers
vlan 99
name mgt
vlan 150
name voice

Assign ports to each VLAN
For VLAN students (ports 5 to 20 on interface 0)

interface range fastEthernet 0/5-15
switchport mode access
switchport access vlan 50

For VLAN teachers (ports 21 to 23 on interface 0)

interface range fastEthernet 0/21-23
switchport mode access
switchport access vlan 60

For VLAN mgt (ports 24 on interface 0) and also assign IP address in order to communicate with the switch

interface fastEthernet 0/24
switchport mode access
switchport access vlan 99
interface vlan 99
ip address
no shutdown

For VLAN voice (ports 24 on interface 0)

interface range fastEthernet 0/16-20
switchport mode access
switchport access vlan 150

Create the Trunk.

On a switch ports 1 to 4 belong to VLAN1, which is a factory default. We take port 1 on both switches in order to create the Trunk as mentioned above. Here are the commands to create the trunk; execute these on both switches.  Below the listed VLANs will be handled by the trank. We include the 150 VLAN as well in the last command.

interface fastEthernet 0/1
switchport mode trunk
switchport trunk allowerd vlan 1-99,150

Change native VLAN

The default setting for native VLAN is VLAN 1. However we can change this to be on a different VLAN. We can do this by simply issuing the following command. This will have to be executed on both connected switches.

vlan 80
name native
interface fastEthernet 0/1
switchport trunk native vlan 80
Share Button