Get the App
SLTechnology News&Howtos  ›  Servers  › 

Using TRUNK to realize VLAN communication between switches

Shulou Source: shulou.com Published: 2022-06-02 12:34:35 10月04日 Update

Trunk enables different VLAN to communicate with the same VLAN in other switches over a shared link.

Multiple VLAN have been created on the two switches. To communicate with the same VLAN (such as VLAN10) on both switches, you need to interconnect a port belonging to VLAN10 on switch An and a port belonging to VLAN10 on switch B. if the other identical VLAN of the two switches need to communicate, then more interconnection lines are needed between the switches, and the port utilization is too low. At this point, the switch can use the trunk function (trunk link), as long as there is an interconnect between the two switches, and the two ports of the interconnect are set to trunk mode, so that different VLAN on the switch can share the line.

Now let's experiment with using TRUNK to realize VLAN communication between switches.

First, build 2 switches and 4 VPCs devices, connect them with a network cable, and click on all.

Set PC1 IP192.168.10.10/24

PC2 IP192.168.10.20/24

PC3 IP192.168.10.30/24

PC4 IP192.168.10.40/24

And PC1 and PC3 are VLAN10,PC2 and PC4 are VLAN20

Now start to configure

First configure sw1, create new VLAN10 and VLAN20, and divide f1Uniplet0 and f1Uniplet1 into them respectively.

Then enter the interface mode of f1max 2 and set it to TRUNK mode

Sw1 is configured successfully, and sw2 is also configured.

After the sw2 configuration is complete, configure the PC1,2,3,4 with ip respectively

After the configuration is complete, we use PC1 to ping PC3 and PC2 to ping PC4 to see if we can connect.

Unicom has been realized.

In practice, switches use Ethernet links

An Ethernet link is made up of two or more links and the port is TRUNK

Advantage 1: increase link bandwidth

2: increase reliability (when one link is down, the other link can continue to run for it)

Next, let's add a link to the above switch.

Connect sw1 and sw2 with another network cable

And configure 2 ports as TRUNK

Enter the instruction no shutdown to turn them on.

Now you need to bind the TRUNK ports of the two-sided switches together.

After the configuration is complete, let's see if we can connect.

It can be connected.

Now let's disconnect one of the links and see if we can still connect.

Let's type the instruction ping 192.168.10.30-t into PC1 to make it grow ping.

Then enter the interface mode of f1ap2 in sw1 and sw2 and enter the instruction shutdown to disconnect them.

Let's take a look at the Unicom situation in PC1.

It's still connected. The reliability of the Ethernet link is confirmed.

Tags: Switch link configuration port communication mode between same Ethernet instruction Ethernet input different can make reliability condition interface network cable and will succeed Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker Microsoft NVidia Apple