VLANs (Part 2)

trunk ports are basically allow traffic to forward using a single interface like one cable

access ports are using a lot of cable to send traffic
default mode vlan all

switch 2 g0/0 interface

switch 2 g0/1 interface which is connected to router

router 1 interface g0/0

10
20
30

are vlans

lab exercise

sw1

int range f0/1,f0/2
switch mode access
switch access vlan 10
do show vlan brief
int range f0/3,f0/4
switch mode access
switch access vlan 30
do show vlan brief

sw2

int range 0/1
switch mode access
switch access vlan 20
do show vlan brief

int range f0/3,f0/2
switch mode access
switch access vlan 10
do show vlan brief

sw1

# You have to specify the interface first
int g0/1
switchport mode trunk
switchport trunk allowed vlan 10,30
do show interfaces trunk

then use native to call this trunk

like vlan 10,30 are in a native trunk

1001 is just a random number pick any number

switch trunk native vlan 1001

sw2

int g0/1
switchport mode trunk
switchport trunk allowed vlan 10,30
switch trunk native vlan 1001
do show vlan brief

This will show the interfaces that are active in a vlan trunk

do show interfaces trunk

We have to create the vlan 30 in switch 2

so that vlan 20 can receive traffic from vlan 30 through the trunk

vlan 30
exit

do show interfaces trunk

Then we are going to configure the g0/2 which is to router

int g0/2
switch mode trunk
switchport trunk allowed vlan 10,20,30
switchport trunk native vlan 1001
do show interface trunk

ROUTERRRRRR 1

int g0/0
no shut

vlan 10 from router

int g0/0.10
encapsulation dot1q 10
ip add 10.0.0.62 255.255.255.192

vlan 20 from router

int g0/0.20
encapsulation dot1q 20
ip add 10.0.0.126 255.255.255.192

vlan 30 from router

int g0/0.30
encapsulation dot1q 30
ip add 10.0.0.190 255.255.255.192

Now test the ping

Last updated