CCNA Trunks, LACP EtherChannel, Routed Ports and SVIs
Infrastructure connectivity is how Cisco switches connect to each other and to routers: as Layer 2 802.1Q trunks, as Layer 3 routed ports, as LACP EtherChannel bundles at either layer, and through switch virtual interfaces (SVIs) that give a VLAN a gateway or management address. This lesson covers CCNA v2.0 exam topic 2.1: when a port is a switchport or a routed port, how trunks form and which VLANs they carry, the native VLAN and router-on-a-stick, when an SVI comes up and when a multilayer switch routes, and how to build, read and tune an LACP port-channel.
On this page10 sections
- What is the difference between a Layer 2 and a Layer 3 physical interface?
- How does an 802.1Q trunk form, and how does DTP decide?
- How do you control which VLANs a trunk carries?
- What is the native VLAN, and what happens when the two ends differ?
- How do you connect a switch trunk to a router (router-on-a-stick)?
- How do you configure an SVI, and when is it up?
- How does a multilayer switch route between SVIs, and how is a Layer 2 switch managed?
- How does LACP form an EtherChannel, and how do you read show etherchannel summary?
- What must match on member ports, and how do you build a Layer 3 port-channel?
- How does EtherChannel spread traffic, and how many links are active?
- Choose between a routed port, a transit-VLAN SVI and a trunk to router subinterfaces, and configure a routed port with no switchport
- Predict whether two DTP modes form a trunk, and harden a link with a static trunk and nonegotiate on both ends
- Edit a trunk's allowed VLAN list with add, remove and except, and read the three stages of show interfaces trunk
- Set and verify the native VLAN, read a CDP native VLAN mismatch, and handle untagged traffic on a router-on-a-stick link
- Configure an SVI, explain the autostate conditions for up/up, and decide when ip routing, ipv6 unicast-routing or ip default-gateway applies
- Build Layer 2 and Layer 3 LACP port-channels, diagnose them from show etherchannel summary flags, and control active links with max-bundle and min-links
- Pick an EtherChannel load-balance method whose hashed fields actually vary for the traffic
What is the difference between a Layer 2 and a Layer 3 physical interface?
A Layer 2 interface (a switchport) forwards Ethernet frames inside one or more VLANs and cannot hold an IP address; a Layer 3 interface (a routed port) behaves like a router interface: it takes an IP address directly, belongs to no VLAN and takes no part in spanning tree. Catalyst switch ports are switchports by default. The command no switchport turns a physical port on a multilayer switch into a routed port, and switchport turns it back.
interface GigabitEthernet1/0/48
no switchport
ip address 10.0.0.1 255.255.255.252
If you type ip address on a port that is still a switchport, IOS rejects it, because only Layer 3 interfaces (routed ports, SVIs, Layer 3 port-channels and router interfaces) accept an address. ip routing is a different thing: it is a global command that lets the switch route between its Layer 3 interfaces, and it does not change any port's type.
To tell which kind a port is, read show interfaces <port> switchport. A routed port reports Switchport: Disabled; the interface can still be up/up, but no VLAN crosses it. That is the usual explanation when a link that "should be a trunk" is up yet carries none of its VLANs after a change.
Three ways to connect a multilayer switch to a router
| Design | Switch side | VLAN or STP on the link? | Typical use |
|---|---|---|---|
| Routed port | no switchport + IP address on the port | No | Point-to-point /30 or /31 to a router, firewall or another core switch |
| Transit VLAN | Access port in a transit VLAN + IP on that VLAN's SVI | Yes | Platforms or designs that need the link in a VLAN |
| Trunk to subinterfaces | 802.1Q trunk; the router has one subinterface per VLAN | Yes | Router-on-a-stick, where the router is the VLAN gateway |
All three forward traffic. When a design says no VLAN or spanning-tree instance may extend onto the router link, only the routed port meets it.
How does an 802.1Q trunk form, and how does DTP decide?
An 802.1Q trunk carries several VLANs over one link by inserting a 4-byte tag holding the VLAN ID into each frame (except the native VLAN, covered below). A trunk forms either because both ends are configured statically, or because the Dynamic Trunking Protocol (DTP), a Cisco protocol, negotiates it. Cisco recommends configuring trunks statically and turning DTP off.
| Administrative mode | Sends DTP requests? | Becomes a trunk when the neighbour is… |
|---|---|---|
switchport mode trunk | Yes (unless nonegotiate) | Always trunks itself, whatever the neighbour does |
switchport mode dynamic desirable | Yes, actively asks | trunk, dynamic desirable or dynamic auto, and DTP frames are exchanged |
switchport mode dynamic auto | No, only answers | trunk or dynamic desirable (a neighbour that asks) |
switchport mode access | No | Never trunks |
The rule behind the table: at least one end must ask. Dynamic auto on both ends never trunks, because neither asks; both ports operate as access ports in their access VLAN (VLAN 1 by default), and only that VLAN crosses. On many Catalyst models the factory default is dynamic auto, which is why two new switches cabled together often fail to trunk. show interfaces <port> switchport shows both the configured Administrative Mode and the result, the Operational Mode (for example dynamic auto / static access).
switchport nonegotiate stops a port sending DTP frames. A trunk with nonegotiate therefore only pairs correctly with another static trunk: a dynamic auto neighbour never hears a request, and a dynamic desirable neighbour asks but gets no answer, so in both cases the neighbour stays an access port while the nonegotiate side trunks and tags frames, a mismatched link. To harden a link and still trunk, configure switchport mode trunk and switchport nonegotiate on both ends.
Some older platforms that support ISL also need switchport trunk encapsulation dot1q before a port can be set to trunk; current Catalyst switches support 802.1Q only. Encapsulation, allowed lists and native VLANs only matter once the link is actually trunking.
How do you control which VLANs a trunk carries?
A trunk carries only the VLANs in its allowed VLAN list, which defaults to all VLANs (1–4094). The command form decides whether you replace the list or edit it, and that difference causes real outages.
| Command | Effect on the existing list |
|---|---|
switchport trunk allowed vlan 10,20 | Replaces the whole list with exactly 10 and 20 |
switchport trunk allowed vlan add 30 | Appends 30; everything already allowed stays |
switchport trunk allowed vlan remove 30 | Subtracts 30 from the current list |
switchport trunk allowed vlan except 30,99 | Builds a new list: every VLAN except 30 and 99, including VLANs created later |
switchport trunk allowed vlan all / none | Resets to every VLAN / no VLAN |
Typing a bare list when you meant to add one VLAN leaves only that VLAN on the trunk and cuts every other VLAN; the repair is add with the missing VLANs. add and remove work relative to what is configured now, so remove on a short explicit list cannot produce "everything except". A hand-written range such as 1–1005 looks equivalent to except but misses the extended range (1006–4094). The native, access and voice VLAN commands also take a VLAN number, but none of them changes which VLANs a trunk carries.
Reading show interfaces trunk
show interfaces trunk narrows the VLAN list in three stages, and the stage where a VLAN disappears tells you the cause:
- Vlans allowed on trunk: the configured allowed list.
- Vlans allowed and active in management domain: allowed and existing (active) in the local VLAN database. A VLAN that is allowed but missing here has not been created on this switch; fix it with
vlan <id>. - Vlans in spanning tree forwarding state and not pruned: of those, the VLANs this trunk is actually forwarding. A VLAN that exists and is allowed but is missing here is blocked by spanning tree on this port (or pruned).
A VLAN crosses a trunk only if it passes these checks on both switches, so each end must be read separately: one VLAN can fail the allowed-list check on one switch while another VLAN fails the "exists" check on the other. Note that show vlan brief lists access ports only and never shows trunk ports, so a VLAN that looks empty there may still be carried on a trunk.
What is the native VLAN, and what happens when the two ends differ?
The native VLAN is the one VLAN whose frames cross an 802.1Q trunk untagged; every other VLAN is tagged. It is VLAN 1 by default and is changed per trunk with switchport trunk native vlan 999. Many security standards move it to an unused VLAN. Each end puts untagged frames it receives into its own native VLAN, so both ends must agree. If they differ, untagged frames sent in one VLAN can be received into a different VLAN. On Cisco switches running PVST+ or Rapid PVST+ (the default), spanning tree usually catches this first and puts the affected VLANs on that port into a blocking (port VLAN ID inconsistent) state, so the practical symptom is often lost connectivity rather than leaked traffic. Either way, the configuration is wrong until both ends match.
CDP detects the mismatch and logs it, local side first and neighbour second:
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on
TenGigabitEthernet1/1/3 (1), with DIST-B TenGigabitEthernet1/1/4 (777).
Here the local switch still uses the default native VLAN 1 and DIST-B uses 777. Changing either end removes the message; a site standard tells you which end is wrong. (CDP itself is covered in the CDP and LLDP lesson.)
Two details trip people up:
- The native VLAN is still subject to the allowed list. Setting a native VLAN does not add it to the trunk: if the native VLAN is left out of an explicit allowed list, that VLAN is not carried at all, and anything that lives only in it (often a management SVI) becomes unreachable across the trunk. Allowing the VLAN with
addrestores it. - Untagged means untagged at the far end too. A device that expects VLAN 10 to arrive tagged, such as a router subinterface, will not receive VLAN 10 if the switch has made 10 its native VLAN (next section).
The global command vlan dot1q tag native makes a switch tag the native VLAN as well; it is a hardening option and does not take a VLAN off or onto the allowed list.
How do you connect a switch trunk to a router (router-on-a-stick)?
Router-on-a-stick routes between VLANs over one physical link: the switch port is an 802.1Q trunk, and the router splits its interface into one subinterface per VLAN, each with an encapsulation dot1Q VLAN ID and the gateway address for that VLAN.
interface GigabitEthernet0/0/1
no shutdown
interface GigabitEthernet0/0/1.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface GigabitEthernet0/0/1.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
What each side must get right:
- The switch port must be a static trunk (
switchport mode trunk). Cisco routers do not run DTP, so a dynamic auto port facing a router waits for a request that never comes, stays an access port, and sends untagged frames that no tagged subinterface accepts. - A subinterface needs its encapsulation before it accepts an IP address, and
encapsulation dot1Q 10without thenativekeyword matches only frames tagged 10. - Untagged (native VLAN) traffic is received either by a subinterface configured with
encapsulation dot1Q <vlan> nativeor by an IP address on the physical interface itself. If the switch's native VLAN is a VLAN the router expects tagged, that VLAN breaks while the others work; fix it by matching the native VLAN on both sides or by moving the switch's native VLAN to an unused one. - Subinterfaces follow the physical interface. If the physical port is administratively down, every subinterface is down;
no shutdowngoes on the physical interface, which needs no IP address of its own. switchportcommands do not exist on router interfaces, and a router routes IPv4 without any extra global command;ip routingis a multilayer-switch concern.
How do you configure an SVI, and when is it up?
A switch virtual interface (SVI) is a logical Layer 3 interface for a VLAN, created with interface vlan <id>. It gives the switch an address in that VLAN: as the default gateway for the VLAN's hosts on a multilayer switch, or as the management address on a Layer 2 switch. An SVI serves the VLAN whose number it carries: the gateway for VLAN n belongs on interface Vlann, and an address on any other SVI sits in a different VLAN however similar the numbers look.
vlan 70
name USERS-70
interface Vlan70
ip address 192.168.70.1 255.255.255.0
no shutdown
An SVI that is not shut down is up/up only when:
- its VLAN exists and is active in the local VLAN database, and
- at least one Layer 2 port carrying that VLAN is up and in spanning-tree forwarding: an access port in the VLAN, or a trunk that allows it.
This behaviour is called autostate. It means an SVI goes down when the last port carrying its VLAN goes down, and with it the connected route for that subnet leaves the routing table, so routing protocols stop advertising it. On a distribution switch with no access ports, the trunk is the only candidate, so a VLAN missing from the trunk's allowed list keeps the SVI down. IP routing, routes and native VLAN choices do not affect an SVI's line protocol.
| Status line | Meaning | Fix |
|---|---|---|
Vlan100 is administratively down, line protocol is down | The SVI has shutdown configured | no shutdown under the SVI |
Vlan200 is down, line protocol is down | Enabled, but its VLAN is missing or has no up, forwarding port | Create the VLAN, or bring up / allow a port carrying it |
up / down in show ip interface brief | Enabled; line protocol down for the same autostate reasons | As above |
IOS refuses an address whose subnet overlaps one already configured on another interface and names that interface, for example % 172.16.40.0 overlaps with Vlan30. To move an address between SVIs, remove it from the old SVI first, from the console or another management path, because removing it cuts any session using it.
How does a multilayer switch route between SVIs, and how is a Layer 2 switch managed?
A multilayer switch routes between its SVIs and routed ports only when ip routing is enabled. Without it the switch acts as a host: each SVI still answers pings from its own VLAN, but nothing is forwarded between VLANs, and show ip route shows a default gateway and an ICMP redirect cache instead of a routing table. IPv6 is controlled separately by ipv6 unicast-routing; until it is entered the switch answers pings to its own IPv6 addresses but does not forward IPv6 between interfaces or send router advertisements, so hosts learn no default router. ip cef selects the forwarding method and does not enable routing.
| Setting | Used when | Purpose |
|---|---|---|
ip default-gateway | IP routing is disabled | Where the switch sends its own traffic for other subnets (management replies) |
ip route 0.0.0.0 0.0.0.0 <next hop> (or a learned default) | IP routing is enabled | Gateway of last resort for routed traffic and the switch's own traffic |
A routing switch ignores ip default-gateway. So once routing is on, off-subnet reachability depends on the routing table: a routing switch with only connected routes forwards between its own subnets and nowhere else, whatever ip default-gateway says. Disabling routing would make the default gateway apply again, but would also stop all inter-VLAN forwarding.
Managing a Layer 2 switch
A switch that does not route is managed through an SVI in the management VLAN. It needs:
- the management VLAN carried to it (usually on the uplink trunk),
- an address in the management subnet on that VLAN's SVI, with
no shutdown(a physical switchport cannot hold an address), and ip default-gatewaypointing at the router address on the management subnet, so it can answer hosts in other subnets.
If management access works from inside the management subnet but not from elsewhere, look at the default gateway first: it is missing, or it points at an address that is not on any subnet the switch is connected to, which IOS cannot use.
How does LACP form an EtherChannel, and how do you read show etherchannel summary?
An EtherChannel (port-channel) bundles several physical links into one logical link: spanning tree sees one interface, so all members forward instead of all but one being blocked, and a member failure only reduces bandwidth. LACP (IEEE 802.3ad, now 802.1AX) is the standard protocol that negotiates the bundle; PAgP is Cisco's older proprietary one. The mode is set per member with channel-group <n> mode <mode>.
| Mode | Protocol | Behaviour | Bundles with |
|---|---|---|---|
active | LACP | Sends LACPDUs | active or passive |
passive | LACP | Only replies to LACPDUs | active only |
desirable | PAgP | Sends PAgP packets | desirable or auto |
auto | PAgP | Only replies | desirable only |
on | None | Bundles unconditionally, sends nothing | on only |
Failures follow from the table: passive on both ends never starts negotiation; desirable facing active means two different protocols that cannot recognise each other; on facing active leaves the active side waiting for LACPDUs that never come. The port-channel number is local to each switch and does not need to match the neighbour's.
show etherchannel summary gives two sets of flags:
| Flag | On | Meaning |
|---|---|---|
| S / R | Port-channel | Layer 2 bundle / Layer 3 (routed) bundle |
| U / D | Port-channel | In use / down |
| P | Member | Bundled in the port-channel |
| I | Member | Stand-alone: negotiation did not succeed |
| s | Member | Suspended: incompatible with the bundle |
| H | Member | Hot-standby: compatible, waiting for a free active slot |
So Po1(SD) with (I) members points to a negotiation problem, (s) to a parameter mismatch, and Po1(RU) with (P) members is a working routed bundle.
What must match on member ports, and how do you build a Layer 3 port-channel?
A port joins a bundle only if it is compatible with the other members on the same switch: same speed and duplex, same switchport mode (access, trunk or routed), and the same VLAN settings (access VLAN, or trunk allowed and native VLANs). A port that differs is suspended (flag s). A link that auto-negotiated 100 Mb/s instead of 1 Gb/s, usually a bad cable or a slower peer port, is suspended for the speed difference, which show interfaces status reveals. Descriptions, CDP settings and port numbering do not matter, and LACP port priorities are meant to differ when you rank ports.
The reliable way to keep members consistent is to configure trunk and VLAN settings on the port-channel interface (for example interface Port-channel1), which applies them to every member, including ones added later.
The consistency check is local. LACP does not exchange VLAN lists, so if two switches' port-channels allow different VLANs, the bundle still forms; each side applies its own allowed list, and a VLAN works only if both ends allow it.
Layer 3 EtherChannel
A Layer 3 port-channel is one routed interface over several links: one subnet, one routing adjacency, no spanning tree on the links, and no reconvergence when a member fails. Make the members routed ports first, bundle them, and put the address on the logical interface:
interface range GigabitEthernet1/0/1 - 2
no switchport
channel-group 1 mode active
interface Port-channel1
ip address 10.0.0.1 255.255.255.252
If the members are still switchports, the port-channel is created as a Layer 2 interface (flag S) and rejects an IP address; convert the port-channel and its members with no switchport. An address on the member ports does not create a routed bundle. Compared with the alternatives: two separate routed links need two subnets and two adjacencies and rely on routing to react to a failure; a Layer 2 bundle with an SVI keeps a VLAN and spanning tree on the link.
How does EtherChannel spread traffic, and how many links are active?
EtherChannel does not split a single flow across links. Each switch hashes header fields chosen by port-channel load-balance <method> (global) and sends every frame with the same hash down the same member, which avoids reordering. A single flow therefore never exceeds one member's speed, however many members the bundle has; it is the mix of many flows that shares the total.
The method must use fields that vary across the traffic:
- Traffic from one server to many remote clients through a gateway always has the same source MAC, source IP and destination MAC (the gateway), so only
dst-ip(or a combination including it) spreads it. - Traffic that a multilayer switch has routed has its Ethernet header rewritten: source MAC = the switch's SVI, destination MAC = the next hop. MAC-based methods then hash everything the same, and a method that includes the varying IPs, such as
src-dst-ip, is needed.
The method is a local, outbound decision. It is not negotiated by LACP and need not match between the two switches; each direction is simply spread by its sender's method.
Active links, hot-standby and min-links
An LACP port-channel can have up to sixteen compatible ports, but at most eight are active; the rest are hot-standby (flag H) and replace a failed active member. When more ports are offered than can be active, the switch with the better (lower) lacp system-priority decides which are active, using its own lacp port-priority values (lower is better) and then the lower port number. The other switch's port priorities are ignored.
| Command (on the port-channel) | Effect |
|---|---|
lacp max-bundle 4 | Ceiling: at most four active members; extra compatible ports are hot-standby |
port-channel min-links 4 | Floor: the port-channel goes down if fewer than four members are bundled, and comes back up automatically when enough return |
Combine them by counting: hot-standby ports are promoted first, and only if the number of bundled members then falls below min-links does the port-channel go down. For example, with eight links, max-bundle 6 and min-links 5, losing four active links promotes both standbys to give four bundled members, below the floor of five, so the port-channel goes down. It is an ordinary down state, not an err-disable, so traffic can fail over to another path and the bundle returns on its own.
Tip. Most questions in this topic are evidence-first troubleshooting: the stem shows a running configuration, a CDP log message or output from show interfaces switchport, show interfaces trunk, show ip interface brief, show interfaces vlan or show etherchannel summary, and asks for the cause, the operational result or the command that fixes it. Requirements stated in the stem matter, because several options can work in general while only one meets the stated design or operational constraint. Design items compare routed ports, trunks to router subinterfaces, transit VLANs and Layer 3 port-channels.
- no switchport makes a routed port: it takes an IP address, belongs to no VLAN and runs no spanning tree; show interfaces switchport reports Switchport: Disabled.
- A DTP trunk needs at least one end that asks (trunk or dynamic desirable); auto-auto never trunks, routers never send DTP, and nonegotiate needs a static trunk on the other end.
- switchport trunk allowed vlan with a bare list replaces the list; add, remove and except edit it, and except also covers VLANs created later.
- In show interfaces trunk, allowed-but-not-active means the VLAN is not created locally; active-but-not-forwarding means spanning tree blocks it (or it is pruned).
- The native VLAN is untagged, must match on both ends, and is still subject to the allowed list; a router receives it on a dot1Q native subinterface or the physical interface.
- An enabled SVI is up only while its VLAN exists and at least one port carrying it is up and forwarding; administratively down means shutdown.
- A multilayer switch routes IPv4 only with ip routing and IPv6 only with ipv6 unicast-routing; ip default-gateway is used only when routing is off.
- LACP active/passive (at least one active), PAgP desirable/auto, and on only with on; member ports must match locally, and LACP does not compare VLAN lists between switches.
- A Layer 3 port-channel needs routed members and the IP address on the Port-channel interface.
- EtherChannel hashes each flow onto one link; LACP allows eight active links, the lower system priority picks them, max-bundle caps and min-links sets a floor.
Frequently asked questions
Why do two new Cisco switches not form a trunk when cabled together?
On many Catalyst models a port's default mode is dynamic auto, which answers DTP requests but never sends one. With dynamic auto on both ends neither switch asks, so both ports operate as access ports and only their access VLAN (VLAN 1 by default) crosses. Configure switchport mode trunk on at least one end, and preferably on both with switchport nonegotiate.
What is the difference between switchport trunk allowed vlan 30 and switchport trunk allowed vlan add 30?
switchport trunk allowed vlan 30 replaces the trunk's whole allowed list with VLAN 30 only, so every other VLAN stops crossing the trunk. switchport trunk allowed vlan add 30 appends VLAN 30 and keeps the VLANs already allowed. remove subtracts VLANs from the current list, and except allows every VLAN apart from the ones named.
Does the native VLAN have to be the same on both ends of an 802.1Q trunk?
Yes. Native VLAN frames cross the trunk untagged, and each switch puts untagged frames into its own native VLAN, so a mismatch can deliver frames into the wrong VLAN; with PVST+ or Rapid PVST+ spanning tree usually blocks the mismatched VLANs on that port instead, which shows up as lost connectivity. CDP reports it with a NATIVE_VLAN_MISMATCH message that names the local interface and VLAN first and the neighbour second. The native VLAN must also be in the trunk's allowed list to be carried.
Why is my SVI up/down?
An SVI that is not shut down has its line protocol up only when its VLAN exists and is active in the local VLAN database and at least one Layer 2 port carrying that VLAN (an access port in it, or a trunk allowing it) is up and in spanning-tree forwarding. Check show vlan brief for the VLAN and access ports, and show interfaces trunk for trunks, because show vlan brief does not list trunk ports.
Do I need ip routing to use SVIs on a Catalyst switch?
Not for the SVI to come up or answer pings from its own VLAN, but a multilayer switch forwards IPv4 packets between its SVIs and routed ports only when ip routing is enabled; IPv6 needs ipv6 unicast-routing separately. A Layer 2 switch with routing off uses its SVI only for management and sends its own off-subnet traffic to the address set with ip default-gateway.
Which LACP modes form an EtherChannel?
LACP has two modes: active, which sends LACPDUs, and passive, which only replies. Active–active and active–passive form a bundle; passive–passive never does. Desirable and auto are PAgP modes and cannot pair with LACP, and mode on sends no negotiation at all, so it only bundles with another port in mode on.
Why does one large transfer not use all the links in an EtherChannel?
EtherChannel chooses a member link by hashing header fields such as MAC addresses, IP addresses or ports, and every frame of a flow produces the same hash, so a single flow always uses one link. Many flows spread across the bundle. Choose a port-channel load-balance method based on fields that vary in your traffic, such as destination IP for one server sending to many clients.
How do I put an IP address on an EtherChannel?
Build a Layer 3 port-channel: enter no switchport on the member ports, add them with channel-group (for LACP, mode active or passive), and configure the IP address on the Port-channel interface. If the members are switchports, the port-channel is created at Layer 2 and rejects the address until it and its members are converted with no switchport.
Source
This lesson covers the "Switching and Network Access" domain of the official CCNA exam guide. Vendors revise their guides — check the source for the current version.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.