Trunk Port on Layer-2 Switches!

Safiullah Khan
2 min readDec 10, 2023

--

In this article I have been configuring two layer-2 switches which are connected by trunk ports and same VLAN communication for networks.

Figure 1: Network for trunk example

Now to communicate two PC’s which are in green as they belonging to same network, we will make VLAN and assign ports on both switches to VLAN where these two PCs are connected. First create VLAN 2 and assign port FastEthernet 0/1 to VLAN 2 on both switches as shown below.

Figure 2: Port Assignment to VLAN 2

Now we also run above commands to switch 2 as shown below.

Figure 3: Port Assignment to VLAN 2

As port assignment has been done last thing, we will perform is to configure Fastethernet 0/23 as trunk for communication between VLAN’s 2 on both switches.

Figure 4: FastEthernet 0/23 as Trunk port

After configuring we will test whether VLAN 2 PC on switch 1 can ping the PC on switch 2 as shown below figure.

Figure 5: Same VLAN Communication

As two same VLAN’s can communicate through trunk port so in this way we use trunk port for communication on different switches having same network segments.

What is Trunk Port?

“A trunk port is a port that is assigned to carry traffic for all the VLANs that are accessible by a specific switch, a process known as trunking”.

--

--

Safiullah Khan

Associate Security Engineer || Vulnerability Assessment || Google CPC || Blue Team Junior Analyst || SIEM || IDS/IPS || Wazuh || Cortex XDR || Splunk