After getting my CCNA, I took a pretty long break from Cisco and shifted my focus to Juniper, earning five Juniper certifications along the way. Now it's time to come back to Cisco and start working towards my CCNP ENCOR. It feels great to be back, and I'm starting with the switching fundamentals. In this article, I'll go through three labs covering VLANs and SVIs, trunking and router subinterfaces, and EtherChannel.
I've probably gone through these topics a million times by now, starting with my CCNA and then again during my Juniper studies. But that's one of the things I like about studying for certifications. They force you to go back and revisit the basics that you would otherwise slowly forget. Even if you know how something works, it's easy to forget the details when you're not using them regularly.
VLANs and SVIs
The first topology has three switches in VLAN 10.
There are no trunks in this part. Both links carry only VLAN 10, with the interfaces configured as access ports.
| Switch | Primary address on Vlan10 | Secondary addresses on Vlan10 |
|---|---|---|
| SW1 | 10.0.10.1/24 | 10.0.11.1/24, 10.0.12.1/24 |
| SW2 | 10.0.10.2/24 | 10.0.11.2/24, 10.0.12.2/24 |
| SW3 | 10.0.10.3/24 | None |
On SW1, I created VLAN 10, assigned the access port, and configured the SVI:
vlan 10 name USERS!interface GigabitEthernet0/1 switchport mode access switchport access vlan 10 no shutdown!interface Vlan10 ip address 10.0.10.1 255.255.255.0 ip address 10.0.11.1 255.255.255.0 secondary ip address 10.0.12.1 255.255.255.0 secondary no shutdownSW2 uses the same configuration with .2 in each subnet. On SW3, both physical interfaces belong to VLAN 10, and the SVI only needs its primary address:
vlan 10 name USERS!interface range GigabitEthernet0/1 - 2 switchport mode access switchport access vlan 10 no shutdown!interface Vlan10 ip address 10.0.10.3 255.255.255.0 no shutdownA secondary IP address allows you to configure multiple IP subnets on the same Layer 3 interface without creating additional VLANs or interfaces.
This can be useful during network migrations, for example when moving devices from an old subnet to a new one without changing all their IP addresses at once. Another use case is when you run out of addresses in an existing subnet and need to add another subnet to the same VLAN.
Both subnets share the same Layer 2 broadcast domain, but they are still separate IP networks, so communication between them requires routing.
Checking the SVI state
show ip interface brief | include Vlanshow running-config interface Vlan10The first command checks whether the SVI is up/up, while the second shows its configuration, including any secondary IP addresses.
Unlike a physical interface, an SVI does not have its own physical link. By default, for it to be up/up, the VLAN must exist and at least one switchport in that VLAN must be active and in a forwarding state. This can be an access port assigned to the VLAN or a trunk port allowing it. Simply configuring an IP address and no shutdown is not enough.
DTP and router-on-a-stick
The second lab uses a router and two switches:
SW1 has an SVI in VLAN 10, and SW2 has an SVI in VLAN 20. R1 connects to both subnets through separate subinterfaces on one physical link.
| Device | Interface | Address |
|---|---|---|
| SW1 | Vlan10 | 10.0.10.1/24 |
| SW2 | Vlan20 | 10.0.20.2/24 |
| R1 | Gi0/0.10 | 10.0.10.100/24 |
| R1 | Gi0/0.20 | 10.0.20.100/24 |
Negotiated trunk between the switches
The task is to make SW1 initiate DTP negotiation and SW2 respond. This means dynamic desirable on SW1 and dynamic auto on SW2.
On SW1:
vlan 10 name USERSvlan 20 name SERVERS!interface GigabitEthernet0/0 switchport mode dynamic desirable no shutdown!interface Vlan10 ip address 10.0.10.1 255.255.255.0 no shutdownOn SW2:
vlan 10 name USERSvlan 20 name SERVERS!interface GigabitEthernet0/0 switchport mode dynamic auto no shutdown!interface Vlan20 ip address 10.0.20.2 255.255.255.0 no shutdownWith DTP, dynamic auto means the port is willing to become a trunk but will not initiate the negotiation itself. On the other hand, dynamic desirable actively tries to establish a trunk.
Since SW1 is configured as dynamic desirable and SW2 as dynamic auto, they successfully negotiate a trunk. If both sides were configured as dynamic auto, neither would initiate the negotiation, and the ports would remain in access mode.
show interfaces GigabitEthernet0/0 switchportshow interfaces trunkThe first command shows both the configured (administrative) mode and the actual (operational) mode of the interface. For example, a port configured as dynamic auto can still operate as a trunk if the other side is set to dynamic desirable.
The second command lists the interfaces currently operating as trunks, along with their allowed and active VLANs. This helps confirm that DTP negotiation was successful and the expected VLANs are being carried.
Static trunk toward R1
The router link uses a static trunk. On SW1:
interface GigabitEthernet0/1 switchport trunk encapsulation dot1q switchport mode trunk switchport nonegotiate no shutdownOn older Cisco switches, trunk encapsulation must be set to dot1q before enabling trunk mode. Otherwise, the switch may reject the configuration because the encapsulation is still set to negotiate, and it cannot determine whether to use ISL or 802.1Q. Modern switches only support 802.1Q, so this step is no longer necessary.
The switchport nonegotiate disables DTP frames, which are unnecessary when connecting to a router that does not participate in DTP negotiation.
On R1:
interface GigabitEthernet0/0 no ip address no shutdown!interface GigabitEthernet0/0.10 encapsulation dot1Q 10 ip address 10.0.10.100 255.255.255.0!interface GigabitEthernet0/0.20 encapsulation dot1Q 20 ip address 10.0.20.100 255.255.255.0The encapsulation dot1Q command tells the router which VLAN each subinterface belongs to. The .10 and .20 suffixes are just naming conventions. They don't determine the VLAN ID, so you could name the subinterfaces differently and they would still work.
This setup is called Router-on-a-Stick (ROAS). It allows a router to provide inter-VLAN routing using a single physical interface instead of requiring a separate interface for each VLAN. Router-on-a-Stick is not something you would typically see handling inter-VLAN routing in a large enterprise network nowadays. Layer 3 switches usually handle this using SVIs, which is a more scalable approach. Still, understanding ROAS is useful, especially since VLAN-tagged subinterfaces are still commonly used on routers and firewalls.
For example, when a device in VLAN 10 sends traffic to a device in VLAN 20, the router receives it on Gi0/0.10 with VLAN tag 10, makes a Layer 3 routing decision, and sends it back out through Gi0/0.20 with VLAN tag 20. Both VLANs use the same physical connection between the switch and router.
A working trunk still needs the VLAN
Even though SW1 only has an SVI for VLAN 10, it still needs VLAN 20 in its VLAN database. This is because VLAN 20 traffic from R1 has to pass through SW1 to reach SW2. SW1 doesn't need an IP address in VLAN 20, but it needs to recognize the VLAN to forward its traffic.
This is also why checking whether a port is trunking is not enough. The show interfaces trunk command shows which VLANs are allowed on the trunk, which ones exist and are active on the switch, and which ones are actually forwarding traffic.
For example, VLAN 20 might be allowed on the trunk but missing from the switch's VLAN database. In that case, the trunk itself can be up while VLAN 20 traffic is not forwarded.
From R1, I can test connectivity to both VLANs using two pings:
ping 10.0.10.1 source GigabitEthernet0/0.10ping 10.0.20.2 source GigabitEthernet0/0.20The first ping checks connectivity to SW1 over VLAN 10. The second checks connectivity to SW2 over VLAN 20, which also requires VLAN 20 to be configured and forwarded correctly on SW1 and the trunk between the switches.
If the first ping works but the second fails, I would start by checking VLAN 20 and the trunk configuration on both switches.
These pings confirm that R1 can reach devices in each VLAN, but they don't test inter-VLAN routing. To verify that, I would need to send traffic between devices in different VLANs, with R1 configured as their default gateway.
One thing to be careful about is the trunk allowed VLAN list:
switchport trunk allowed vlan 10,20This command replaces the entire allowed VLAN list with VLANs 10 and 20. If you want to add VLAN 30 without removing the existing ones, you need to use: switchport trunk allowed vlan add 30. Forget the add keyword, and congratulations, you've just removed every other VLAN from the trunk. A great way to turn a simple configuration change into a network outage.
Also, allowing a VLAN on a trunk doesn't automatically create it. The VLAN must exist locally for the switch to forward its traffic.
Static and LACP EtherChannels
The third topology has three switches with parallel links:
| Bundle | Endpoints and member ports | Mode | Active member limit |
|---|---|---|---|
| Po15 | SW1 Gi1/0–1 to ACC Gi1/0–1 | Static on both ends | Both links |
| Po25 | SW2 Gi2/1–2 to ACC Gi2/1–2 | SW2 passive, ACC active | Both links |
| Po12 | SW1 Gi0/0–3 to SW2 Gi0/0–3 | LACP active on both ends | Two of four links |
EtherChannel members need compatible settings, such as speed, duplex, trunk mode, and allowed VLANs, to work together properly.
This is especially important with static EtherChannel (mode on), since it doesn't use LACP or PAgP to negotiate with the other switch. Both ends must be configured correctly, or you risk creating a Layer 2 loop or causing traffic issues, so it's good practice to keep the member interfaces shut down until both ends are fully configured, then bring them up.
On SW1:
interface range GigabitEthernet1/0 - 1 shutdown switchport mode access switchport access vlan 1 channel-group 15 mode on!interface range GigabitEthernet0/0 - 3 shutdown switchport mode access switchport access vlan 1 channel-group 12 mode active!interface Port-channel12 lacp max-bundle 2On SW2:
interface range GigabitEthernet2/1 - 2 shutdown switchport mode access switchport access vlan 1 channel-group 25 mode passive!interface range GigabitEthernet0/0 - 3 shutdown switchport mode access switchport access vlan 1 channel-group 12 mode active!interface Port-channel12 lacp max-bundle 2On ACC:
interface range GigabitEthernet1/0 - 1 shutdown switchport mode access switchport access vlan 1 channel-group 15 mode on!interface range GigabitEthernet2/1 - 2 shutdown switchport mode access switchport access vlan 1 channel-group 25 mode activeAfter configuring all three switches, enable the member interfaces. On SW1:
interface range GigabitEthernet0/0 - 3, GigabitEthernet1/0 - 1 no shutdownOn SW2:
interface range GigabitEthernet0/0 - 3, GigabitEthernet2/1 - 2 no shutdownOn ACC:
interface range GigabitEthernet1/0 - 1, GigabitEthernet2/1 - 2 no shutdownEtherChannel can be configured either statically or dynamically using a negotiation protocol like LACP. In this lab, I used both methods to see how they work.
Po15 uses mode on, which creates a static EtherChannel. There is no negotiation between the switches. Both sides simply assume that the other end is configured correctly and start treating the member interfaces as a single logical link. This is why static EtherChannel requires extra care when configuring both ends.
Po25 uses LACP instead. LACP allows switches to exchange information and negotiate which interfaces should become part of the bundle. There are two LACP modes:
active: Actively sends LACP packets to initiate negotiation.passive: Waits for LACP packets from the other side and responds.
For Po25, ACC is configured as active and SW2 as passive. ACC initiates the negotiation, SW2 responds, and the EtherChannel forms.
Po12 uses active on both sides. This also works because both switches are sending and responding to LACP packets.
The important thing to remember is that passive/passive doesn't work because neither switch initiates LACP. It's similar to how dynamic auto works with DTP.
You also cannot mix mode on with LACP modes. Since mode on doesn't participate in LACP, the switches cannot negotiate a proper bundle.
Reading the bundle state
Once the port-channels are configured, we can check whether the interfaces have successfully joined their bundles.
show etherchannel summaryshow lacp neighborshow spanning-tree vlan 1The first command gives us an overview of all EtherChannels, including their negotiation protocols and member interfaces. Ideally, we should see the following:
Po15: Two bundled interfaces using static EtherChannel, with no negotiation protocol.
Po25: Two bundled interfaces using LACP.
Po12: Two active bundled interfaces and two LACP hot-standby interfaces.
Cisco uses flags to indicate the state of each port-channel and its members.
| Flag | Meaning |
|---|---|
| S | Layer 2 port-channel |
| U | Port-channel in use |
| P | Member bundled in the port-channel |
| H | LACP hot-standby member |
| s | Suspended member |
| I | Stand-alone interface |
| D | Down |
For example, Po12(SU) tells us that Port-channel12 is a Layer 2 EtherChannel and is operational. Individual interfaces marked with (P) have successfully joined the bundle.
What about the hot-standby interfaces?
For Po12, I configured lacp max-bundle 2 under the port-channel interface. This limits the bundle to two active physical interfaces, even though four interfaces are configured as members.
The remaining two interfaces should appear with the (H) flag. They still participate in LACP and maintain communication with the neighboring switch, but they don't carry normal data traffic. If an active member fails, an eligible standby interface can take its place.
We can verify the LACP neighbors using show lacp neighbor, which displays information about the connected LACP partners.
What about Spanning Tree?
There is still a Layer 2 triangle between SW1, SW2, and ACC, meaning we have redundant paths that could create a switching loop.
EtherChannel doesn't eliminate this problem. STP treats each port-channel as a single logical interface, regardless of how many physical links belong to it. Therefore, STP still needs to block one of the redundant logical paths.
Using show spanning-tree vlan 1, we can check which port-channels are forwarding and which are blocking for VLAN 1.
This is an important distinction: an interface marked (P) is successfully bundled, but that doesn't necessarily mean it is forwarding VLAN traffic. EtherChannel determines which physical interfaces belong to the bundle, while STP determines whether the logical port-channel can forward traffic for a particular VLAN.
Testing hot-standby replacement
Now let's see what happens when one of the active EtherChannel members goes down.
First, use show etherchannel summary to identify which interfaces are currently bundled (P) and which are in hot-standby (H). Remember, we configured lacp max-bundle 2, so only two of the four interfaces should be active.
Assuming Gi0/0 is one of the active members, shut it down on both SW1 and SW2:
interface GigabitEthernet0/0 shutdownI'm shutting down both ends because virtual links in PNETLab don't always propagate link-down events to the other side. Normally, LACP can detect a failed link through physical link-down or by missing LACP packets, but shutting down both ends makes the test more predictable.
Now check the EtherChannel state again:
show etherchannel summaryWe should see Gi0/0 marked as down (D), while one of the previously standby interfaces moves from H to P and joins the active bundle.
Since we started with four interfaces and shut down one, we now have three available members. Two should be active and one should remain in hot-standby, keeping us within the max-bundle 2 limit.
Finally, restore Gi0/0 with no shutdown on both switches and check the bundle again. The restored interface should rejoin LACP, although it might become either active or standby depending on LACP's port selection.
This confirms that LACP can replace a failed member with a standby interface. However, it doesn't tell us whether any packets were lost during the failover. To test that, we would need to generate continuous traffic across the bundle while shutting down an active link.
Checking a member that does not join
If an interface fails to join an EtherChannel, the first thing I would check is whether its configuration matches the other member interfaces.
show etherchannel summaryshow running-config interface GigabitEthernet2/1show running-config interface GigabitEthernet2/2EtherChannel requires compatible settings across its member interfaces, including speed, duplex, switchport mode, and VLAN configuration. For trunk ports, the native VLAN and allowed VLAN list also need to match.
If an interface is suspended, I would compare its configuration with the working members and check the switch's log messages to understand why it was rejected.
How EtherChannel distributes traffic
One last thing worth mentioning is how EtherChannel actually uses its member interfaces.
Having four 1 Gbps interfaces in an EtherChannel gives us 4 Gbps of aggregate bandwidth, but that doesn't mean a single connection can use all 4 Gbps.
EtherChannel uses a hashing algorithm to decide which physical link carries a particular flow. Depending on the configured load-balancing method, the hash can use source and destination MAC addresses, IP addresses, or Layer 4 port numbers.
show etherchannel load-balanceThis command shows which hashing method the switch is using.
The important part is that a single flow normally stays on one physical link to avoid out-of-order packets. Multiple flows can be distributed across different members, although the distribution isn't necessarily equal.
So, adding more interfaces increases the total available bandwidth, but it doesn't automatically increase the maximum throughput of a single flow.
