This lab is to learn the Role of VLAN trunk and analysis the packet change along the transferring of the route. Then I will add a router for the inter-VLAN routing

The topology is like this.

PT_Vlan_trunk_top

The IP scheme

Hosts IP address VLAN
PC0 192.168.10.2 10
PC1 192.168.20.2 20
PC2 192.168.30.2 30
PC3 192.168.10.3 10
PC4 192.168.20.3 20
PC5 192.168.30.3 30
Native VLAN 23

Vlan Scheme:

Vlan_ID Name
10 student
20 teacher
30 finance
23 native

1.Assign the IP  addresses in the table to the PCs.

2.Open s1 command line. enter following command.

s1(config)#vlan 10
s1(config-vlan)#name student
s1(config-vlan)#exit
s1(config)#int f0/1
s1(config-if)#switchport mode access
s1(config-if)#switchport access vlan 10
s1(config-if)#exit
s1(config)#vlan 20
s1(config-vlan)#name teacher
s1(config-vlan)#vlan 30
s1(config-vlan)#name finance
s1(config-vlan)#do show vlan brief

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gig0/1
Gig0/2
10 student active Fa0/1
20 teacher active
30 finance active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
s1(config-vlan)#

s1 con0 is now available

Press RETURN to get started.

s1>en
s1#conf t
s1(config)#int f0/2
s1(config-if)#switchport mode access
s1(config-if)#switchport access vlan 20
s1(config-if)#int f0/3
s1(config-if)#switchport mode access
s1(config-if)#switchport access vlan 30
s1(config-if)#int g0/1
s1(config-if)#switchport mode trunk

s1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

s1(config-if)#switchport trunk native vlan 23
s1(config-if)#switchport trunk allowed vlan 10,20

3. Enter relative command in s2 similar to S1.

4. In s3, enter command

S3(config)#vlan 10

S3(config-vlan)#name student

S3(config-vlan)#vlan 20

S3(config-vlan)#name teacher

S3(config-vlan)#vlan 30

S3(config-vlan)#name finance

S3(config-vlan)#do show vlan brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

10 student active

20 teacher active

30 finance active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

S3(config)#int g0/1

S3(config-if)#switchport mode trunk

S3(config-if)#switchport trunk nativ

%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/2 (1), with s2 GigabitEthernet0/2 (23).    //This means native VLAN on the two adjacent interfaces does not match, we have to make it on the same VLAN(23 in this lab)

S3(config-if)#switchport trunk native vlan 23

S3(config-if)#switchport trunk allowed vlan 10,20,30

S3(config-if)#int g0/2

S3(config-if)#switchport mode trunk

S3(config-if)#switchport trunk native vlan 23

S3(config-if)#switchport trunk allowed 10,20,30

S3(config-if)#exit

5. Now, you should ping the  pc successfully from the other pc which is in the same VLAN. But you can not ping the pc in other vlans.

If you have problem in the ping. The possible problems may be the following:

  1. The IP address are assigned wrong, check if the PC in the same VLAN are in the subnet.
  2. Check if the Port are in the correct VLAN, if not , change it to the right VLAN; if the VLAN present in the VLAN database, if not, create the VLAN which include the port. It is a common error to assign port to a VLAN without creating it.
  3. Check if Native VLAN match, Check if the VLANS are allowed in the trunk port. (Trunk mode mismatches if we use DTP, in this lab, we don’t need to worry about that.) By “show interfaces trunk”.
    • s1#show interfaces trunk
      Port    Mode   Encapsulation   Status     Native vlan
      Gig0/1  on     802.1q          trunking   23
      Port         Vlans allowed on trunk
      Gig0/1       10,20,30Port          Vlans allowed and active in management domainGig0/1        10,20,30Port          Vlans in spanning tree forwarding state and not pruned

      Gig0/1        10,20,30