spanning-tree port type edge
Configures a port as an edge port (PortFast) to immediately transition to forwarding state, bypassing STP listening and learning phases.
Overview
The 'spanning-tree port type edge' command on Cisco NX-OS (Nexus) configures a switch port as an edge port, also known as PortFast. This command is used to immediately transition a port from blocking to forwarding state, bypassing the listening and learning phases of Spanning Tree Protocol (STP). This is critical for ports connected to end devices such as workstations, servers, or IP phones that do not participate in STP. Without this command, a port would take 30 seconds (listening + learning) to become active, causing delays in network connectivity for end users. The concept behind edge ports is that they are at the edge of the network and should never receive Bridge Protocol Data Units (BPDUs). If a BPDU is received on an edge port, it indicates a potential misconfiguration or a loop, and BPDUGuard can be used to error-disable the port. On NX-OS, this command is part of the Rapid PVST+ or MST implementation. It is commonly used in data center leaf-spine architectures where host-facing ports should transition quickly. In troubleshooting workflows, verifying edge port configuration helps identify why a host is not getting immediate connectivity or why unexpected topology changes occur. The command can be applied per interface or globally with 'spanning-tree port type edge default'.
spanning-tree port type edge [default]When to Use This Command
- Connecting end hosts or servers that do not participate in spanning tree, to reduce convergence time.
- Configuring access ports for workstations to avoid delays during boot or link up.
- Enabling rapid transition on ports connected to single devices in a leaf-spine topology.
- Preventing unnecessary TCN generation when edge ports go up/down.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| default | default | When specified, the interface inherits the global edge port setting configured with 'spanning-tree port type edge default' command. If not specified, the port is explicitly set as an edge port regardless of global setting. |
Command Examples
Configure an interface as an edge port
interface ethernet 1/1
spanning-tree port type edgeNo output on success; the port is now an edge port and will transition to forwarding immediately.
Configure edge port with default keyword
interface ethernet 1/2
spanning-tree port type edge defaultSets the port to use the global edge port default setting (if enabled globally).
Understanding the Output
The command does not produce output upon successful configuration. To verify, use 'show spanning-tree interface ethernet 1/1'. Look for 'Port type: edge' in the output. A healthy edge port shows 'Port type: edge' and 'Port state: forwarding'. If the port type is 'network' or 'normal', the command may not have been applied correctly. If BPDUGuard is enabled and a BPDU is received, the port will go into errdisable state.
Configuration Scenarios
Configuring Edge Port on a Host-Facing Access Port
A Nexus switch connects to a server farm. Each server port should transition to forwarding immediately.
Topology
[Server] --- eth1/1 [Nexus]Steps
- 1.Enter interface configuration mode for the server port.
- 2.Apply the spanning-tree port type edge command.
- 3.Optionally enable BPDUGuard for protection.
interface ethernet 1/1 spanning-tree port type edge spanning-tree bpduguard enable
Verify: Use 'show spanning-tree interface ethernet 1/1' to confirm 'Port type: edge' and 'Bpdu guard: enabled'.
Watch out: If the server is actually a switch (e.g., a hypervisor with virtual switches), it may send BPDUs and trigger BPDUGuard, causing the port to go errdisable.
Troubleshooting with This Command
When troubleshooting connectivity issues on NX-OS, the 'spanning-tree port type edge' command is often used to diagnose slow host connectivity. If a host takes 30+ seconds to get an IP address, check if the port is configured as edge. Use 'show spanning-tree interface <interface>' to verify the port type. If the port type is 'normal' or 'network', the port is going through STP states. Additionally, if BPDUGuard is enabled and the port goes into errdisable state, check for BPDU reception with 'show interface <interface> | include BPDU'. Another common issue is that an edge port may receive a BPDU from a misconfigured device; the port will be error-disabled if BPDUGuard is on. To recover, use 'shutdown' followed by 'no shutdown' on the interface. Also, if the global 'spanning-tree port type edge default' is configured, all access ports become edge ports, which may cause loops if a switch is accidentally connected. Use 'show running-config | include spanning-tree' to verify global settings. In summary, edge port configuration is a first check for host connectivity delays and unexpected port shutdowns.
CCNA Exam Tips
Remember that edge ports should never receive BPDUs; enabling BPDUGuard is recommended.
On NX-OS, 'spanning-tree port type edge' is equivalent to Cisco IOS 'spanning-tree portfast'.
Edge ports do not participate in STP topology changes, reducing network instability.
Common Mistakes
Applying edge port on a trunk port connecting to another switch, causing loops.
Forgetting to enable BPDUGuard, risking accidental loop if a switch is connected.
Using 'spanning-tree port type edge default' globally without verifying port roles.
Platform Notes
On Cisco NX-OS (Nexus), the 'spanning-tree port type edge' command is equivalent to 'spanning-tree portfast' on Cisco IOS. However, NX-OS uses the 'port type' terminology to align with the IEEE 802.1D-2004 standard. On IOS, the command is 'spanning-tree portfast' and on IOS-XE, it is similar. On other platforms like Juniper JunOS, the equivalent is 'edge' under 'spanning-tree' interface configuration. On Arista EOS, it is 'spanning-tree portfast'. NX-OS also supports 'spanning-tree port type edge default' to apply globally, which is similar to 'spanning-tree portfast default' on IOS. Note that on NX-OS, the 'spanning-tree port type edge' command is available in both interface and VLAN configuration modes, but the interface mode is most common. Version differences: In older NX-OS releases, the command was 'spanning-tree portfast'; it was changed to 'spanning-tree port type edge' in later versions for consistency with standards. Always check the specific NX-OS version documentation.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions