TechKnowSurge
Cisco CCNA 2.2 Cisco CCNA 2.1
VideoNetworkFree

DEMO: Configuring VLAN Trunking

Trunk link configuration on Cisco switches controls which VLANs can pass traffic between network segments. This content covers how to enable trunking and manage allowed VLANs on inter-switch connections.

Complete this video to capture a CTF flag worth 1 point.

About this video

Trunk links are the mechanism that allows multiple VLANs to pass traffic across a single connection between switches. Without proper trunk configuration, devices on the same VLAN but connected to different switches cannot communicate, even when their management interfaces share the same VLAN assignment. This becomes immediately apparent in a multi-switch environment where a workstation on VLAN 10 can reach only the directly connected switch while the others remain unreachable. The configuration process on Cisco switches requires entering the relevant interface and issuing two commands: setting the port to trunk mode with switchport mode trunk, and defining which VLANs are permitted on that trunk with switchport trunk allowed vlan. Both ends of the inter-switch link must be configured identically, and once they are, VLAN traffic begins flowing across the connection — confirmed in the demonstration when previously failing pings to a remote management interface begin succeeding. Managing allowed VLANs on a trunk is flexible and precise. The switchport trunk allowed vlan command supports add and remove keywords, making it possible to modify the permitted VLAN list without rewriting the entire configuration. Setting the allowed VLANs to none blocks all traffic across the trunk immediately, which is useful for understanding the impact of VLAN filtering and serves as a practical reminder that trunk configuration directly controls network reachability.

What you'll learn

What's covered

Configuring Trunk Lines

Aligned to

Cisco CCNA
2.2 Configure and verify interswitch connectivity
2.1 Configure and verify VLANs (normal range) spanning multiple switches

Key terms

Virtual LAN
VLAN
A logical grouping of network devices that behave as if they are on the same network regardless of physical location.
Switch
A network device that connects devices within a LAN and forwards traffic based on MAC addresses.
Trunk Port
A switch port that carries traffic for multiple VLANs over a single link by tagging frames with their VLAN ID, used between switches or between a switch and a router. All VLANs are tagged except the native VLAN.
Access Port
A switch port that belongs to a single data VLAN and sends and receives untagged frames, used for connecting end devices such as PCs and printers. An access port may additionally carry a tagged voice VLAN for an IP phone without becoming a trunk.
Allowed VLAN List
The configured set of VLANs permitted to pass traffic across a trunk port, managed using add, remove, or none keywords.

Topics

Networking Vlan Trunking Cisco Switches Trunk Ports Vlan Management Inter Switch Links

Transcript

We're going to configure trunk lines on two of our switches so that they can start communicating.

The Setup

What we have right now is a demo laptop, and that's what we're on right now, and we're plugged into this switch, and we're plugged into VLAN 10, so we're on VLAN 10. All of the management of these different switches is VLAN 10; all the management interfaces are on VLAN 10. However, right now all we can do is connect and ping to the management interface on switch 2, which is this switch right here, because we're plugged into it. We cannot ping the interfaces on switch 1 and switch 3, and the reason being is because these are not set up as a trunk line properly to be able to pass the VLAN traffic across it.

So what we're going to do in here is set this trunk line up to pass VLAN 10 across it, and therefore we should be able to get to the management interface of this switch. As we're doing our configurations on here, I've actually got a ping up down here below, so I'm pinging 10.1.10.11, which is the management interface of this switch right here. So let's go ahead and see if we can configure it and see what happens when we set up the trunk lines to pass VLAN 10 traffic.

Configuring the Trunk on Switch 1

What I'm going to do is start out on switch 1. I'm on switch 1, and I'm actually consoled into this because I can't remote into it right now. What I'm going to do is first of all get into the global configuration mode, and we're going to get into the interface fa1/0/43, and that is the interface that's connected into switch 2.

So when we're in there, then we're going to say switchport mode. Remember, before we did switchport mode access to specify an access port. Well, now we're specifying a trunk port, so we're going to type in trunk to specify a trunk port.

Next what we're going to do is switchport trunk allowed vlan 10. We're going to say that VLAN 10 is allowed, and so now this should be showing VLAN 10.

Now, before we jump off, one thing we can do is a show interface fa1/0/43, and I want to look at the switchport settings on there and see what the switchport settings say. As we scroll through here, we see trunking VLANs enabled, trunking for VLAN 10. All right, so that's promising.

Configuring the Trunk on Switch 2

So now let's jump over to switch 2 and configure switch 2 and see if we can see any difference with our pings and see if we can get some pings through.

Now on S2 I'm going to type in configure terminal to get into configure terminal, and we are going to configure interface fa1/0/47, because that's the one that's going back to switch 1. All right, so that's the interface we want to configure. So I'm in 0/47, and I'm going to type in switchport mode trunk, and switchport trunk allowed vlan 10.

All right, and so now both interfaces on each side are set up to do trunking of this VLAN 10 across between the two switches. It took a little bit to take effect, but we are now pinging .11. So now we have this trunk line set up between these two switches.

Adding and Removing Allowed VLANs

So really it's quite simple. All we need to do is say that it's a trunk line and then list out what VLANs we want to go across that trunk line.

If we wanted to add more than just one VLAN, what we could do is say switchport trunk allowed vlan and then a list of the VLANs that we want to allow. So VLAN 10, let's say we want to do 20, let's say we want to do 30, so it's going to allow VLAN 10, 20 and 30. We hit enter, and now we can do a do show run interface fa1/0/47, and we can actually see how that has added 10, 20 and 30 now to this interface.

If we wanted to remove one of them, then we could take all of these off and put them all back on minus the one that we want to remove. Or, if we take a look at this, what we can actually do is allowed vlan, and we can use the word add or remove. So let's remove, and remove 20 here, and hit enter. Now we can take a look at that and it is just 10 and 30. So we can actually add or remove or replace this line to whatever VLANs we want to go across that trunk line there.

Or if we want none, then we could type in none, as we see there. So allowed vlans and then we could type in none, and none would be allowed. Of course, this would break our connectivity, so let's see what happens when we do that. We type in none, and we can see that it looks like our ping is now timing out, so that removes all of those. So once again, we can add, we can remove, we can replace.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →