This lab teaches how to set up VLANs and trunking on switches. VLANs are created on switches, with certain ports assigned to each VLAN. Trunk ports use 802.1q. Checking is done to make sure everything is set up correctly and hosts in different VLANs can communicate.
Solutions:
In this task, we are asked to configure VLAN 100, VLAN 200, and trunking on all the switches. We have four routers connected with three switches, which must be assigned in a particular VLAN. After VLAN configuration, we must configure trunk interfaces because we have multiple VLANs to pass through the switches. In trunking, there are two encapsulation types: ISL [Inter Switch Link] and IEEE802.1Q [dot1q]. ISL is the Cisco proprietary encapsulation method; it adds 30 bytes of extra overhead in the L2 frame, which usually is not preferred by Cisco switches. By default, 802.1q is enabled on the Cisco IOS switches. Optionally, we can change it to ISL by using the switchport trunk enacpsulation isl command. In this lab, we are not using ISL since it's not supported by most of the platforms in recent days.
Let's configure VLAN 100 and 200 on all the switches.
Sw1,Sw2 & Sw3:
vlan 100
name IT
exit
!
vlan 200
name Sales
exit
When configured, assign those VLANs in the particular ports as required by the task.
Sw1:
interface Gi0/1
switchport mode access
switchport access vlan 100
Sw2:
interface Gi0/1
switchport mode access
switchport access vlan 100
!
inter Gi0/0
switchport mode access
switchport access vlan 200
Sw3:
interface Gi0/3
switchport mode access
switchport access vlan 200
Now configure trunk and encapsulation types between switches. One thing we need to keep in mind is that the "switchport trunk encapsulation dot1q" command might not be supported by all the platforms if a platform only supports 802.1q trunking (with no ISL support).
Sw1:
interface Gi1/0
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Gi3/0
switchport trunk encapsulation dot1q
switchport mode trunk
Sw2:
interface Gi1/0
switchport trunk encapsulation dot1q
switchport mode trunk
Sw3:
interface Gi3/0
switchport trunk encapsulation dot1q
switchport mode trunk
The next step is to configure IP addresses on the host routers that correspond to the particular VLAN. When configured, we should have reachability between the devices that fall into the same VLAN ID.
R1:
interface Gi0/0
ip address 100.1.1.1 255.255.255.0
no shutdown
R2:
interface Gi0/1
ip address 100.1.1.2 255.255.255.0
no shutdown
R3:
interface Gi0/1
ip address 200.1.1.3 255.255.255.0
no shutdown
R4:
interface Gi0/1
ip address 200.1.1.4 255.255.255.0
no shutdown
Verification
As per the task requirements, we have configured VLAN 100 and 200 on all the switches and also configured the trunk ports as required. Now we have R1 and R2 assigned to VLAN 100, and R3 and R4 have been assigned to VLAN 200. Before we move on to the reachability test, we must verify which VLANs are created and how they are assigned to the switchports. Verify the VLANs and trunking first.
Sw1#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/0, Gi0/2, Gi0/3, Gi1/1
Gi1/2, Gi1/3, Gi2/0, Gi2/1
Gi2/2, Gi2/3, Gi3/1, Gi3/2
Gi3/3
100 IT active Gi0/1
200 Sales active
Sw1#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi1/0 on 802.1q trunking 1
Gi3/0 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi1/0 1-4094
Gi3/0 1-4094
Port Vlans allowed and active in management domain
Gi1/0 1,100,200
Gi3/0 1,100,200
Port Vlans in spanning tree forwarding state and not pruned
Gi1/0 1,100,200
Gi3/0 1,100,200
Sw2#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/2, Gi0/3, Gi1/1, Gi1/2
Gi1/3, Gi2/0, Gi2/1, Gi2/2
Gi2/3, Gi3/0, Gi3/1, Gi3/2
Gi3/3
100 IT active Gi0/1
200 Sales active Gi0/0
Sw2#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi1/0 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi1/0 1-4094
Port Vlans allowed and active in management domain
Gi1/0 1,100,200
Port Vlans in spanning tree forwarding state and not pruned
Gi1/0 1,100,200
Sw3#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/0, Gi0/1, Gi0/2, Gi1/0
Gi1/1, Gi1/2, Gi1/3, Gi2/0
Gi2/1, Gi2/2, Gi2/3, Gi3/1
Gi3/2, Gi3/3
100 IT active
200 Sales active Gi0/3
Sw3#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi3/0 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi3/0 1-4094
Port Vlans allowed and active in management domain
Gi3/0 1,100,200
Port Vlans in spanning tree forwarding state and not pruned
Gi3/0 1,100,200
In the above output, we can see that there are two VLANs configured manually, because others are default VLANs built in to the Cisco IOS. By default, VLAN 1 is considered the management VLAN, which can't be removed from the switch. VLAN-IDs from 1002 to 1005 are reserved for the token ring, one of the LAN technologies like Ethernet. It also cannot be removed from the switch. Additionally, when doing show interface trunk, we can see the trunking status and the encapsulation protocol, i.e.802.1q in this case here. By default, Cisco switches have a native VLAN of 1, which is usually considered to be the untagged VLAN, typically used for control plane traffic such as VTP, CDP, STP, BPDUs, etc. that does not need VLAN tagging.
Now we can check for the reachability between R1 and R2, and R3 and R4.
R1#ping 100.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
R3#ping 200.1.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.1.1.4, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/4 ms
NOTE: The first packet of the initial ping is dropped because of the ARP process when the source host is trying to find the destination host MAC address. Subsequent packets are replied back normally.