You have two Cisco switches, Switch1 and Switch2, and you want to set up an 802.1Q trunk between them. The trunk will carry traffic for multiple VLANs (for example, VLAN 10, VLAN 20, and VLAN 30) between the two switches.
The goal is for devices on different VLANs on different switches to communicate as if they are on the same network.
Network Topology:
Sw1 and Sw2 are connected via a trunk link, which is configured on their respective interfaces.
Step-by-Step Guide to Configuring 802.1Q Trunking:
Step 1: Initial Setup on Switch1
Access Switch1:
Open the command-line interface (CLI) of Sw1 using a console cable or SSH (if configured).
Configure VLANs on Switch1:
Define the VLANs that will be used on both switches. In this case, we are using VLAN 10, VLAN 20, and VLAN 30.
Verify that the trunk link is allowing multiple VLANs to pass by using the show vlan brief command. The trunk should be carrying VLANs 10, 20, and 30.
On Sw1:
Sw1#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et3/0, Et3/1, Et3/2
10 Marketing active Et0/0, Et0/1, Et0/2, Et0/3
20 HR active Et1/0, Et1/1, Et1/2, Et1/3
30 IT active Et2/0, Et2/1, Et2/2, Et2/3
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
On Sw2:
Sw2#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et3/0, Et3/1, Et3/2
10 Marketing active Et0/0, Et0/1, Et0/2, Et0/3
20 HR active Et1/0, Et1/1, Et1/2, Et1/3
30 IT active Et2/0, Et2/1, Et2/2, Et2/3
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
Step 4: Testing the Configuration
Test Connectivity:
Connect devices to the access ports on each switch and test that they can communicate across the VLANs.
For example, if you have a device on VLAN 10 connected to Sw1, you should be able to ping the device on VLAN 10 connected to Sw2.
/PC1> ping 192.168.10.101
84 bytes from 192.168.10.101 icmp_seq=1 ttl=64 time=0.703 ms
84 bytes from 192.168.10.101 icmp_seq=2 ttl=64 time=1.084 ms
84 bytes from 192.168.10.101 icmp_seq=3 ttl=64 time=0.810 ms
84 bytes from 192.168.10.101 icmp_seq=4 ttl=64 time=1.055 ms
^C
PC1>