STP l2
STP l2
Published
2023-12-14
ii
Juniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper Networks, Inc.
in the United States and other countries. All other trademarks, service marks, registered marks, or registered service
marks are the property of their respective owners.
Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right
to change, modify, transfer, or otherwise revise this publication without notice.
The information in this document is current as of the date on the title page.
Juniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-related
limitations through the year 2038. However, the NTP application is known to have some difficulty in the year 2036.
The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use
with) Juniper Networks software. Use of such software is subject to the terms and conditions of the End User License
Agreement ("EULA") posted at https://support.juniper.net/support/eula/. By downloading, installing or using such
software, you agree to the terms and conditions of that EULA.
iii
Table of Contents
About This Guide | viii
1 Overview
Spanning-Tree Protocol Overview | 2
Understanding STP | 23
Configuring STP | 24
Configuring RSTP | 26
Understanding RSTP | 26
Example: Configuring Faster Convergence and Network Stability on ELS Devices with RSTP | 32
Requirements | 32
Verification | 55
Example: Faster Convergence and Improved Network Stability with RSTP on EX Series
Switches | 59
Requirements | 59
Verification | 82
Configuring MSTP | 87
Understanding MSTP | 87
Configuring MSTP | 91
Requirements | 97
Verification | 120
Requirements | 136
Overview | 137
Configuration | 138
v
Verification | 150
Configuring Interface for BPDU Protection With Port Shutdown Mode | 160
Configuring Interface for BPDU Protection With BPDU Drop Mode | 163
Requirements | 170
Configuration | 173
Eliminating Bridge Loops in Ethernet LANs with Spanning Tree Protocol | 179
Example: Configuring Loop Protection to Prevent Interfaces from Transitioning from Blocking to
Forwarding in a Spanning Tree on non-ELS EX Series Switches | 189
Requirements | 189
Configuration | 192
Verification | 193
vi
Example: Configuring Loop Protection to Prevent Interfaces from Transitioning from Blocking to
Forwarding in a Spanning Tree on EX Series Switches With ELS | 195
Requirements | 196
Configuration | 198
Verification | 199
Understanding Bridge Priority for Election of Root Bridge and Designated Bridge | 208
Configuring VPLS Root Protection Topology Change Actions to Control Individual VLAN
Spanning-Tree Behavior | 211
Example: Configuring Root Protection to Enforce Root Bridge Placement in Spanning Trees on
non-ELS EX Series Switches | 213
Requirements | 213
Configuration | 216
Verification | 217
Example: Configuring Root Protection to Enforce Root Bridge Placement in Spanning Trees on
EX Series Switches With ELS | 220
Requirements | 220
Configuration | 223
Verification | 224
Unblocking a Switch Interface That Receives BPDUs in Error (CLI Procedure) | 236
Unblocking an Interface on non-ELS EX Series Switches That Receives BPDUs in Error (CLI
Procedure) | 237
Checking for a MAC Rewrite Error Condition Blocking a Spanning-Tree Instance Interface | 238
Clearing a MAC Rewrite Error Condition Blocking a Spanning-Tree Instance Interface | 239
Clearing a MAC Rewrite Error on an Interface with Layer 2 Protocol Tunneling | 239
Spanning-tree protocols on routers and switches address provide link redundancy while simultaneously
preventing undesirable loops.
1 CHAPTER
Overview
IN THIS SECTION
IN THIS SECTION
Ethernet networks are susceptible to broadcast storms if loops are introduced. However, an Ethernet
network needs to include loops because they provide redundant paths in case of a link failure. Spanning-
tree protocols address both of these issues because they provide link redundancy while simultaneously
preventing undesirable loops.
Juniper Networks devices provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree Protocol (RSTP), Multiple Spanning Tree Protocol (MSTP), and VLAN Spanning Tree
Protocol (VSTP). RSTP is the default spanning-tree protocol for preventing loops on Ethernet networks.
• Connects to devices that are not STP-capable, such as PCs, servers, routers, or hubs that are not
connected to other switches, by using edge ports
Spanning-tree protocols intelligently avoid loops in a network by creating a tree topology (spanning tree)
of the entire bridged network with only one available path between the tree root and a leaf. All other
paths are forced into a standby state. The tree root is a switch within the network elected by the STA
(spanning-tree algorithm) to use when computing the best path between bridges throughout the
network and the root bridge. Frames travel through the network to their destination–a leaf such as an
end-user PC–along branches. A tree branch is a network segment, or link, between bridges. Switches
that forward frames through an STP spanning tree are called designated bridges.
NOTE: If you are using Junos OS for EX Series and QFX Series switches with support for the
Enhanced Layer 2 Software (ELS) configuration style, you can force the original IEEE 802.1D
Spanning Tree Protocol (STP) version to run in place of RSTP or VSTP by setting force-version.
Each port has both a role and a state. A port’s role determines how it participates in the spanning tree.
The five port roles used in RSTP are:
• Root port—The port closest to the root bridge (has the lowest path cost from a bridge). This is the
only port that receives frames from and forwards frames to the root bridge.
• Designated port—The port that forwards traffic away from the root bridge toward a leaf. A
designated bridge has one designated port for every link connection it serves. A root bridge forwards
frames from all of its ports, which serve as designated ports.
• Alternate port—A port that provides an alternate path toward the root bridge if the root port fails
and is placed in the discarding state. This port is not part of the active spanning tree, but if the root
port fails, the alternate port immediately takes over.
• Backup port—A port that provides a backup path toward the leaves of the spanning tree if a
designated port fails and is placed in the discarding state. A backup port can exist only where two or
4
more bridge ports connect to the same LAN for which the bridge serves as the designated bridge. A
backup port for a designated port immediately takes over if the port fails.
Each port has both a state and a role. A port’s state determines how it processes a frame. RSTP places
each port of a designated bridge in one of three states:
• Discarding—The port discards all BPDUs. A port in this state discards all frames it receives and does
not learn MAC addresses.
• Learning—The port prepares to forward traffic by examining received frames for location information
in order to build its MAC address table.
• Forwarding—The port filters and forwards frames. A port in the forwarding state is part of the active
spanning tree.
Spanning Tree also defines the concept of an edge port, which is a designated port that connects to
devices that are not STP-capable, such as PCs, servers, routers, or hubs that are not connected to other
switches. Because edge ports connect directly to end stations, they cannot create network loops and
can transition to the forwarding state immediately. You can manually configure edge ports, and a switch
can also detect edge ports by noting the absence of communication from the end stations.
The edge ports themselves do send BPDUs to the spanning tree. If you have a good understanding of
the implications on your network and want to modify RSTP on the edge port interface.
Spanning-tree protocols use frames called bridge protocol data units (BPDUs) to create and maintain the
spanning tree. A BPDU frame is a message sent from one switch to another to communicate information
about itself, such as its bridge ID, root path costs, and port MAC addresses. The initial exchange of
BPDUs between switches determines the root bridge. Simultaneously, BPDUs are used to communicate
the cost of each link between branch devices, which is based upon port speed or user configuration.
RSTP uses this path cost to determine the ideal route for data frames to travel from one leaf to another
leaf and then blocks all other routes. If an edge port receives a BPDU, it automatically transitions to a
regular RSTP port.
When the network is in a steady state, the spanning tree converges when the spanning-tree algorithm
(STA) identifies both the root and designated bridges and all ports are in either a forwarding or blocking
state. To maintain the tree, the root bridge continues to send BPDUs at a hello time interval (default 2
5
seconds). These BPDUs continue to communicate the current tree topology. When a port receives a
hello BPDU, it compares the information to that already stored for the receiving port. One of three
actions takes place when a switch receives a BPDU:
• If the BPDU data matches the existing entry in the MAC address table, the port resets a timer called
max age to zero and then forwards a new BPDU with the current active topology information to the
next port in the spanning tree.
• If the topology in the BPDU has been changed, the information is updated in the MAC address table,
max age is again set to zero, and a new BPDU is forwarded with the current active topology
information to the next port in the spanning tree.
• When a port does not receive a BPDU for three hello times, it reacts one of two ways. If the port is
the root port, a complete rework of the spanning tree occurs—see When an RSTP Root Bridge Fails.
If the bridge is any non-root bridge, RSTP detects that the connected device cannot send BPDUs and
converts that port to an edge port.
When a link to the root port goes down, a flag called a topology change notification (TCN) is added to
the BPDU. When this BPDU reaches the next port in the VLAN, the MAC address table is flushed and
the BPDU is sent to the next bridge. Eventually, all ports in the VLAN have flushed their MAC address
tables. Then, RSTP configures a new root port.
After a root port or a designated port fails, the alternate or backup port takes over after an exchange of
BPDUs called the proposal-agreement handshake. RSTP propagates this handshake over point-to-point
links, which are dedicated links between two network nodes, or switches, that connect one port to
another. If a local port becomes a new root or designated port, it negotiates a rapid transition with the
receiving port on the nearest neighboring switch by using the proposal-agreement handshake to ensure
a loop-free topology.
Because a link failure causes all associated ports to flush their MAC address table, the network might be
slower as it floods to relearn the MAC addresses. There is a way to speed up this relearning process.
During TCN propagation, the Layer 2 forwarding table of switches is flushed, resulting in a flood of data
packets. The Address Resolution Protocol (ARP) feature causes the switch to proactively send ARP
requests for IP addresses in the ARP cache (present because of Layer 3 VLAN interface). With ARP on
STP enabled, as the reply comes through, the switches builds up the Layer 2 forwarding table, thus
limiting the flooding later. Enabling ARP on STP is most useful to prevent excessive flooding in large
Layer 2 networks using RVIs.
6
NOTE: The ARP feature is not available on Junos OS for EX Series switches with support for the
Enhanced Layer 2 Software (ELS) configuration style.
SEE ALSO
Understanding STP | 23
Understanding MSTP | 87
Understanding RSTP | 26
Example: Faster Convergence and Improved Network Stability with RSTP on EX Series Switches |
59
Example: Configuring Faster Convergence and Network Stability on ELS Devices with RSTP | 32
Configuring RSTP on Devices That Support Enhanced Layer 2 Software (ELS) | 31
IN THIS SECTION
Table 1 on page 7 describes differences between spanning-tree protocols STP, RSTP, MSTP and VSTP.
7
RSTP • Rapid Spanning Tree Protocol is the default switch • STP and RSTP are limited
configuration and is recommended for most network to a single instance on
configurations because it converges more quickly than STP any physical interface.
after a failure. Use the set rstp
interface statement to
• Voice and video work better with RSTP than they do with configure interfaces
STP.
participating in the RSTP
instance.
• RSTP is backward compatible with STP; therefore, switches
do not all have to run RSTP.
• RSTP does not work with
802.1D 1998 bridges.
• RSTP supports more ports than MSTP or VSTP.
Use STP instead—see
• On MX and ACX routers, you can configure RSTP, MSTP, and "Forcing RSTP or VSTP
VSTP instance interfaces as edge ports. to Run as IEEE 802.1D
STP (CLI Procedure)" on
page 86
TIP: Use the set rstp interface configuration statement to indicate which logical interfaces participate in RSTP.
See
.
TIP: If RSTP has been forced to run as the original STP version, you can revert back to RSTP by "Reverting to
RSTP or VSTP from Forced IEEE 802.1D STP" on page 153.
8
STP • Spanning Tree Protocol works with 802.1D 1998 bridges. • STP and RSTP are limited
to a single instance on
• RSTP is backward compatible with STP; therefore, you can any physical interface.
run RSTP on some switches and STP on others with 802.1D Use the set stp
1998 bridges. interface statement to
configure interfaces
participating in the RSTP
instance.
TIP: Use the set stp interface statement to configure interfaces to participate in the STP instance. See
"Configuring STP on EX Series Switches (CLI Procedure)" on page 24.
MSTP • Multiple Spanning Tree Protocol works with most VLANs. • Some protocols require
compatibility not
• MSTP supports multiple instances on a single physical provided by MSTP. In this
interface. case, use VSTP.
• On MX and ACX routers, you can configure RSTP, MSTP, and • MSTP supports a limited
VSTP instance interfaces as edge ports. number of ports. An
MSTP region supports up
to 64 MSTIs with each
instance supporting from
1 through 4094 VLANs
TIP: Use the set mstp interface configuration statement to indicate which logical interfaces participate in MSTP.
See "Configuring MSTP on Switches" on page 91.
10
VSTP • VSTP works with VLANs that require device compatibility. • With VSTP, there can be
Enable VSTP on all VLANs that could receive VSTP bridge only one STP instance
protocol data units (BPDUs). per VLAN, where MSTP
lets you combine
• VSTP and RSTP are the only spanning-tree protocols that can multiple VLANs in one
be configured concurrently on a switch. instance.
• For VSTP, interfaces can be configured at the global level or at • VSTP supports a limited
the VLAN level. Interfaces configured at the global VSTP level number of ports
will be enabled for all the configured VLANs. If an interface is compared to RSTP.
configured at both the global and VLAN levels, the
configuration at the VLAN level overrides the global • You can configure VSTP
configuration. for a maximum of 509
VLANs. However, having
• On MX and ACX routers, you can configure RSTP, MSTP, and a large number of VSTP
VSTP instance interfaces as edge ports. and RSTP instances can
cause continuous
changes in the topology.
As a performance
workaround, reduce the
number of VSTP
instances to fewer than
190.
TIP: When using VSTP, we recommend that you enable VSTP on all VLANs that can receive VSTP bridge protocol
data units (BPDUs).
TIP: When you configure VSTP with the set protocol vstp vlan all command, VLAN ID 1 is not set; it is excluded
so that the configuration is compatible with Cisco PVST+. If you want VLAN ID 1 to be included in the VSTP
configuration on your switch, you must set it separately with the set protocol vstp vlan 1 command. For more
information, see Knowledge Base articles KB15138 and KB18291 at https://kb.juniper.net/InfoCenter/index
TIP: The maximum number of VLANs supported by VSTP on a switch depends upon whether you are using Junos
OS for EX Series and QFX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration
style or Junos OS that does not support ELS.
You can use Juniper Networks switches with VSTP and Cisco switches with PVST+ and Rapid-PVST+ in the same
network. Cisco supports a proprietary Per-VLAN Spanning Tree (PVST) protocol, which maintains a separate
spanning tree instance per each VLAN. One Spanning Tree per VLAN allows fine grain load balancing but requires
more BPDU CPU processing as the number of VLANs increases. PVST runs on Cisco proprietary ISL trunks which
is not supported by Juniper. Juniper switches only inter-operate with PVST+ and Rapid-PVST+.
TIP: Spanning-tree protocols all generate their own BPDUs. User bridge applications running on
a PC can also generate BPDUs. If these BPDUs are picked up by STP applications running on the
switch, they can trigger STP miscalculations, and those miscalculations can lead to network
outages. See Configuring BPDU Protection on Spanning Tree Interfaces.
12
NOTE: If you are configuring an interface for any spanning tree protocol (STP, MSTP, RSTP, and
VSTP), the interface all, vlan all, and vlan-group options are not available when you configure an
interface with the flexible-vlan-tagging family option.
Not all switches and routers support the exact same features and configurations. Known differences are
listed in Table 2 on page 12.
MX Series Routers Only MX Series routers can use the virtual-switch routing instance type
to isolate a LAN segment with its spanning-tree instance and to
separate its VLAN ID space. See "Configuring a Virtual Switch Routing
Instance on MX Series Routers" on page 20
Tracing and global tracing are available on ACX and MX routers with the
global traceoptions statement—see "Understanding Spanning-Tree
Protocol Trace Options" on page 233.
On MX and ACX routers, you can configure RSTP, MSTP, and VSTP
instance interfaces as edge ports for faster convergence than the
original STP version. Edge ports transition directly to the forwarding
state, and so the protocol does not need to wait for BPDUs to be
received on edge ports.
TIP: For 802.1ad provider bridge networks (stacked VLANs) on MX Series and M Series routers, single-tagged
access ports and double-tagged trunk ports can co-exist in a single spanning tree context. In this mode, the VLAN
Spanning Tree Protocol (VSTP) can send and receive untagged Rapid Spanning Tree Protocol (RSTP) bridge
protocol data units (BPDUs) on Gigabit Ethernet (ge), 10 -Gigabit Ethernet (xe), and aggregated Ethernet (ae)
interfaces. The untagged RSTP BPDUs interoperate with tagged VSTP BPDUs sent over the double-tagged trunk
ports. Double-tagging can be useful for Internet service providers, allowing them to use VLANs internally while
mixing traffic from clients that are already VLAN-tagged.
ACX Series Routers On MX and ACX routers, you can configure RSTP, MSTP, and VSTP
instance interfaces as edge ports for faster convergence than the
original STP version. Edge ports transition directly to the forwarding
state, and so the protocol does not need to wait for BPDUs to be
received on edge ports.
Tracing and global tracing are available on ACX and MX routers with the
global traceoptions statement—see "Understanding Spanning-Tree
Protocol Trace Options" on page 233.
14
If your network includes IEEE 802.1D 1998 bridges, remove RSTP and
explicitly configure STP—see "Forcing RSTP or VSTP to Run as IEEE
802.1D STP (CLI Procedure)" on page 86. When you explicitly
configure STP, the QFX Series products use the IEEE 802.1D 2004
specification, force version 0. This configuration runs a version of RSTP
that is compatible with the classic, basic STP. If you use virtual LANs
(VLANs), you can enable VSTP on your network.
• IEEE 802.1d
• 802.1w RSTP
• 802.1s MSTP
Use Rapid Spanning Tree Protocol (RSTP) on the network side of the
QFX Series to provide quicker convergence time than the base
Spanning Tree Protocol (STP) does. RSTP identifies certain links as point
to point. When a point-to-point link fails, the alternate link can
transition to the forwarding state, which speeds up convergence.
EX Series Switches • There are two versions of EX Series switches. Be sure to use the
correct commands for each version. Some EX switches run the
Juniper Networks Junos operating system (Junos OS) that supports
the Enhanced Layer 2 Software (ELS) configuration (for example,
EX4300, EX2300, EX3400 and EX4600 support ELS) and some do
not support the ELS configuration.
TIP: EX Series switches can have a maximum of 253 VLANs on VSTP. Therefore, to have as many spanning-tree
protocol VLANs as possible, use both VSTP and RSTP. RSTP will then be applied to VLANs that exceed the limit
for VSTP. Because RSTP is enabled by default, you just need to additionally enable VSTP.
QFabric Although there is no need to run STP in a QFabric system, you can
connect a QFabric system to another Layer 2 device and use STP. STP
traffic can only be processed on network Node groups. Other Node
groups, such redundant server Node groups and server Node groups,
discard the STP bridge protocol data units (BPDUs) traffic and disable
the interface automatically. Server Node groups only process host-
facing protocols, whereas Network Node groups process all supported
protocols.
SRX Series Firewalls • Provide Layer 2 loop prevention through STP, RSTP, or MSTP only.
VSTP is not supported on the SRX platform.
• There are two versions of SRX Series Firewalls. Be sure to use the
correct commands for each version. Some SRX Series Firewalls run
the Juniper Networks Junos operating system (Junos OS) that
supports the Enhanced Layer 2 Software (ELS) configuration and
some do not support the ELS configuration.
IN THIS SECTION
IN THIS SECTION
An instance is analogous to one computer process. The 802.1Q standard defines one unique Spanning-
Tree instance to be used by all VLANs in the network. STP runs on the Native VLAN so that it can
communicate with both 802.1Q and non-802.1Q compatible switches. This single instance of STP is
also referred to as 802.1Q Mono Spanning Tree or Common Spanning Tree (CST).
The interface mode allows RSTP, MSTP, and VSTP to converge faster than the original STP on point-to-
point links. The protocol does not need to wait for timers on point-to-point links. Configure interfaces
that have a point-to-point link to another Layer 2 bridge as p2p. This parameter is ignored if the STP is
configured to run the original spanning-tree version.
If the interface (Spanning Tree) mode is configured at both the VSTP global and VLAN levels, the
configuration at the VLAN level overrides the global configuration.
19
STP and RSTP are limited to a single instance on any physical interface. Use the interface (Spanning Tree)
statement to configure interfaces to participate in the STP or RSTP instance.
MSTP supports multiple instances on a single physical interface. Again, use the interface (Spanning Tree)
statement to configure which logical interfaces participate in MSTP.
For VSTP, interfaces can be configured at the global level or at the VLAN level. Interfaces configured at
the global VSTP level will be enabled for all the configured VLANs. If an interface is configured at both
the global and VLAN levels, the configuration at the VLAN level overrides the global configuration.
The reason that instances must have priorities is because a root port for a spanning tree is the interface
on the nonroot bridge with the lowest path cost to the root bridge. When multiple interfaces have the
same path cost to the root bridge, the interface with the lowest interface priority is selected as the root
port.
If the interface priority is not configured and multiple interfaces have the same path cost to the root
bridge, the interface with the lowest interface identifier is selected as the root port.
If the interface priority is configured under the MSTP protocol, this becomes the default value for all
interfaces. If the interface priority is configured under the MSTI interface, the value overrides the
default for that interface.
If the interface priority is configured at both the VSTP global and VLAN levels, the configuration at the
VLAN level overrides the global configuration.
The path cost used to calculate the root path cost from any given LAN segment is determined by the
total cost of each link in the path. By default, the link cost is determined by the speed of the link. The
interface cost can be configured to override the default cost and control which bridge is the designated
bridge and which port is the designated port. In MSTP the CIST external path cost is determined by the
link speed and the number of hops.
If the interface cost is not configured, the cost is determined by the speed of the interface. For example,
a 100-Mbps link has a default path cost of 19, a 1000-Mbps link has a default path cost of 4, and a 10-
Gbps link has a default path cost of 2.
If the interface cost is configured under MSTP, this becomes the default value for all interfaces. If the
interface cost is configured under the MSTI interface, the value overrides the default for that interface.
20
If the interface cost is configured at both the VSTP global and VLAN levels, the configuration at the
VLAN level overrides the global configuration.
TIP: The interface cost should be set the same for all interfaces connected to the same LAN
segment.
On MX Series routers only, use the virtual-switch routing instance type to isolate a LAN segment with its
spanning-tree instance and to separate its VLAN ID space. A bridge domain consists of a set of ports
that share the same flooding or broadcast characteristics. Each virtual switch represents a Layer 2
network. You can optionally configure a virtual switch to support Integrated Routing and Bridging (IRB),
which facilitates simultaneous Layer 2 bridging and Layer 3 IP routing on the same interface. You can
also configure Layer 2 control protocols to provide loop resolution. Protocols supported include the
Spanning-Tree Protocol (STP), Rapid Spanning-Tree Protocols (RSTP), Multiple Spanning-Tree Protocol
(MSTP), and VLAN Spanning-Tree Protocol (VSTP).
To create a routing instance for a virtual switch, include at least the following statements in the
configuration:
[edit]
routing-instances {
routing-instance-name
instance-type virtual-switch;
bridge-domains {
bridge-domain-name {
domain-type bridge;
interface interface-name;
vlan-id (all | none | number);
vlan-tags outer number inner number;
}
}
protocols {
(rstp | mstp | vstp) {
...stp-configuration ...
}
}
21
}
}
For more information about configuring virtual switches, see Configuring a Layer 2 Virtual Switch .
RSTP, MSTP, and VSTP instance interfaces configured as edge ports enable the protocol to converge
faster than the original IEEE 802.1D STP version. Edge ports transition directly to the forwarding state,
and so the protocol does not need to wait for BPDUs to be received on edge ports.
The Junos OS supports automatic detection of edge ports as described in the RSTP standard. Layer 2
bridges do not expect to receive BPDUs for edge ports. If a BPDU is received for an edge port, the port
becomes a non-edge port.
Keep the following guidelines in mind when configuring spanning-tree instance interfaces as edge ports:
• Do not configure a spanning-tree instance interface as an edge port if it is connected to any Layer 2
bridge. An instance interface connected to Layer 2 bridges but configured as an edge port can cause
physical loops.
• if the spanning-tree protocol is configured to run the original IEEE 802.1D spanning-tree version, the
edge-port option (if configured) is ignored.
• If edge ports are configured at both the VSTP global and VLAN levels, the configuration at the VLAN
level overrides the global configuration.
SEE ALSO
Configuring STP | 23
Configuring RSTP | 26
Configuring MSTP | 87
Configuring STP
IN THIS SECTION
Understanding STP | 23
Configuring STP | 24
Understanding STP
IN THIS SECTION
Spanning Tree Protocol (STP), defined in IEEE 802.1D, creates a tree of links in the Ethernet switched
network. Links that cause loops in the network are disabled, thereby providing a single active link
between any two devices.
• Some legacy networks require the slower convergence times of basic STP.
• You can run RSTP on some switches and STP on others with 802.1D 1998 bridges. They are
compatible.
24
Devices configured to use STP run RSTP force version 0, which is compatible with STP. If you are using
Junos OS for devices that support ELS configuration style, you can force the original IEEE 802.1D
Spanning Tree Protocol (STP) version to run in place of RSTP or VSTP by setting force-version.
You can use the operational mode commands show spanning-tree statistics message-queues, show
spanning-tree stp-buffer see-all, show spanning-tree statistics bridge, and show spanning-tree statistics
interface to get the information from ring-buffer, bridge, and port statistics. clear spanning-tree stp-
buffer clears the stp-buffer, and clear spanning-tree statistics bridge clears the statistics of the bridge.
SEE ALSO
Spanning tree protocols work by creating bridges. A root bridge (switch) is a bridge at the top of a
Spanning Tree. Ethernet connections branch out from the root switch, connecting to other switches in
the Local Area Network (LAN). An extended system identifier is assigned to bridges in STP or RSTP
routing instances—see extended-system-id.
When you configure STP or RSTP, you specify the extended system identifier.
Configuring STP
The default spanning-tree protocol for devices that support Enhanced Layer 2 Software (ELS) is Rapid
Spanning Tree Protocol (RSTP). RSTP provides faster convergence times than the original Spanning Tree
Protocol (STP). However, some legacy networks require the slower convergence times of basic STP that
work with 802.1D 1998 bridges.
If your network includes 802.1D 1998 bridges, you can remove RSTP and explicitly configure STP. When
you explicitly configure STP, the switches use the IEEE 802.1D 2004 specification, force version 0. This
configuration runs a version of RSTP that is compatible with the classic, basic STP.
To configure STP:
25
1. Either delete RSTP on the entire switch or disable RSTP on specific interfaces:
[edit protocols]
user@switch# delete rstp
[edit protocols]
user@switch# set rstp interface interface-name disable
[edit protocols]
user@switch# set stp interface all
[edit protocols]
user@switch# set stp interface interface-name
3. (Optional) Only if a routed VLAN interface (RVI) is configured, enable the Address Resolution
Protocol (ARP) for faster MAC address recovery:
[edit protocols]
user@switch# set stp interface all arp-on-stp
[edit protocols]
user@switch# set stp interface interface-name arp-on-stp
26
RELATED DOCUMENTATION
Configuring RSTP
IN THIS SECTION
Understanding RSTP | 26
Example: Configuring Faster Convergence and Network Stability on ELS Devices with RSTP | 32
Example: Faster Convergence and Improved Network Stability with RSTP on EX Series Switches | 59
Understanding RSTP
IN THIS SECTION
Juniper Networks products use Rapid Spanning Tree Protocol (RSTP) on the network side of devices by
default to provide quicker convergence time than the base Spanning Tree Protocol (STP) does. RSTP
identifies certain links as point to point. When a point-to-point link fails, the alternate link can transition
to the forwarding state, which speeds up convergence.
• Voice and video work better with RSTP than they do with STP.
• RSTP is backward compatible with STP; therefore, switches do not all have to run RSTP.
• On MX Series and ACX Series routers, you can configure RSTP, MSTP, and VSTP instance interfaces
as edge ports.
RSTP evolved from the original STP IEEE 802.1D protocol to provide faster spanning-tree
reconvergence after a switch port, switch, or LAN failure. Where STP took up to 50 seconds to respond
to topology changes, RSTP responds to changes within the timeframe of three hello BPDUs (bridge
protocol data units), or 6 seconds. This is the primary reason that RSTP is the default spanning-tree
configuration.
TIP: EX Series switches configured to use STP run RSTP force version 0, which is compatible
with STP.
You can configure Rapid Spanning Tree Protocol (RSTP) under the following hierarchy levels:
• [edit protocols]
[edit]
user@host@ edit ... protocols (STP Type) rstp
2. (Optional) For compatibility with older bridges that do not support RSTP, you can force RSTP to run
as the original IEEE 802.1D Spanning Tree Protocol (STP) version:
NOTE: If RSTP has been forced to run as the original STP version, you can revert back to
RSTP by first removing the force-version statement from the configuration and then entering
the clear spanning-tree protocol-migration configuration mode command.
4. (Optional) Specify the extended system identifier used in identifiers bridges that participate in RSTP:
c. (Optional) By default, the interface link cost is determined by the link speed. You can configure
the interface link cost to control which bridge is the designated bridge and which port is the
designated port:
Specify p2p if the link is point to point. Specify shared if the link is a shared media.
Edge ports do not expect to receive bridge protocol data unit (BPDU) packets. If a BPDU packet is
received for an edge port, the port becomes a non-edge port
You can also enable BPDU root protection for all spanning-tree protocol instances on the interface.
BPDU root protect ensures the port is the spanning-tree designated port. If the port receives
superior BPDU packets, root protect moves this port to a root-prevented spanning-tree state. For
configuration details, see "Checking the Status of Spanning-Tree Instance Interfaces" on page 232.
6. Configure the bridge priority:
For more information, see "Understanding Bridge Priority for Election of Root Bridge and Designated
Bridge" on page 208.
7. Configure hello BPDU timers.
b. Configure the time interval at which the root bridge transmits configuration BPDUs:
8. (Optional) By default, the bridge port remains in the listening and learning states for 15 seconds
before transitioning to the forwarding state. You can specify a delay from 4 through 20 seconds
instead:
[edit]
... { # Optional logical system and/or routing instance
protocols (STP Type) {
rstp {
force-version stp; # Optional.
bpdu-destination-mac-address provider-bridge-group; # Optional
extended-system-id identifier; # Optional.
interface interface-name {
priority interface-priority;
cost interface-link-cost; # Optional.
mode (p2p | shared);
edge; # Optional.
}
bridge-priority bridge-priority;
max-age seconds;
hello-time seconds;
forward-delay seconds; # Optional.
}
}
}
31
The default spanning-tree protocol on devices that support ELS is Rapid Spanning Tree Protocol (RSTP).
RSTP provides faster convergence times than the original Spanning Tree Protocol (STP).You can
configure VSTP and RSTP on a device at the same time. If you have configured MSTP on your device,
you cannot configure RSTP on the device. You need to use this procedure only if another spanning-tree
protocol is configured on your device.
To enable RSTP:
• To disable MSTP:
[edit protocols]
user@switch# set mstp disable
2. Configure RSTP
[edit protocols]
user@switch# set rstp interface interface-name
[edit protocols]
user@switch# set rstp interface interface-name disable
[edit protocols]
user@switch# set rstp interface interface-range-name
[edit protocols]
user@switch# set rstp interface all
32
IN THIS SECTION
Requirements | 32
Verification | 55
NOTE: This example uses Junos OS for EX Series switches with support for the Enhanced Layer
2 Software (ELS) configuration style. If your switch runs software that does not support ELS, see
"Example: Faster Convergence and Improved Network Stability with RSTP on EX Series
Switches" on page 59. For ELS details, see Using the Enhanced Layer 2 Software CLI.
EX Series switches use Rapid Spanning Tree Protocol (RSTP) by default to provide a loop-free topology.
When switches that support redundant Routing Engines use RSTP, it is important to keep RSTP
synchronized on both Routing Engines so that no loss of service occurs after a Routing Engine
switchover. Nonstop bridging protocol keeps Routing Engines synchronized.
This example describes how to configure RSTP and NSB on four EX Series switches:
Requirements
This example uses the following software and hardware components:
Before you configure the switches for RSTP, be sure you have:
• Installed and connected the four switches. See the hardware documentation for your switch.
33
• Performed the initial software configuration on all switches. See Connecting and Configuring an EX
Series Switch (CLI Procedure).
IN THIS SECTION
Topology | 36
RSTP works by identifying certain links as point to point links and blocking other possible paths. When
one of the point-to-point links fails, a designated alternate link transitions to the forwarding state and
take over. Configuring nonstop bridging (NSB) on a switch with redundant Routing Engines keeps RSTP
synchronized on both Routing Engines. This way, RSTP remains active immediately after a switchover
because it is already synchronized to the backup Routing Engine. RSTP does not have to reconverge
after a Routing Engine switchover when NSB is enabled because the neighbor devices do not detect an
RSTP change on the switch. In this example, four EX Series switches are connected in the topology
displayed in Figure 1 on page 34 to create a loop-free topology with NSB applied to switches with dual
Routing Engines.
34
Table 3 on page 35 shows the components of the topology for this example.
NOTE: You can configure RSTP only on physical interfaces, not on logical interfaces.
35
Property Settings
This configuration example creates a loop-free topology between four EX Series switches using RSTP.
• The root port is responsible for forwarding data to the root bridge.
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
36
• The designated port forwards data to the downstream network segment or device.
• The backup port is a backup port for the designated port. When a designated port goes down, the
backup port becomes the active designated port and starts forwarding data.
NOTE: You also can create a loop-free topology between the aggregation layer and the
distribution layer using redundant trunk links. For more information about configuring redundant
trunk links, see Example: Configuring Redundant Trunk Links for Faster Recovery on Devices with
ELS Support.
Topology
IN THIS SECTION
Procedure | 36
Procedure
To quickly configure RSTP and nonstop bridging on Switch 1, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/13 unit 0 family ethernet-switching vlan members
[10 20 30 40]
37
If Switch 1 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 1, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch1# set voice-vlan description “Voice VLAN”
user@switch1# set voice-vlan vlan-id 10
user@switch1# set employee-vlan description “Employee VLAN”
user@switch1# set employee-vlan vlan-id 20
user@switch1# set guest-vlan description “Guest VLAN”
user@switch1# set guest-vlan vlan-id 30
user@switch1# set camera-vlan description “Camera VLAN”
38
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch1# set ge-0/0/13 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch1# set ge-0/0/9 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch1# set ge-0/0/11 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch1# set ge-0/0/13 unit 0 family ethernet-switching interface-mode trunk
user@switch1# set ge-0/0/9 unit 0 family ethernet-switching interface-mode trunk
user@switch1# set ge-0/0/11 unit 0 family ethernet-switching interface-mode
trunk
[edit protocols]
Step-by-Step Procedure
If Switch 1 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 1:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch1# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
}
}
}
}
ge-0/0/11 {
unit 0 {
family ethernet-switching {
interface-mode trunk;
vlan {
members [10 20 30 40];
}
}
}
}
}
protocols {
layer2-control {
nonstop-bridging;
}
rstp {
bridge-priority 16k;
interface ge-0/0/13 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/9 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/11 {
cost 1000;
mode point-to-point;
}
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
41
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
system {
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
IN THIS SECTION
Procedure | 41
Procedure
To quickly configure RSTP and nonstop bridging on Switch 2, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/14 unit 0 family ethernet-switching vlan members
42
[10 20 30 40]
set interfaces ge-0/0/18 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/14 unit 0 family ethernet-switching interface-
mode trunk
set interfaces ge-0/0/18 unit 0 family ethernet-switching interface-
mode trunk
set protocols rstp bridge-priority 32k
set protocols rstp interface ge-0/0/14 cost 1000
set protocols rstp interface ge-0/0/14 mode point-to-
point
set protocols rstp interface ge-0/0/18 cost 1000
set protocols rstp interface ge-0/0/18 mode point-to-
point
NOTE: Starting with Junos OS Release 15.1 for EX Series and QFX Series switches with support
for the Enhanced Layer 2 Software (ELS) configuration style, you can configure spanning tree
parameters globally on all spanning tree interfaces. See "Configuring RSTP on EX Series Switches
(CLI Procedure) " on page 31 for additional information.
If Switch 2 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 2, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch2# set voice-vlan description “Voice VLAN”
user@switch2# set voice-vlan vlan-id 10
user@switch2# set employee-vlan description “Employee VLAN”
user@switch2# set employee-vlan vlan-id 20
user@switch2# set guest-vlan description “Guest VLAN”
43
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch2# set ge-0/0/14 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch2# set ge-0/0/18 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch2# set ge-0/0/14 unit 0 family ethernet-switching interface-mode trunk
user@switch2# set ge-0/0/18 unit 0 family ethernet-switching interface-mode
trunk
[edit protocols]
user@switch2# rstp bridge-priority 32k
user@switch2# rstp interface ge-0/0/14 cost 1000
user@switch2# rstp interface ge-0/0/14 mode point-to-point
user@switch2# rstp interface ge-0/0/18 cost 1000
user@switch2# rstp interface ge-0/0/18 mode point-to-point
Step-by-Step Procedure
If Switch 2 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 2:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch2# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
}
}
}
}
}
protocols {
layer2-control {
nonstop-bridging;
}
rstp {
bridge-priority 32k;
interface ge-0/0/14 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/18 {
cost 1000;
mode point-to-point;
}
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
system {
commit synchronize;
}
chassis {
redundancy {
46
graceful-switchover;
}
IN THIS SECTION
Procedure | 46
Procedure
To quickly configure RSTP and nonstop bridging on Switch 3, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/26 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/28 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/24 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/26 unit 0 family ethernet-switching interface-
mode trunk
set interfaces ge-0/0/28 unit 0 family ethernet-switching interface-
mode trunk
set interfaces ge-0/0/24 unit 0 family ethernet-switching interface-
mode trunk
set protocols rstp bridge-priority 8k
47
If Switch 3 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 3, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch3# set voice-vlan description “Voice VLAN”
user@switch3# set voice-vlan vlan-id 10
user@switch3# set employee-vlan description “Employee VLAN”
user@switch3# set employee-vlan vlan-id 20
user@switch3# set guest-vlan description “Guest VLAN”
user@switch3# set guest-vlan vlan-id 30
user@switch3# set camera-vlan description “Camera VLAN”
user@switch3# set camera-vlan vlan-id 40
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch3# set ge-0/0/26 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch3# set ge-0/0/28 unit 0 family ethernet-switching vlan members [10 20 30 40]
48
user@switch3# set ge-0/0/24 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch3# set ge-0/0/26 unit 0 family ethernet-switching interface-mode trunk
user@switch3# set ge-0/0/28 unit 0 family ethernet-switching interface-mode trunk
user@switch3# set ge-0/0/24 unit 0 family ethernet-switching interface-mode
trunk
[edit protocols]
user@switch3# rstp bridge-priority 8k
user@switch3# rstp interface ge-0/0/26 cost 1000
user@switch3# rstp interface ge-0/0/26 mode point-to-point
user@switch3# rstp interface ge-0/0/28 cost 1000
user@switch3# rstp interface ge-0/0/28 mode point-to-point
user@switch3# rstp interface ge-0/0/24 cost 1000
user@switch3# rstp interface ge-0/0/24 mode point-to-point
Step-by-Step Procedure
If Switch 3 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 3:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch3# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
49
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
}
}
system {
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
IN THIS SECTION
Procedure | 51
Procedure
To quickly configure RSTP and nonstop bridging on Switch 4, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/23 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/19 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/23 unit 0 family ethernet-switching interface-
mode trunk
52
If Switch 4 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 4, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch4# set voice-vlan description “Voice VLAN”
user@switch4# set voice-vlan vlan-id 10
user@switch4# set employee-vlan description “Employee VLAN”
user@switch4# set employee-vlan vlan-id 20
user@switch4# set guest-vlan description “Guest VLAN”
user@switch4# set guest-vlan vlan-id 30
user@switch4# set camera-vlan description “Camera VLAN”
user@switch4# set camera-vlan vlan-id 40
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch4# set ge-0/0/23 unit 0 family ethernet-switching vlan members [10 20 30 40]
53
user@switch4# set ge-0/0/19 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch4# set ge-0/0/23 unit 0 family ethernet-switching interface-mode trunk
user@switch4# set ge-0/0/19 unit 0 family ethernet-switching interface-mode
trunk
[edit protocols]
user@switch4# rstp bridge-priority 16k
user@switch4# rstp interface ge-0/0/23 cost 1000
user@switch4# rstp interface ge-0/0/23 mode point-to-point
user@switch4# rstp interface ge-0/0/19 cost 1000
user@switch4# rstp interface ge-0/0/19 mode point-to-point
Step-by-Step Procedure
If Switch 4 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 4:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch4# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
54
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
rstp {
bridge-priority 16k;
interface ge-0/0/23 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/19 {
cost 1000;
mode point-to-point;
}
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
system {
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
Verification
IN THIS SECTION
To confirm that the configuration is working properly, perform these tasks on both Routing Engines:
Purpose
Action
Meaning
The operational mode command show spanning-tree interface shows that ge-0/0/13 is in a forwarding
state. The other interfaces on Switch 1 are blocking.
57
Purpose
Use this procedure to verify the RSTP configuration on both Switch 2 Routing Engines.
Action
Meaning
The operational mode command show spanning-tree interface shows that ge-0/0/18 is in a forwarding
state and is the root port.
Purpose
Use this procedure to verify the RSTP configuration on both Switch 3 Routing Engines.
Action
Meaning
The operational mode command show spanning-tree interface shows that no interface is the root interface.
Purpose
Use this procedure to verify the RSTP configuration on both Switch 4 Routing Engines.
Action
Meaning
The operational mode command show spanning-tree interface shows that interface ge-0/0/23 is the root
interface and forwarding.
59
IN THIS SECTION
Requirements | 59
Verification | 82
EX Series switches use Rapid Spanning Tree Protocol (RSTP) by default to provide a loop-free topology.
When switches that support redundant Routing Engines use RSTP, it is important to keep RSTP
synchronized on both Routing Engines so that no loss of service occurs after a Routing Engine
switchover. Nonstop bridging protocol keeps Routing Engines synchronized.
This example describes how to configure RSTP and NSB on four EX Series switches:
Requirements
This example uses the following hardware and software components:
Before you configure the switches for RSTP, be sure you have:
• Installed the four switches. See Connecting and Configuring an EX Series Switch (J-Web Procedure).
• Performed the initial software configuration on all switches. See Installing and Connecting an
EX3200 Switch.
60
IN THIS SECTION
Topology | 63
RSTP works by identifying certain links as point to point links and blocking other possible paths. When
one of the point-to-point links fails, a designated alternate link transitions to the forwarding state and
take over. Configuring nonstop bridging (NSB) on a switch with redundant Routing Engines keeps RSTP
synchronized on both Routing Engines. This way, RSTP remains active immediately after a switchover
because it is already synchronized to the backup Routing Engine. RSTP does not have to reconverge
after a Routing Engine switchover when NSB is enabled because the neighbor devices do not detect an
RSTP change on the switch. In this example, four EX Series switches are connected in the topology
displayed in Figure 2 on page 61 to create a loop-free topology with NSB applied to switches with dual
Routing Engines.
61
Table 4 on page 62 shows the components of the topology for this example.
NOTE: You can configure RSTP on logical or physical interfaces. This example shows RSTP
configured on logical interfaces.
62
Property Settings
This configuration example creates a loop-free topology between four EX Series switches using RSTP.
• The root port is responsible for forwarding data to the root bridge.
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
63
• The designated port forwards data to the downstream network segment or device.
• The backup port is a backup port for the designated port. When a designated port goes down, the
backup port becomes the active designated port and starts forwarding data.
NOTE: You also can create a loop-free topology between the aggregation layer and the
distribution layer using redundant trunk links. For more information about configuring redundant
trunk links, see Example: Configuring Redundant Trunk Links for Faster Recovery on EX Series
Switches.
Topology
IN THIS SECTION
Procedure | 63
Procedure
To quickly configure RSTP and nonstop bridging on Switch 1, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/13 unit 0 family ethernet-switching vlan members
[10 20 30 40]
64
If Switch 1 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 1, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch1# set voice-vlan description “Voice VLAN”
user@switch1# set voice-vlan vlan-id 10
user@switch1# set employee-vlan description “Employee VLAN”
user@switch1# set employee-vlan vlan-id 20
user@switch1# set guest-vlan description “Guest VLAN”
user@switch1# set guest-vlan vlan-id 30
65
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch1# set ge-0/0/13 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch1# set ge-0/0/9 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch1# set ge-0/0/11 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch1# set ge-0/0/13 unit 0 family ethernet-switching port-mode trunk
user@switch1# set ge-0/0/9 unit 0 family ethernet-switching port-mode trunk
user@switch1# set ge-0/0/11 unit 0 family ethernet-switching port-mode
trunk
[edit protocols]
Step-by-Step Procedure
If Switch 1 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 1:
66
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch1# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
[edit ethernet-switching-options]
user@switch1# set nonstop-bridging
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
ge-0/0/9 {
unit 0 {
family ethernet-switching {
port-mode trunk;
vlan {
members [10 20 30 40];
}
}
}
}
ge-0/0/11 {
unit 0 {
family ethernet-switching {
port-mode trunk;
vlan {
members [10 20 30 40];
}
}
}
}
}
protocols {
rstp {
bridge-priority 16k;
interface ge-0/0/13.0 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/9.0 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/11.0 {
cost 1000;
mode point-to-point;
}
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
68
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
system {
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
ethernet-switching-options {
nonstop-bridging;
}
IN THIS SECTION
Procedure | 68
Procedure
To quickly configure RSTP and nonstop bridging on Switch 2, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
69
If Switch 2 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 2, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch2# set voice-vlan description “Voice VLAN”
user@switch2# set voice-vlan vlan-id 10
user@switch2# set employee-vlan description “Employee VLAN”
user@switch2# set employee-vlan vlan-id 20
user@switch2# set guest-vlan description “Guest VLAN”
user@switch2# set guest-vlan vlan-id 30
70
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch2# set ge-0/0/14 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch2# set ge-0/0/18 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch2# set ge-0/0/14 unit 0 family ethernet-switching port-mode trunk
user@switch2# set ge-0/0/18 unit 0 family ethernet-switching port-mode
trunk
[edit protocols]
user@switch2# rstp bridge-priority 32k
user@switch2# rstp interface ge-0/0/14.0 cost 1000
user@switch2# rstp interface ge-0/0/14.0 mode point-to-point
user@switch2# rstp interface ge-0/0/18.0 cost 1000
user@switch2# rstp interface ge-0/0/18.0 mode point-to-point
Step-by-Step Procedure
If Switch 2 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 2:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch2# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
[edit ethernet-switching-options]
user@switch2# set nonstop-bridging
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
}
}
}
}
}
protocols {
rstp {
bridge-priority 32k;
interface ge-0/0/14.0 {
cost 1000;
mode point-to-point;
}
interface ge-0/0/18.0 {
cost 1000;
mode point-to-point;
}
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
system {
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
ethernet-switching-options {
73
nonstop-bridging;
}
IN THIS SECTION
Procedure | 73
Procedure
To quickly configure RSTP and nonstop bridging on Switch 3, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/26 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/28 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/24 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/26 unit 0 family ethernet-switching port-mode
trunk
set interfaces ge-0/0/28 unit 0 family ethernet-switching port-mode
trunk
set interfaces ge-0/0/24 unit 0 family ethernet-switching port-mode
trunk
set protocols rstp bridge-priority 8k
74
If Switch 3 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 3, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch3# set voice-vlan description “Voice VLAN”
user@switch3# set voice-vlan vlan-id 10
user@switch3# set employee-vlan description “Employee VLAN”
user@switch3# set employee-vlan vlan-id 20
user@switch3# set guest-vlan description “Guest VLAN”
user@switch3# set guest-vlan vlan-id 30
user@switch3# set camera-vlan description “Camera VLAN”
user@switch3# set camera-vlan vlan-id 40
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch3# set ge-0/0/26 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch3# set ge-0/0/28 unit 0 family ethernet-switching vlan members [10 20 30 40]
75
user@switch3# set ge-0/0/24 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch3# set ge-0/0/26 unit 0 family ethernet-switching port-mode trunk
user@switch3# set ge-0/0/28 unit 0 family ethernet-switching port-mode trunk
user@switch3# set ge-0/0/24 unit 0 family ethernet-switching port-mode
trunk
[edit protocols]
user@switch3# rstp bridge-priority 8k
user@switch3# rstp interface ge-0/0/26.0 cost 1000
user@switch3# rstp interface ge-0/0/26.0 mode point-to-point
user@switch3# rstp interface ge-0/0/28.0 cost 1000
user@switch3# rstp interface ge-0/0/28.0 mode point-to-point
user@switch3# rstp interface ge-0/0/24.0 cost 1000
user@switch3# rstp interface ge-0/0/24.0 mode point-to-point
Step-by-Step Procedure
If Switch 3 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 3:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch3# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
76
[edit ethernet-switching-options]
user@switch3# set nonstop-bridging
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
ethernet-switching-options {
nonstop-bridging;
}
IN THIS SECTION
Procedure | 78
Procedure
To quickly configure RSTP and nonstop bridging on Switch 4, copy the following commands and paste
them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan–id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces ge-0/0/23 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/19 unit 0 family ethernet-switching vlan members
[10 20 30 40]
set interfaces ge-0/0/23 unit 0 family ethernet-switching port-mode
trunk
79
If Switch 4 includes dual Routing Engines, configure NSB. To quickly configure nonstop bridging on
Switch 4, copy the following commands and paste them into the switch terminal window:
Step-by-Step Procedure
[edit vlans]
user@switch4# set voice-vlan description “Voice VLAN”
user@switch4# set voice-vlan vlan-id 10
user@switch4# set employee-vlan description “Employee VLAN”
user@switch4# set employee-vlan vlan-id 20
user@switch4# set guest-vlan description “Guest VLAN”
user@switch4# set guest-vlan vlan-id 30
user@switch4# set camera-vlan description “Camera VLAN”
user@switch4# set camera-vlan vlan-id 40
2. Configure the VLANs on the interfaces, including support for the Ethernet switching protocol:
[edit interfaces]
user@switch4# set ge-0/0/23 unit 0 family ethernet-switching vlan members [10 20 30 40]
80
user@switch4# set ge-0/0/19 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch4# set ge-0/0/23 unit 0 family ethernet-switching port-mode trunk
user@switch4# set ge-0/0/19 unit 0 family ethernet-switching port-mode
trunk
[edit protocols]
user@switch4# rstp bridge-priority 16k
user@switch4# rstp interface all cost 1000
user@switch4# rstp interface ge-0/0/23.0 cost 1000
user@switch4# rstp interface ge-0/0/23.0 mode point-to-point
user@switch4# rstp interface ge-0/0/19.0 cost 1000
user@switch4# rstp interface ge-0/0/19.0 mode point-to-point
Step-by-Step Procedure
If Switch 4 includes dual Routing Engines, configure nonstop bridging. To configure NSB on Switch 4:
2. Configure the switch to always synchronize configuration changes between the Routing Engines:
[edit system]
user@switch4# set commit synchronize
If you try to commit a configuration in which nonstop bridging is configured but synchronization of
configuration changes is not configured, the configuration is not committed.
81
[edit ethernet-switching-options]
user@switch4# set nonstop-bridging
NOTE: This process enables NSB for all NSB-supported Layer 2 protocols on the switch,
including RSTP.
Results
cost 1000;
mode point-to-point;
}
interface ge-0/0/19.0 {
cost 1000;
mode point-to-point;
}
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
system {
commit synchronize;
}
chassis {
redundancy {
graceful-switchover;
}
ethernet-switching-options {
nonstop-bridging;
}
Verification
IN THIS SECTION
To confirm that the configuration is working properly, perform these tasks on both Routing Engines:
Purpose
Action
Meaning
The operational mode command show spanning-tree interface shows that ge-0/0/13.0 is in a forwarding
state. The other interfaces on Switch 1 are blocking.
84
Purpose
Use this procedure to verify the RSTP configuration on both Switch 2 Routing Engines.
Action
Meaning
The operational mode command show spanning-tree interface shows that ge-0/0/18.0 is in a forwarding
state and is the root port.
Purpose
Use this procedure to verify the RSTP configuration on both Switch 3 Routing Engines.
Action
Meaning
The operational mode command show spanning-tree interface shows that no interface is the root interface.
Purpose
Use this procedure to verify the RSTP configuration on both Switch 4 Routing Engines.
Action
Meaning
The operational mode command show spanning-tree interface shows that interface ge-0/0/23.0 is the root
interface and forwarding.
86
NOTE: This procedure uses Junos OS for EX Series switches with support for the Enhanced
Layer 2 Software (ELS) configuration style. For ELS details, see Using the Enhanced Layer 2
Software CLI.
On EX Series switches running Rapid Spanning Tree Protocol (RSTP) (the default) or VLAN Spanning Tree
Protocol (VSTP), you can force the original IEEE 802.1D Spanning Tree Protocol (STP) version to run in
place of RSTP or VSTP. Configure the force-version stp statement for compatibility with older bridges
that do not support RSTP or VSTP.
To force the spanning-tree protocol version to be the original IEEE 802.1D STP:
[edit protocols]
user@switch# set (rstp | vstp) force-version stp
NOTE: After using the force-version statement to enable xSTP globally, apply the force-version
statement for specific Layer 2 ports.
Release Description
15.1 Starting with Junos OS Release 15.1 for EX Series and QFX Series switches with support for the
Enhanced Layer 2 Software (ELS) configuration style, you can configure spanning tree parameters
globally on all spanning tree interfaces.
RELATED DOCUMENTATION
Configuring MSTP
IN THIS SECTION
Understanding MSTP | 87
Configuring MSTP | 91
Multiple Spanning Tree Protocol (MSTP) maps multiple VLANs into a spanning tree instance, with each
instance having a spanning tree topology independent of other spanning tree instances.
Understanding MSTP
IN THIS SECTION
Benefits of MSTP | 88
Ethernet networks are susceptible to broadcast storms if loops are introduced. However, an Ethernet
network needs to include loops because they provide redundant paths in case of a link failure. Spanning-
tree protocols address both of these issues because they provide link redundancy while simultaneously
preventing undesirable loops.
Spanning-tree protocols intelligently avoid loops in a network by creating a tree topology (spanning tree)
of the entire bridged network with only one available path between the tree root and a leaf. All other
paths are forced into a standby state. The tree root is a switch within the network elected by the STA
(spanning-tree algorithm) to use when computing the best path between bridges throughout the
88
network and the root bridge. Frames travel through the network to their destination– a leaf. A tree
branch is a network segment, or link, between bridges. Switches that forward frames through an STP
spanning-tree are called designated bridges.
Juniper Networks devices provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree Protocol (RSTP), Multiple Spanning Tree Protocol (MSTP), and VLAN Spanning Tree
Protocol (VSTP). This topic explains MSTP.
NOTE: If you are using Junos OS for EX Series and QFX Series switches with support for the
Enhanced Layer 2 Software (ELS) configuration style, you can force the original IEEE 802.1D
Spanning Tree Protocol (STP) version to run in place of RSTP or VSTP by setting force-version.
Benefits of MSTP
• On MX Series and ACX Series routers, you can configure RSTP, MSTP, and VSTP instance interfaces
as edge ports.
MSTP is an extension of RSTP that maps multiple independent spanning-tree instances onto one
physical topology. Each spanning-tree instance (STI) includes one or more VLANs. Unlike in STP and
RSTP configurations, a port might belong to multiple VLANs and be dynamically blocked in one
spanning-tree instance, but forwarding in another. This behavior significantly improves network resource
utilization by load-balancing across the network and maintaining switch CPU loads at moderate levels.
MSTP also leverages the fast reconvergence time of RSTP when a network, switch, or port failure occurs
within a spanning-tree instance.
MSTP creates a common and internal spanning tree (CIST) to interconnect and manage all MSTP regions
and even individual devices that run RSTP or STP, which are recognized as distinct spanning-tree regions
by MSTP. The CIST views each MSTP region as a virtual bridge, regardless of the actual number of
devices participating in the MSTP region, and enables multiple spanning-tree instances (MSTIs) to link to
other regions. The CIST is a single topology that connects all switches (STP, RSTP, and MSTP devices)
through an active topology, ensuring connectivity between LANs and devices within a bridged network.
This functionality provided by MSTP enables you to better utilize network resources while remaining
backward-compatible with older network devices.
89
When enabling MSTP, you define one or more MSTP regions. An MSTP region defines a logical domain
where multiple spanning-tree instances (MSTIs) can be administered independently of MSTIs in other
regions, setting the boundary for bridge protocol data units (BPDUs) sent by one MSTI. An MSTP region
is a group of switches that is defined by three parameters:
An MSTP region can support up to 64 MSTIs,, and each MSTI can support from 1 to 4094 VLANs. When
you define a region, MSTP automatically creates an internal spanning-tree instance (IST instance 0) that
provides the root switch for the region and includes all currently configured VLANs that are not
specifically assigned to a user-defined MSTI. An MSTI includes all static VLANs that you specifically add
to it. The switch places any dynamically created VLANs in the IST instance by default, unless you
explicitly map them to another MSTI. Once you assign a VLAN to a user-defined MSTI, the switch
removes the VLAN from the IST instance.
The default factory configuration is RSTP, a faster version of STP. To determine which spanning-tree
protocol is best for your situation, see Table 5 on page 89 below.
RSTP • Rapid Spanning Tree Protocol is the default • RSTP does not work with 802.1D 1998
switch configuration and is recommended bridges.
for most network configurations because it
converges more quickly than STP after a
failure.
STP • Spanning Tree Protocol works with 802.1D • STP is slower than RSTP.
1998 bridges.
• STP is not recommended for multiple VLAN
• RSTP is backward compatible with STP; networks because it is not VLAN-aware—as
therefore, switches do not all have to run a result, all VLANs within a LAN share the
STP. same spanning-tree. This limits the number
of forwarding paths for data traffic.
MSTP • Multiple Spanning Tree Protocol works with • Some protocols require compatibility that is
most VLANs. not provided by MSTP. In this case, use
VSTP.
• RSTP and STP are recognized as distinct
spanning-tree regions by MSTP. • MSTP uses more CPU than RSTP and does
not converge as fast as RSTP.
VSTP • VLAN Spanning Tree Protocol works with • With VSTP there can be only STP instance
VLANs that require device compatibility. per VLAN, whereas MSTP lets you combine
multiple VLANs in one instance.
• VSTP and RSTP are the only spanning-tree
protocols that can be configured • VSTP supports a limited number of ports
concurrently on a switch. compared to RSTP.
SEE ALSO
Understanding RSTP | 26
Understanding VSTP
Configuring MSTP
You can configure the Multiple Spanning Tree Protocol (MSTP) under the [edit protocols] hierarchy.
You can configure the Multiple Spanning Tree Protocol (MSTP) under the following hierarchy levels:
• [edit protocols]
[edit]
user@switch@ edit ... protocols mstp
2. Configure the interfaces that participate in the MSTP instance for all interfaces at one time, or for
configured interface ranges, or for specific interfaces individually:
• Enable MSTP on all the interfaces at one time, for switches that support this option (most
switches):
NOTE: You cannot disable MSTP on all the interfaces with one command. See the
configuration steps for configuring MSTP on specific interfaces later in this topic for how
to disable MSTP on interfaces individually.
92
For QFX5100 switches, which do not support the interface all option, you must configure
interface ranges for the applicable interfaces on which you want to enable MSTP, and then issue
the set protocols mstp interface name command for each name that you have configured as an
interface range (described next).
• Enable MSTP on a range of interfaces, for switches such as QFX5100 switches that do not
support the interface all option:
a. Configure interface ranges using the interface-range statement at the [edit interfaces] hierarchy
level for the applicable interfaces on which you want to enable MSTP:
[edit interfaces]
user@switch# set interface-range interface-range-name member-range interface-name1 to
interface-name2
b. Enable MSTP for each configured interface range interface-range-name at the [edit ...
protocols mstp] hierarchy level:
• Configure a specific interface individually to enable MSTP and various MSTP options on that
interface, or to disable MSTP on that interface:
c. (Optional) By default, the interface link cost is determined by the link speed. You can configure
the interface link cost to control which bridge is the designated bridge and which port is the
designated port:
Specify p2p if the link is point to point. Specify shared if the link is a shared media.
Edge ports do not expect to receive bridge protocol data unit (BPDU) packets. If a BPDU
packet is received for an edge port, the port becomes a nonedge port
You can also enable BPDU root protection for all spanning-tree protocol instances on the interface.
BPDU root protect ensures the port is the spanning-tree designated port. If the port receives
superior BPDU packets, root protect moves this port to a root-prevented spanning-tree state. For
configuration details, see "Checking the Status of Spanning-Tree Instance Interfaces" on page 232.
3. Configure the bridge priority.
For more information, see "Understanding Bridge Priority for Election of Root Bridge and Designated
Bridge" on page 208.
4. Configure hello BPDU timers.
94
b. Configure the time interval at which the root bridge transmits configuration BPDUs:
5. (Optional) By default, the bridge port remains in the listening and learning states for 15 seconds
before transitioning to the forwarding state. You can specify a delay from 4 through 20 seconds
instead:
c. Configure the maximum number of hops that can be forwarded in the MSTP region:
SEE ALSO
You can configure a Multiple Spanning Tree Instance (MSTI) under the following hierarchy levels:
Before you begin, configure Multiple Spanning-Tree Protocol. For configuration details, see Configuring
Multiple Spanning Tree Protocol.
[edit]
user@host# edit ... protocols mstp msti msti-id
c. (Optional) By default, the interface link cost is determined by the link speed. You can configure
the interface link cost to control which bridge is the designated bridge and which port is the
designated port:
Edge ports do not expect to receive bridge protocol data unit (BPDU) packets. If a BPDU packet is
received for an edge port, the port becomes a non-edge port
3. Configure the bridge priority:
For more information, see "Understanding Bridge Priority for Election of Root Bridge and Designated
Bridge" on page 208.
4. (Optional) An MSTI can map to a range of VLANs just as a logical port can map to a range of VLANs.
The MSTP VLAN specifies the VLAN or VLAN range to which this MSTI is mapped. The vlan-id is
configured under the logical interface. Configure the VLAN or VLAN range of the MSTI instance:
[edit]
user@host# set vlan (vlan-id | vlan-id-range)
[edit]
protocols {
mstp {
...basic-mstp-configuration...
IN THIS SECTION
Requirements | 97
Verification | 120
NOTE: This example uses Junos OS for EX Series and QFX Series switches with support for the
Enhanced Layer 2 Software (ELS) configuration style. The example also describes the
configuration statement differences that can be substituted in the same configuration on EX
Series switches that do not support ELS.
Multiple Spanning Tree Protocol (MSTP) is used to create a loop-free topology in networks using
multiple spanning-tree regions in which each region contains multiple spanning-tree instances (MSTIs).
MSTIs provide different paths for different VLANs. This functionality facilitates better load sharing
across redundant links.
Up to 64 MSTIs can be created for an EX Series switch, and each MSTI can support up to 4094 VLANs.
Requirements
This example uses the following software and hardware components:
Before you configure the switches for MSTP, be sure you have:
• Installed and connected the four switches. See the hardware documentation for your switch.
98
• Performed the initial software configuration on all switches. See Connecting and Configuring an EX
Series Switch (CLI Procedure) or Connecting and Configuring an EX Series Switch (J-Web Procedure).
IN THIS SECTION
Topology | 99
When the number of VLANs grows in a network, MSTP provides an efficient way of creating a loop-free
topology by using MSTIs. Each MSTI in the spanning-tree domain maintains its own tree. Each tree can
be mapped to different links, utilizing bandwidth that would be unavailable to a single tree. MSTIs
reduce the demand on system resources.
99
Topology
Property Settings
Table 6: Components of the Topology for Configuring MSTP on EX Series Switches (Continued)
Property Settings
MSTIs 1
2
The topology in Figure 3 on page 99 shows a common and internal spanning tree (CIST). The CIST is a
single spanning tree connecting all devices in the network. The switch with the lowest bridge priority is
elected as the root bridge of the CIST. You can control the election of the root bridge by configuring the
bridge priority. Switch 3 is the root bridge of the CIST.
• The root port is responsible for forwarding data to the root bridge.
101
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
• The designated port forwards data to the downstream network segment or device.
• The backup port becomes the active designated port and starts forwarding data when the designated
port goes down.
In this example, one MSTP region contains Switch 1, Switch 2, Switch 3, and Switch 4. Within the region,
four VLANs are created:
• voice-vlan supports voice traffic and has the VLAN tag identifier of 10.
• employee-vlan supports data traffic and has the VLAN tag identifier of 20.
• guest-vlan supports guest VLAN traffic (for supplicants that fail authentication) and has the VLAN tag
identifier of 30.
• camera-vlan supports video traffic and has the VLAN tag identifier of 40.
The VLANs are associated with specific interfaces on each of the four switches. Two MSTIs, 1 and 2, are
then associated with the VLAN tag identifiers, and some MSTP parameters, such as cost, are configured
on each switch.
IN THIS SECTION
Procedure | 101
Procedure
To quickly configure interfaces and MSTP on Switch 1, for ELS switches, copy the following commands
and paste them into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
102
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
substitute the following command for those lines in the configuration, which uses the non-ELS
port-mode statement to set an interface into trunk mode:
Step-by-Step Procedure
NOTE: Starting with Junos OS Release 15.1 for EX Series and QFX Series switches with support
for the Enhanced Layer 2 Software (ELS) configuration style, you can configure spanning tree
parameters globally on all spanning tree interfaces. See "Configuring MSTP on Switches" on page
91 for additional information.
[edit vlans]
user@switch1# set voice-vlan description “Voice VLAN”
user@switch1# set voice-vlan vlan-id 10
user@switch1# set employee-vlan description “Employee VLAN”
user@switch1# set employee-vlan vlan-id 20
user@switch1# set guest-vlan description “Guest VLAN”
user@switch1# set guest-vlan vlan-id 30
user@switch1# set camera-vlan description “Camera VLAN”
user@switch1# set guest-vlan vlan-id 40
2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:
[edit interfaces]
user@switch1# set xe-0/0/9:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch1# set xe-0/0/12:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch1# set xe-0/0/11:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch1# set xe-0/0/9:0 unit 0 family ethernet-switching interface-mode trunk
user@switch1# set xe-0/0/12:0 unit 0 family ethernet-switching interface-mode trunk
user@switch1# set xe-0/0/11:0 unit 0 family ethernet-switching interface-mode trunk
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
104
substitute the following command for those lines in the configuration, which uses the non-
ELS port-mode statement to set an interface into trunk mode:
[edit protocols]
user@switch1# mstp configuration-name region1
user@switch1# mstp bridge-priority 16k
user@switch1# mstp interface xe-0/0/9:0 cost 1000
user@switch1# mstp interface xe-0/0/9:0 mode point-to-point
user@switch1# mstp interface xe-0/0/12:0 cost 1000
user@switch1# mstp interface xe-0/0/12:0 mode point-to-point
user@switch1# mstp interface xe-0/0/11:0 cost 1000
user@switch1# mstp interface xe-0/0/11:0 mode point-to-point
user@switch1# mstp msti 1 bridge-priority 16k
user@switch1# mstp msti 1 vlan [10 20]
user@switch1# mstp msti 1 interface xe-0/0/11:0 cost 1000
user@switch1# mstp msti 2 bridge-priority 8k
user@switch1# mstp msti 2 vlan [30 40]
Results
members 30;
members 40;
}
}
}
}
xe-0/0/12:0 {
unit 0 {
family ethernet-switching {
interface-mode trunk;
vlan {
members 10;
members 20;
members 30;
members 40;
}
}
}
}
xe-0/0/11:0 {
unit 0 {
family ethernet-switching {
interface-mode trunk;
vlan {
members 10;
members 20;
members 30;
members 40;
}
}
}
}
}
protocols {
mstp {
configuration-name region1;
bridge-priority 16k;
interface xe-0/0/9:0 {
cost 1000;
mode point-to-point;
}
interface xe-0/0/12:0 {
cost 1000;
106
mode point-to-point;
}
interface xe-0/0/11:0 {
cost 1000;
mode point-to-point;
}
msti 1 {
bridge-priority 16k;
vlan [ 10 20];
interface xe-0/0/11:0 {
cost 1000;
}
}
msti 2 {
bridge-priority 8k;
vlan [ 30 40 ];
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
IN THIS SECTION
Procedure | 107
107
Procedure
To quickly configure interfaces and MSTP on Switch 2, copy the following commands and paste them
into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces xe-0/0/9:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces et-0/0/3 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces xe-0/0/9:0 unit 0 family ethernet-switching interface-mode trunk
set interfaces et-0/0/3 unit 0 family ethernet-switching interface-mode trunk
set protocols mstp configuration-name region1
set protocols mstp bridge-priority 32k
set protocols mstp interface xe-0/0/9:0 cost 1000
set protocols mstp interface xe-0/0/9:0 mode point-to-point
set protocols mstp interface et-0/0/3 cost 1000
set protocols mstp interface et-0/0/3 mode point-to-point
set protocols mstp msti 1 bridge-priority 32k
set protocols mstp msti 1 vlan [10 20]
set protocols mstp msti 2 bridge-priority 4k
set protocols mstp msti 2 vlan [30 40]
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
substitute the following command for those lines in the configuration, which uses the non-ELS
port-mode statement to set an interface into trunk mode:
108
Step-by-Step Procedure
[edit vlans]
user@switch2# set voice-vlan description “Voice VLAN”
user@switch2# set voice-vlan vlan-id 10
user@switch2# set employee-vlan description “Employee VLAN”
user@switch2# set employee-vlan vlan-id 20
user@switch2# set guest-vlan description “Guest VLAN”
user@switch2# set guest-vlan vlan-id 30
user@switch2# set camera-vlan vlan-description “Camera VLAN”
user@switch2# set guest-vlan vlan-id 40
2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:
[edit interfaces]
user@switch2# set xe-0/0/9:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch2# set et-0/0/3 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch2# set xe-0/0/9:0 unit 0 family ethernet-switching interface-mode trunk
user@switch2# set et-0/0/3 unit 0 family ethernet-switching interface-mode trunk
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
109
substitute the following command for those lines in the configuration, which uses the non-
ELS port-mode statement to set an interface into trunk mode:
[edit protocols]
user@switch2# mstp configuration-name region1
user@switch2# mstp bridge-priority 32k
user@switch2# mstp interface xe-0/0/9:0 cost 1000
user@switch2# mstp interface xe-0/0/9:0 mode point-to-point
user@switch2# mstp interface et-0/0/3 cost 1000
user@switch2# mstp interface et-0/0/3 mode point-to-point
user@switch2# mstp msti 1 bridge-priority 32k
user@switch2# mstp msti 1 vlan [10 20]
user@switch2# mstp msti 2 bridge-priority 4k
user@switch2# mstp msti 2 vlan [30 40]
Results
}
}
}
et-0/0/3 {
unit 0 {
family ethernet-switching {
interface-mode trunk;
vlan {
members 10;
members 20;
members 30;
members 40;
}
}
}
}
}
protocols {
mstp {
configuration-name region1;
bridge-priority 32k;
interface xe-0/0/9:0 {
cost 1000;
mode point-to-point;
}
interface et-0/0/3 {
cost 1000;
mode point-to-point;
}
msti 1 {
bridge-priority 32k;
vlan [10 20];
}
msti 2 {
bridge-priority 4k;
vlan [30 40];
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
111
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
IN THIS SECTION
Procedure | 111
Procedure
To quickly configure interfaces and MSTP on Switch 3, copy the following commands and paste them
into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan—id 40
set interfaces xe-0/0/11:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces et-0/0/6 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces xe-0/0/21:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces xe-0/0/11:0 unit 0 family ethernet-switching interface-mode trunk
set interfaces et-0/0/6 unit 0 family ethernet-switching interface-mode trunk
112
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
substitute the following command for those lines in the configuration, which uses the non-ELS
port-mode statement to set an interface into trunk mode:
Step-by-Step Procedure
[edit vlans]
user@switch3# set voice-vlan description “Voice VLAN”
user@switch3# set voice-vlan vlan-id 10
user@switch3# set employee-vlan description “Employee VLAN”
user@switch3# set employee-vlan vlan-id 20
user@switch3# set guest-vlan description “Guest VLAN”
user@switch3# set guest-vlan vlan-id 30
user@switch3# set camera-vlan description “Camera VLAN”
113
2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:
[edit interfaces]
user@switch3# set xe-0/0/11:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch3# set et-0/0/6 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch3# set xe-0/0/21:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch3# set xe-0/0/11:0 unit 0 family ethernet-switching interface-mode trunk
user@switch3# set et-0/0/6 unit 0 family ethernet-switching interface-mode trunk
user@switch3# set xe-0/0/21:0 unit 0 family ethernet-switching interface-mode trunk
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
substitute the following command for those lines in the configuration, which uses the non-
ELS port-mode statement to set an interface into trunk mode:
[edit protocols]
user@switch3# mstp configuration-name region1
user@switch3# mstp bridge-priority 8k
user@switch3# mstp interface xe-0/0/11:0 cost 1000
user@switch3# mstp interface xe-0/0/11:0 mode point-to-point
user@switch3# mstp interface et-0/0/6 cost 1000
user@switch3# mstp interface et-0/0/6 mode point-to-point
user@switch3# mstp interface xe-0/0/21:0 cost 1000
114
Results
family ethernet-switching {
interface-mode trunk;
vlan {
members 10;
members 20;
members 30;
members 40;
}
}
}
}
}
}
protocols {
mstp {
configuration-name region1;
bridge-priority 8k;
interface xe-0/0/11:0 {
cost 1000;
mode point-to-point;
}
interface et-0/0/6 {
cost 1000;
mode point-to-point;
}
interface xe-0/0/21:0 {
cost 1000;
mode point-to-point;
}
msti 1 {
bridge-priority 4k;
vlan [10 20];
}
msti 2 {
bridge-priority 16k;
vlan [30 40];
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
116
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
IN THIS SECTION
Procedure | 116
Procedure
To quickly configure interfaces and MSTP on Switch 4, copy the following commands and paste them
into the switch terminal window:
[edit]
set vlans voice-vlan description “Voice VLAN”
set vlans voice-vlan vlan-id 10
set vlans employee-vlan description “Employee VLAN”
set vlans employee-vlan vlan-id 20
set vlans guest-vlan description “Guest VLAN”
set vlans guest-vlan vlan-id 30
set vlans camera-vlan description “Camera VLAN”
set vlans camera-vlan vlan-id 40
set interfaces xe-0/0/12:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces xe-0/0/21:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
set interfaces xe-0/0/12:0 unit 0 family ethernet-switching interface-mode trunk
set interfaces xe-0/0/21:0 unit 0 family ethernet-switching interface-mode trunk
set protocols mstp configuration-name region1
117
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
substitute the following command for those lines in the configuration, which uses the non-ELS
port-mode statement to set an interface into trunk mode:
Step-by-Step Procedure
[edit vlans]
user@switch4# set voice-vlan description “Voice VLAN”
user@switch4# set voice-vlan vlan-id 10
user@switch4# set employee-vlan description “Employee VLAN”
user@switch4# set employee-vlan vlan-id 20
user@switch4# set guest-vlan description “Guest VLAN”
user@switch4# set guest-vlan vlan-id 30
user@switch4# set camera-vlan description “Camera VLAN”
user@switch4# set guest-vlan vlan-id 40
118
2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:
[edit interfaces]
user@switch4# set xe-0/0/12:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
user@switch4# set xe-0/0/21:0 unit 0 family ethernet-switching vlan members [10 20 30 40]
[edit interfaces]
user@switch4# set xe-0/0/12:0 unit 0 family ethernet-switching interface-mode trunk
user@switch4# set xe-0/0/21:0 unit 0 family ethernet-switching interface-mode trunk
NOTE: For non-ELS switches, instead of the following command used above for ELS switches
that sets an interface into trunk mode using the interface-mode statement:
substitute the following command for those lines in the configuration, which uses the non-
ELS port-mode statement to set an interface into trunk mode:
[edit protocols]
user@switch4# mstp configuration-name region1
user@switch4# mstp bridge-priority 16k
user@switch4# mstp interface xe-0/0/12:0 cost 1000
user@switch4# mstp interface xe-0/0/12:0 mode point-to-point
user@switch4# mstp interface xe-0/0/21:0 cost 1000
user@switch4# mstp interface xe-0/0/21:0 mode point-to-point
user@switch4# mstp msti 1 bridge-priority 16k
user@switch4# mstp msti 1 vlan [10 20]
user@switch4# mstp msti 2 bridge-priority 32k
user@switch4# mstp msti 2 vlan [30 40]
119
Results
cost 1000;
mode point-to-point;
}
msti 1 {
bridge-priority 16k;
vlan [10 20];
}
msti 2 {
bridge-priority 32k;
vlan [30 40];
}
}
}
vlans {
voice-vlan {
vlan-id 10;
}
employee-vlan {
vlan-id 20;
}
guest-vlan {
vlan-id 30;
}
camera-vlan {
vlan-id 40;
}
}
Verification
IN THIS SECTION
Purpose
Action
Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:
Bridge ID : 8194.54:4b:8c:43:27:03
Meaning
The operational mode command show spanning-tree interface displays spanning-tree domain information
such as the designated port and the port roles.
The operational mode command show spanning-tree bridge displays the spanning-tree domain information
at either the bridge level or the interface level. If the optional interface name is omitted, all interfaces in
the spanning-tree domain are displayed.
Purpose
Action
Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:
Meaning
The operational mode command show spanning-tree interface displays spanning-tree domain information
such as the designated port and the port roles. The spanning-tree interface parameters for instance 2
show that both ports are designated ports, which means Switch 2 is the root bridge for this instance.
The operational mode command show spanning-tree bridge displays the spanning-tree domain information
at either the bridge level or interface level. If the optional interface name is omitted, all interfaces in the
spanning-tree domain are displayed.
Purpose
Action
Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:
Bridge ID : 4097.54:4b:8c:44:c1:03
Meaning
The operational mode command show spanning-tree interface displays spanning-tree domain information
such as the designated port and the port roles. Switch 3 is the root bridge for instance 0, which is the
CIST, as well as for instance 1. In both instances, all ports on Switch 3 are designated ports.
The operational mode command show spanning-tree bridge displays the spanning-tree domain information
at either the bridge level or the interface level. If the optional interface name is omitted, all interfaces in
the spanning-tree domain are displayed.
Purpose
Action
Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:
Meaning
The operational mode command show spanning-tree interface displays spanning-tree domain information
such as the designated port and the port roles.
The operational mode command show spanning-tree bridge displays the spanning-tree domain information
at either the bridge level or the interface level. If the optional interface name is omitted, all interfaces in
the spanning-tree domain are displayed.
Disabling MSTP
• Include the disable statement. You can include this statement at the following hierarchy levels:
Release Description
15.1 Starting with Junos OS Release 15.1 for EX Series and QFX Series switches with support for the
Enhanced Layer 2 Software (ELS) configuration style, you can configure spanning tree parameters
globally on all spanning tree interfaces.
Configuring VSTP
IN THIS SECTION
Virtual Spanning-Tree Protocol works with VLANs that require device compatibility.
131
Understanding VSTP
IN THIS SECTION
When using VSTP, we recommend that you enable VSTP on all VLANs that can receive VSTP bridge
protocol data units (BPDUs).
Benefits of VSTP
• VSTP and RSTP are the only spanning-tree protocols that can be configured concurrently on a
device.
VSTP Restrictions
• Devices running Layer 2 next-generation (L2NG) software support 510 VLANs on VSTP.
• SRX Series Firewalls support only STP, RSTP, and MSTP; VSTP is not supported.
• In devices that does not support Enhanced Layer 2 Software (ELS), VSTP can support up to 253
VLANs.
You can use Juniper Networks devices with VSTP, which maintains a separate spanning tree instance per
VLAN. One Spanning Tree per VLAN allows fine grain load balancing but requires more BPDU CPU
processing as the number of VLANs increases. Juniper Networks devices only inter-operate with PVST+
and Rapid-PVST+. For more information, see VSTP and RPVST+ convergence on native-vlan 1 for EX
Switches .
132
TIP: We recommend that you enable both VSTP and RSTP on the EX Series or QFX Series
interface.
VSTP and RSTP are the only spanning-tree protocols that can be configured concurrently on a device.
The maximum number of VLANs that can be supported by VSTP on a switch depends upon whether
you are using Junos OS for EX Series and QFX Series switches with support for the Enhanced Layer 2
Software (ELS) configuration style or Junos OS that does not support ELS. For ELS details, see Using the
Enhanced Layer 2 Software CLI. For additional VLANs, use RSTP.
The maximum number of VLANs supported by VSTP on a switch depends upon whether you are using
Junos OS for EX Series and QFX Series switches with support for the Enhanced Layer 2 Software (ELS)
configuration style or Junos OS that does not support ELS.
IN THIS SECTION
Juniper Networks devices provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree Protocol (RSTP), Multiple Spanning Tree Protocol (MSTP), and VLAN Spanning Tree
Protocol (VSTP). The default factory configuration for devices that support ELS uses RSTP. This topic
describes options for configuring VSTP on devices that support ELS.
NOTE: When you configure VSTP, we recommend that you enable VSTP on all VLANs that can
receive VSTP bridge protocol data units (BPDUs).
133
NOTE:
• If you configure VSTP on an interface at both the global and the specific VLAN level, the
interface configuration that is defined at the specific VLAN level overrides the interface
configuration that is defined at the global level.
• If you specify VSTP to be configured on an interface that is not configured to belong to the
VLAN (or VLANs), an error message is displayed.
• If STP is needed on all the VLANs and the VLANs configured in the system are more than the
maximum allowed VLANs for VSTP, then you must use RSTP instead of VSTP.
NOTE: When you issue the set protocols vstp vlan all interface all command, you might not
receive an error message when you have exceed the limit of 5119 vports.
NOTE: When you configure VSTP with the set protocol vstp vlan vlan-id interface interface-name
command, the VLAN named default is excluded. You must manually configure a VLAN with the
name default to run VSTP.
CAUTION: Ensure that the interface is a member of all VLANs before you add the
interface to the VSTP configuration. If the interface is not a member of all VLANs, this
VSTP configuration will fail when you try to commit it.
Command to disable one specific VSTP interface on all the VLANs on the switch:
NOTE: You cannot disable the VSTP VLAN parameters for all VSTP interfaces.
IN THIS SECTION
Requirements | 136
Overview | 137
Configuration | 138
Verification | 150
In 802.1ad provider bridge networks (stacked VLANs), single-tagged access ports and double-tagged
trunk ports can co-exist in a single spanning tree context. In this mode, the VLAN Spanning Tree
Protocol (VSTP) can send and receive untagged Rapid Spanning Tree Protocol (RSTP) bridge protocol
data units (BPDUs) on Gigabit Ethernet (ge), 10 -Gigabit Ethernet (xe), and aggregated Ethernet (ae)
interfaces. The untagged RSTP BPDUs interoperate with tagged VSTP BPDUs sent over the double-
tagged trunk ports.
Double-tagging can be useful for Internet service providers, allowing them to use VLANs internally while
mixing traffic from clients that are already VLAN-tagged.
This example shows how to configure the VSTP to send and receive standard untagged Rapid Spanning
Tree Protocol (RSTP) bridge protocol data units (BPDUs) on access trunks that interoperate with tagged
VSTP BPDUs sent over the double-tagged trunk ports.
Requirements
This example uses the following hardware and software components:
137
Overview
IN THIS SECTION
Topology | 137
This example shows how to configure VSTP on a trunk port with tagged traffic.
Topology
Figure 4 on page 138 shows a sample topology in which two customer edge (CE) bridges are dual-
homed to two provider edge (PE) devices. All of the PE-CE links are single-tagged trunks using C-VLANs
1-100. The core link between Devices PE1 and PE2 is a double-tagged trunk that carries traffic from
both CE devices, using S-VLANs 100 and 200 to distinguish the CE traffic.
Two VSTP instances are created on the PE devices, one for each S-VLAN. The CE devices run the
standard RSTP. The PE devices run VSTP on the core link while sending standard untagged RSTP BPDUs
toward the CE devices.
138
Figure 4: Topology for VSTP Configured on a Trunk Port with Tagged Traffic
Configuration
IN THIS SECTION
Results | 144
To quickly configure this example, copy the following commands, paste them into a text file, remove any
line breaks, change any details necessary to match your network configuration, and then copy and paste
the commands into the CLI at the [edit] hierarchy level.
Device PE1
Device PE2
set routing-instances vs1 protocols vstp vlan 100 interface ge-2/1/3 access-trunk
set routing-instances vs1 bridge-domains bd vlan-id-list 1-100
set routing-instances vs2 instance-type virtual-switch
set routing-instances vs2 interface ge-2/0/1.2
set routing-instances vs2 interface ge-2/0/5.0
set routing-instances vs2 protocols vstp vlan 200 interface ge-2/0/1
set routing-instances vs2 protocols vstp vlan 200 interface ge-2/0/5 access-trunk
set routing-instances vs2 bridge-domains bd vlan-id-list 1-100
Device CE1
Device CE2
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For
information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User
Guide.
141
[edit interfaces]
user@PE1# set ge-2/0/1 flexible-vlan-tagging
user@PE1# set ge-2/0/1 encapsulation flexible-ethernet-services
user@PE1# set ge-2/0/1 unit 1 vlan-id 100
user@PE1# set ge-2/0/1 unit 1 family bridge interface-mode trunk
user@PE1# set ge-2/0/1 unit 1 family bridge inner-vlan-id-list 1-100
user@PE1# set ge-2/0/1 unit 2 vlan-id 200
user@PE1# set ge-2/0/1 unit 2 family bridge interface-mode trunk
user@PE1# set ge-2/0/1 unit 2 family bridge inner-vlan-id-list 1-100
user@PE1# set ge-2/0/4 encapsulation ethernet-vpls
user@PE1#set ge-2/0/4 unit 0 description to_CE1
user@PE1# set ge-2/0/4 unit 0 family bridge interface-mode trunk
user@PE1#set ge-2/0/4 unit 0 family bridge vlan-id-list 1-100
user@PE1# set ge-2/1/1 unit 0 description to_CE2
user@PE1# set ge-2/1/1 unit 0 family bridge interface-mode trunk
user@PE1# set ge-2/1/1 unit 0 family bridge vlan-id-list 1-100
[edit routing-instances]
user@PE1# set vs1 instance-type virtual-switch
user@PE1# set vs1 interface ge-2/0/1.1
user@PE1# set vs1 interface ge-2/0/4.0
user@PE1# set vs1 protocols vstp vlan 100 interface ge-2/0/1
user@PE1# set vs1 protocols vstp vlan 100 interface ge-2/0/4 access-trunk
user@PE1# set vs1 bridge-domains bd vlan-id-list 1-100
user@PE1# set vs2 instance-type virtual-switch
user@PE1# set vs2 interface ge-2/0/1.2
user@PE1# set vs2 interface ge-2/1/1.0
user@PE1# set vs2 protocols vstp vlan 200 interface ge-2/0/1
user@PE1# set vs2 protocols vstp vlan 200 interface ge-2/1/1 access-trunk
user@PE1# set vs2 bridge-domains bd vlan-id-list 1-100
Step-by-Step Procedure
[edit interfaces]
user@PE2# set ge-2/0/1 flexible-vlan-tagging
user@PE2# set ge-2/0/1 encapsulation flexible-ethernet-services
user@PE2# set ge-2/0/1 unit 1 vlan-id 100
user@PE2# set ge-2/0/1 unit 1 family bridge interface-mode trunk
user@PE2# set ge-2/0/1 unit 1 family bridge inner-vlan-id-list 1-100
user@PE2# set ge-2/0/1 unit 2 vlan-id 200
user@PE2# set ge-2/0/1 unit 2 family bridge interface-mode trunk
user@PE2# set ge-2/0/1 unit 2 family bridge inner-vlan-id-list 1-100
user@PE2# set ge-2/1/3 description to_CE1
user@PE2# set ge-2/1/3 unit 0 family bridge interface-mode trunk
user@PE2# set ge-2/1/3 unit 0 family bridge vlan-id-list 1-100
user@PE2# set ge-2/0/5 description to_CE2
user@PE2# set ge-2/0/5 unit 0 family bridge interface-mode trunk
user@PE2# set ge-2/0/5 unit 0 family bridge vlan-id-list 1-100
[edit routing-instances]
user@PE2# set vs1 instance-type virtual-switch
user@PE2# set vs1 interface ge-2/0/1.1
user@PE2# set vs1 interface ge-2/1/3.0
user@PE2# set vs1 protocols vstp vlan 100 interface ge-2/0/1
user@PE2# set vs1 protocols vstp vlan 100 interface ge-2/1/3 access-trunk
user@PE2# set vs1 bridge-domains bd vlan-id-list 1-100
user@PE2# set vs2 instance-type virtual-switch
user@PE2# set vs2 interface ge-2/0/1.2
user@PE2# set vs2 interface ge-2/0/5.0
user@PE2# set vs2 protocols vstp vlan 200 interface ge-2/0/1
user@PE2# set vs2 protocols vstp vlan 200 interface ge-2/0/5 access-trunk
user@PE2# set vs2 bridge-domains bd vlan-id-list 1-100
Step-by-Step Procedure
To configure CE1:
143
[edit interfaces]
user@CE1# set ge-2/0/7 unit 0 description to_PE1
user@CE1# set ge-2/0/7 unit 0 family bridge interface-mode trunk
user@CE1# set ge-2/0/7 unit 0 family bridge vlan-id-list 1-100
user@CE1# set ge-2/1/4 unit 0 description to_PE2
user@CE1# set ge-2/1/4 unit 0 family bridge interface-mode trunk
user@CE1# set ge-2/1/4 unit 0 family bridge vlan-id-list 1-100
[edit protocols]
user@CE1# set rstp interface ge-2/0/7
user@CE1# set rstp interface ge-2/1/4
[edit bridge-domains]
user@CE1# set bd vlan-id-list 1-100
Step-by-Step Procedure
To configure CE2:
[edit interfaces]
user@CE2# set ge-2/0/8 unit 0 description to_PE2
user@CE2# set ge-2/0/8 unit 0 family bridge interface-mode trunk
user@CE2# set ge-2/0/8 unit 0 family bridge vlan-id-list 1-100
user@CE2# set ge-2/1/1 unit 0 description to_PE1
user@CE2# set ge-2/1/1 unit 0 family bridge interface-mode trunk
user@CE2# set ge-2/1/1 unit 0 family bridge vlan-id-list 1-100
144
[edit protocols]
user@CE2# set rstp interface ge-2/0/8
user@CE2# set rstp interface ge-2/1/1
[edit bridge-domains]
user@CE2# set bd vlan-id-list 1-100
Results
From configuration mode, confirm your configuration by entering the show interfaces, show routing-
instances, show protocols, and show bridge-domains commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
Device PE1
unit 0 {
description to_CE1;
family bridge {
interface-mode trunk;
vlan-id-list 1-100;
}
}
}
ge-2/1/1 {
unit 0 {
description to_CE2;
family bridge {
interface-mode trunk;
vlan-id-list 1-100;
}
}
}
interface ge-2/0/1.2;
interface ge-2/0/1.0;
protocols {
vstp {
vlan 200 {
interface ge-2/0/1;
interface ge-2/1/1 {
access-trunk;
}
}
}
}
bridge-domains {
bd {
vlan-id-list 1-100;
}
}
}
Device PE2
unit 0 {
family bridge {
interface-mode trunk;
vlan-id-list 1-100;
}
}
}
ge-2/1/3 {
description to_CE1;
unit 0 {
family bridge {
interface-mode trunk;
vlan-id-list 1-100;
}
}
}
interface ge-2/0/5.0;
protocols {
vstp {
vlan 200 {
interface ge-2/0/1;
interface ge-2/0/5 {
access-trunk;
}
}
}
}
bridge-domains {
bd {
vlan-id-list 1-100;
}
}
}
Device CE1
}
}
Device CE2
interface ge-2/0/8;
interface ge-2/1/1;
}
If you are done configuring the device, enter commit from configuration mode.
Verification
IN THIS SECTION
Purpose
Action
From operational mode, enter the show spanning-tree interface routing-instance command.
Meaning
The output shows the status of the interfaces configured for VLAN 100.
Purpose
Verify the STP bridge parameters configured for the routing instances.
Action
From operational mode, enter the show spanning-tree bridge routing-instance command.
Meaning
The output shows the status of the STP bridge parameters for routing instance vs1.
152
Purpose
Action
From operational mode, enter the show spanning-tree statistics bridge command.
Meaning
The command output shows spanning-tree statistics for the configured bridge.
SEE ALSO
access-trunk
On devices that support ELS on which Rapid Spanning Tree Protocol (RSTP) or VLAN Spanning Tree
Protocol (VSTP) has been forced to run as the original IEEE 802.1D Spanning Tree Protocol (STP)
version, you can revert back to RSTP or VSTP.
To revert from the forced instance of the original IEEE 802.1D STP version to the originally configured
RSTP or VSTP version:
1. Remove the force-version statement from the following RSTP or VSTP configuration:
To revert the STP protocol globally, issue the statement without options (clear spanning-tree
protocol-migration).
154
To revert the STP protocol for the specified interface only, specify the interface interface-name
option.
To revert the STP protocol for a particular routing instance only, specify the routing-instance routing-
instance-name option.
4 CHAPTER
IN THIS SECTION
Configuring Interface for BPDU Protection With Port Shutdown Mode | 160
Configuring Interface for BPDU Protection With BPDU Drop Mode | 163
ACX Series routers, MX Series routers, PTX Series routers, EX Series switches, and QFX Series switches
support spanning-tree protocols that prevent loops in a network by creating a tree topology (spanning-
tree) of the entire bridged network. All spanning-tree protocols use a special type of frame called bridge
protocol data units (BPDUs) to communicate with each other.
The Spanning Tree Protocol (STP) family is designed to break possible loops in a Layer 2 bridged
network. Loop prevention avoids damaging broadcast storms that can potentially render the network
useless. STP processes on bridges exchange BPDUs to determine the LAN topology, decide the root
bridge, stop forwarding on some ports, and so on. However, a misbehaving user application or device
can interfere with the operation of the STP protocols and cause network problems.
BPDU-block is a feature that defends the STP topology from a misbehaving user application or device or
a threat. You must enable BPDU guard on the interfaces that are not supposed to receive any BPDUs.
If an interface is configured to be edge port, it will transition directly to the Forwarding state. Such ports
are connected to end devices and are not expected to receive BPDU. Therefore, to avoid loops, you
must protect edge ports by enabling bpdu-block-on-edge.
157
On the routers and switches that support STP, you can configure BPDU protection to ignore BPDUs
received on interfaces where none should be expected (for example, a LAN interface on a network edge
with no other bridges present). If a BPDU is received on a protected interface, the interface is disabled
and stops forwarding frames. By default, all BPDUs are accepted and processed on all interfaces.
You can achieve BPDU protection in several ways. By default, if bpdu-block is enabled on the interface,
on receiving BPDU, the interface will be disabled and all traffic forwarding will stop on the interface.
However, if you do not want to disable the interface and do not want that interface to take part in the
STP calculation, you can configure action drop. If you configure action drop, the interface remains up
and running and traffic continues to flow; however, BPDUs are dropped.
The edge ports do not support action drop. BPDU-block-on-edge disables the interface if the edge ports
receive BPDUs. You must clear the error to bring the interface back up.
You can configure BPDU protection on interfaces with the following encapsulation types:
• ethernet-bridge
• ethernet-vpls
• extended-vlan-bridge
• vlan-vpls
• vlan-bridge
• extended-vlan-vpls
You can configure BPDU protection on individual interfaces or on all the edge ports of the bridge.
Enable BPDU protection on interfaces that are configured as edge ports by using the bpdu-block-on-edge
command under the set protocols (mstp|rstp|vstp) hierarchy. If you have not configured a port as an edge
port, you can still configure BPDU protection on the interface by using the bpdu-block command under
the set protocols layer2-control hierarchy. You can also use the bpdu-block command to configure BPDU
protection on interfaces configured for a spanning-tree.
SEE ALSO
Understanding Root Protection for Spanning-Tree Instance Interfaces in a Layer 2 Switched Network
| 208
Understanding VPLS Multihoming | 203
158
IN THIS SECTION
Networks frequently use multiple protocols simultaneously to achieve different goals and in some cases
those protocols might conflict with each other. One such case is when spanning-tree protocols are
active on the network, where a special type of switching frame called a bridge protocol data unit (BPDU)
can conflict with BPDUs generated on other devices such as PCs. The different kinds of BPDUs are not
compatible, but they can still be recognized by other devices that use BPDUs and cause network
outages. You need to protect any device that recognizes BPDUs from picking up incompatible BPDUs.
Spanning-tree protocols such as Spanning Tree Protocol (STP), Rapid Spanning Tree Protocol (RSTP),
VLAN Spanning Tree Protocol (VSTP), and Multiple Spanning Tree Protocol (MSTP) generate their own
BPDUs. These peer STP applications use their BPDUs to communicate, and ultimately, the exchange of
BPDUs determines which interfaces block traffic and which interfaces become root ports. The root ports
and designated ports forward traffic; the alternate and back up ports block the traffic.
To configure BPDU protection on one or more spanning-tree instance interfaces, include the bpdu-block
statement:
bpdu-block {
interface interface-name;
disable-timeout seconds;
}
159
NOTE: If you also include the optional disable-timeout seconds statement, protected interfaces are
automatically cleared after the specified time interval unless the interval is 0.
In a Layer 2 bridge environment, spanning-tree protocols use data frames called Bridge Protocol Data
Units (BPDUs) to exchange information among bridges.
Spanning-tree protocols on peer systems exchange BPDUs, which contain information about port roles,
bridge IDs, and root path costs. On each router or switch, the spanning-tree protocol uses this
information to elect a root bridge, identify root ports for each switch, identify designated ports for each
physical LAN segment, and prune specific redundant links to create a loop-free tree topology. The
resulting tree topology provides a single active Layer 2 data path between any two end stations.
NOTE: In discussions of spanning-tree protocols, the terms bridge and switch are often used
interchangeably.
The transmission of BPDUs is controlled by the Layer 2 Control Protocol process (l2cpd) on MX Series
5G Universal Routing Platforms.
The transmission of periodic packets on behalf of the l2cpd process is carried out by periodic packet
management (PPM), which, by default, is configured to run on the Packet Forwarding Engine. The ppmd
process on the Packet Forwarding Engine ensures that the BPDUs are transmitted even when the l2cpd
is unavailable, and keeps the remote adjacencies alive during a unified in-service software upgrade
(unified ISSU). However, if you want the distributed PPM (ppmd) process to run on the Routing Engine
instead of the Packet Forwarding Engine, you can disable the ppmd process on the Packet Forwarding
Engine.
On routers and switches with redundant Routing Engines (two Routing Engines that are installed in the
same router), you can configure nonstop bridging. Nonstop bridging enables the router to switch from a
primary Routing Engine to a backup Routing Engine without losing Layer 2 Control Protocol (L2CP)
information. Nonstop bridging uses the same infrastructure as graceful Routing Engine switchover
(GRES) to preserve interface and kernel information. However, nonstop bridging also saves L2CP
information by running the l2cpd process on the backup Routing Engine.
160
EVPN-VXLAN data center fabrics have a number of built-in Ethernet loop prevention mechanisms, such
as split-horizon and designated forwarder and non-designated forwarder election. In some existing data
center environments where a new IP EVPN fabric is being deployed, you might need to configure BPDU
protection at the leaf-to-server interface in order to avoid network outages due to xSTP miscalculations.
Incorrect cabling between the server and leaf interfaces, or any back-door layer 2 link between two or
more ESI-LAG interfaces, might cause miscalculations and then result in Ethernet loops. Without BPDU
protection, BPDUs might not be recognized and will be flooded as unknown Layer 2 packets on the
VXLAN interfaces. With BPDU protection, when a BPDU is received on an edge port in an EVPN-
VXLAN environment, the edge port is disabled and stops forwarding all traffic. You can also configure
BPDU protection to drop BPDU traffic but have all other traffic forwarded on the interfaces without
having to configure a spanning-tree protocol.
1. Configure any spanning-tree protocol on the switch if not configured already. RSTP is configured in
this procedure.
[edit protocols]
user@switch# set rstp
2. Enable RSTP on a specific interface and set a priority for the interface—for example, et-0/0/0.0:
[edit protocols]
user@switch# set rstp interface et-0/0/0.0 priority 16
[edit protocols]
user@switch# set layer2-control bpdu-block interface et-0/0/0.0
[edit]
user@switch# commit
• Run the show ethernet-switching interfaces operational mode command to see the state of STP
configured on the interface:
In this output, note that the et-0/0/0.0 interface is in blocked state because it has received
BPDUs from the end device.
• Run the show spanning-tree interfaces operational mode command to ensure that the et-0/0/0.0
interface is blocked:
• Run the show interfaces interface-name operational mode command to verify that the interface is
disabled:
For certain access switches, you might want interfaces on the switch not to shutdown on encountering
incompatible BPDU packets; instead, only drop incompatible BPDU packets while allowing the
remaining traffic to pass through. Such an interface must not have a spanning-tree protocol configured
on it, so that packets that pass through the interface will not cause STP misconfiguration and
consequent network outages.
To configure BPDU protection for an interface to only drop incompatible BPDU packets and to allow the
remaining traffic to pass through, while retaining the interface status as up:
NOTE: Ensure that the switch on which you are configuring BPDU protection is connected to a
peer device.
1. Delete or disable any spanning-tree protocol (for instance, RSTP as in this procedure) configured on
the switch or on any interface.
[edit]
user@switch# delete protocols rstp
164
Or,
[edit]
user@switch# set protocols rstp disable
• To delete a spanning-tree protocol on a specific interface (for example, et-0/0/0.0) on the switch:
[edit]
user@switch# set protocols rstp interface et-0/0/0.0 disable
2. Enable the BPDU protection on the interface (et-0/0/0.0 in this procedure) to drop BPDU packets:
[edit]
user@switch set layer2-control bpdu-block interface et-0/0/0.0 drop
[edit]
user@switch# commit
• Run the show ethernet-switching interfaces operational mode command to ensure that the the STP
state of the interface is forwarding:
In this output, note that the et-0/0/0.0 interface is up even though it has received incompatible
BPDU packets because the drop feature is configured for this interface.
• Run the show interfaces interface-name operational mode command to ensure that the et-0/0/0.0
interface is displayed in the output and that the State of the interface is Up:
In a spanning-tree topology, if a switch is an access switch then interfaces on that switch will be
connected to end devices such as PCs, servers, routers, or hubs, that are not connected to other
switches. You configure these interfaces as edge interfaces because they directly connect to end
devices.
Interfaces that are configured as edge interfaces can transition to a forwarding state immediately
because they cannot create network loops. A switch detects edge ports by noting the absence of
communication from the end stations. As edge ports are connected to end devices, it is imperative that
you configure BPDU protection on edge ports to avoid loops. If BPDU protection is enabled on an edge
interface, the interface shuts down on encountering ae BPDU thereby preventing any traffic from
passing through the interface. You can re-enable the interface by issuing the clear error bpdu interface
interface-name operational mode command. The clear error bpdu interface interface-name command will
only re-enable an interface but the BPDU configuration for the interface will continue to exist unless
you explicitly remove the BPDU configuration.
1. Configure any spanning-tree protocol on the switch if not configured already. RSTP is configured in
this procedure.
[edit protocols]
user@switch# set rstp
2. Enable RSTP on a specific interface and set a priority for the interface—for example, et-0/0/0.0:
[edit protocols]
user@switch# set rstp interface et-0/0/0.0 priority 16
3. Configure the et-0/0/0.0 interface as an edge interface and enable BPDU protection on that interface:
[edit protocols]
user@switch# set rstp bpdu-block-on-edge interface et-0/0/0.0 edge
167
[edit]
user@switch# commit
5. Verify that BPDU protection is configured properly on the edge interface (et-0/0/0.0):
• Run the show ethernet-switching interfaces operational mode command to see the state of STP
configured on the interface:
In this output, you note that the et-0/0/0.0 interface is in blocked state because it has received
BPDUs from the end device.
• Run the show spanning-tree interfaces operational mode command to ensure that the et-0/0/0.0
interface is blocked:
• Run the show interfaces interface-name operational mode command to verify that the interface is
disabled:
The following example, when used with a full bridge configuration with aggregated Ethernet, blocks
BPDUs on interface ae0 for 10 minutes (600 seconds) before enabling the interface again:
SEE ALSO
Understanding Root Protection for Spanning-Tree Instance Interfaces in a Layer 2 Switched Network
| 208
Checking the Status of Spanning-Tree Instance Interfaces | 232
IN THIS SECTION
Requirements | 170
Configuration | 173
NOTE: This example uses Junos OS for EX Series switches without support for the Enhanced
Layer 2 Software (ELS) configuration style. For ELS details, see Using the Enhanced Layer 2
Software CLI.
When BPDU protection is enabled, an interface shuts down or drops BPDU packets when any
incompatible BPDU is encountered, thereby preventing the BPDUs generated by spanning-tree
170
protocols from reaching the switch. When an interface is configured to drop BPDU packets, all traffic
except the incompatible BPDUs can pass through the interface.
NOTE: The BPDU drop feature can be specified only on interfaces on which no spanning-tree
protocol is configured.
This example configures BPDU protection on STP switch downstream interfaces that connect to two
PCs:
Requirements
This example uses the following hardware and software components:
Before you configure the interfaces on Switch 2 for BPDU protection, be sure you have:
• Disabled or enabled RSTP on Switch 2 (depending on the configuration that you plan to implement.)
If you want to enable the BPDU shutdown feature, then it is optional to disable spanning-tree
protocols on the interface.
IN THIS SECTION
Topology | 172
Figure 5 on page 172 shows the topology for this example. Switch 1 and Switch 2 are connected
through a trunk interface. Switch 1 is configured for RSTP while Switch 2 has a spanning-tree protocol
171
configured on it for the first scenario, and does not have a spanning-tree protocol configured on it for
the second scenario.
In the first scenario, this example configures downstream BPDU protection on Switch 2 interfaces
ge-0/0/5.0 and ge-0/0/6.0 when the default spanning-tree protocol (RSTP) is not disabled on these
interfaces. When BPDU protection is enabled, the shutdown statement is enabled by default, and the
switch interfaces will shut down if BPDUs generated by the laptops attempt to access Switch 2.
In the second scenario, this example configures downstream BPDU protection on Switch 2 interfaces
ge-0/0/5.0 and ge-0/0/6.0 when there is no spanning-tree protocol configured on these interfaces.
When BPDU protection is enabled with the drop statement, the switch interfaces drop only the BPDUs
while allowing remaining traffic to pass through and retaining their status as up if BPDUs generated by
the laptops attempt to access Switch 2.
Topology
Table 7 on page 172 shows the components that will be configured for BPDU protection.
Table 7: Components of the Topology for Configuring BPDU Protection on EX Series Switches
Property Settings
Switch 1 (Distribution Layer) Switch 1 is connected to Switch 2 through a trunk interface. Switch 1 is
configured for RSTP.
Switch 2 (Access Layer) Switch 2 has two downstream access ports connected to laptops:
• ge-0/0/5.0
• ge-0/0/6.0
173
Configuration
IN THIS SECTION
Procedure | 173
Procedure | 174
Procedure
This is the first scenario that explains configuration for the default BPDU block (action: shutdown). To
quickly configure BPDU protection on Switch 2, copy the following commands and paste them into the
switch terminal window:
[edit]
Step-by-Step Procedure
1. Configure the BPDU block (action: shutdown) on the downstream interface ge-0/0/5 on Switch 2:
[edit protocols]
user@switch# set layer2-control bpdu-block interface ge-0/0/5
174
2. Configure the BPDU block (action: shutdown) on the downstream interface ge-0/0/6 on Switch 2:
[edit protocols]
user@switch# set layer2-control bpdu-block interface ge-0/0/6
Results
Procedure
This is the second scenario that explains configuration for the drop statement. To quickly configure BPDU
protection on Switch 2 for the drop statement, copy the following commands and paste them into the
switch terminal window:
[edit]
NOTE: If xSTP is enabled on the interface, you must disable it before configuring BPDU drop
action: block. You can disable RSTP globally by using the delete protocols rstp, the set protocols
rstp disable, or the set protocols rstp interface all disable command.
Step-by-Step Procedure
1. Configure the BPDU drop statement on the downstream interface ge-0/0/5 on Switch 2:
2. Configure the BPDU drop statement on the downstream interface ge-0/0/6 on Switch 2:
Results
IN THIS SECTION
Eliminating Bridge Loops in Ethernet LANs with Spanning Tree Protocol | 179
Example: Configuring Loop Protection to Prevent Interfaces from Transitioning from Blocking to Forwarding
in a Spanning Tree on non-ELS EX Series Switches | 189
Example: Configuring Loop Protection to Prevent Interfaces from Transitioning from Blocking to Forwarding
in a Spanning Tree on EX Series Switches With ELS | 195
IN THIS SECTION
Loop protection increases the efficiency of STP, RSTP, and MSTP by preventing ports from moving into a
forwarding state that would result in a loop opening up in the network. Spanning-tree protocol loop
protection enhances the normal checks that spanning-tree protocols perform on interfaces. Loop
protection performs a specified action when BPDUs are not received on a nondesignated port interface.
You can choose to block the interface or issue an alarm when bridge protocol data units (BPDUs) are not
received on the port.
178
A loop-free network in spanning-tree topologies is supported through the exchange of a special type of
frame called bridge protocol data unit (BPDU). Peer STP applications running on the switch interfaces
use BPDUs to communicate. Ultimately, the exchange of BPDUs determines which interfaces block
traffic (preventing loops) and which interfaces become root ports and forward traffic.
However, a blocking interface can transition to the forwarding state in error if the interface stops
receiving BPDUs from its designated port on the segment. Such a transition error can occur when there
is a hardware error on the switch or software configuration error between the switch and its neighbor.
When loop protection is enabled, the spanning-tree topology detects root ports and blocked ports and
makes sure both keep receiving BPDUs. If a loop-protection-enabled interface stops receiving BPDUs
from its designated port, it reacts as it would react to a problem with the physical connection on this
interface. It does not transition the interface to a forwarding state, but instead transitions it to a loop-
inconsistent state. The interface recovers and then it transitions back to the spanning-tree blocking state
as soon as it receives a BPDU.
By default, a spanning-tree protocol interface that stops receiving bridge protocol data unit (BPDU) data
frames will transition to the designated port (forwarding) state, creating a potential loop.
The spanning-tree protocol family is responsible for breaking loops in a network of bridges with
redundant links. However, hardware failures can create forwarding loops (STP loops) and cause major
network outages. Spanning-tree protocols break loops by blocking ports (interfaces). However, errors
occur when a blocked port transitions erroneously to a forwarding state.
Ideally, a spanning-tree protocol bridge port remains blocked as long as a superior alternate path to the
root bridge exists for a connected LAN segment. This designated port is determined by receiving
superior BPDUs from a peer on that port. When other ports no longer receive BPDUs, the spanning-tree
protocol considers the topology to be loop free. However, if a blocked or alternate port moves into a
forwarding state, this creates a loop.
To prevent a spanning-tree instance interface from interpreting a lack of received BPDUs as a “false
positive” condition for assuming the designated port role, you can configure one of the following loop
protection options:
179
• Configure the router to raise an alarm condition if the spanning-tree instance interface has not
received BPDUs during the timeout interval.
• Configure the router to block the spanning-tree instance interface if the interface has not received
BPDUs during the timeout interval.
NOTE: Spanning-tree instance interface loop protection is enabled for all spanning-tree instances
on the interface, but blocks or alarms only those instances that stop receiving BPDUs.
You can configure spanning-tree protocol loop protection to improve the stability of Layer 2 networks.
We recommend you configure loop protection only on non-designated interfaces such as the root or
alternate interfaces. Otherwise, if you configure loop protection on both sides of a designated link, then
certain STP configuration events (such as setting the root bridge priority to an inferior value in a
topology with many loops) can cause both interfaces to transition to blocking mode.
We recommend that you enable loop protection on all switch interfaces that have a chance of becoming
root or designated ports. Loop protection is most effective when enabled in the entire switched
network. When you enable loop protection, you must configure at least one action (log, block, or both).
NOTE: An interface can be configured for either loop protection or root protection, but not for
both.
By default (that is, without spanning-tree protocol loop protection configured), an interface that stops
receiving BPDUs will assume the designated port role and possibly result in a spanning-tree protocol
loop.
IN THIS SECTION
The Spanning Tree Protocol (STP) is a network protocol that is used to eliminate bridge loops in Ethernet
LANs. STP prevents network loops and associated network outage by blocking redundant links or paths.
The redundant paths can be used to keep the network operational if the primary link fails.
The sections describe bridge loops and how STP helps eliminate them.
To understand bridge loops, consider a scenario in which four switches (or bridges) are connected to
four different subsections (Subsection i, ii, iii, and iv) where each subsection is a collection of network
nodes (see Figure 6 on page 181). For simplicity, Subsection i and Subsection ii are combined to form
Section 1. Similarly, Subsection iii and Subsection iv are combined to form Section 2.
181
When the switches are powered on, the bridge tables are empty. If User A in Subsection i tries to send a
single packet Packet 1 to User D in Subsection iv, all the switches, which are in listening mode, receive
the packet. The switches make an entry in their respective bridging tables, as shown in the following
table:
182
ID | Port Facing Direction ID | Port Facing Direction ID | Port Facing Direction ID | Port Facing Direction
At this point, the switches do not know where Subsection iv is, and the packet is forwarded to all the
ports except the source port (which results in flooding of the packet). In this example, after Subsection 1
sends the packet, the switches receive the packet on the ports facing Section 1. As a result, they start
forwarding the packet through the ports facing Section 2. Which switch gets the first chance to send out
the packet depends on the network configuration. In this example, suppose Switch 1 transmits the
packet first. Because it received the packet from Section 1, it floods the packet toward Section 2.
Similarly, Switches 2, 3, and 4, which are also in listening mode, receive the same packet from Switch 1
(originally sent from Section 1) on the ports facing Section 2. They readily update their bridging tables
with incorrect information, as shown in the following table:
ID | Port Facing Direction ID | Port Facing Direction ID | Port Facing Direction ID | Port Facing Direction
Thus, a loop is created as the same packet is received both from Section 1 and Section 2. As illustrated
in Figure 6 on page 181, Switch 1 has information that the packet came from Subsection i in Section 1,
whereas all other switches have incorrect information that the same packet came from Section 2.
The entire process is repeated when Switch 2 gets the chance to transmit the original packet. Switch 2
receives the original packet from Section 1 and transmits the same packet to Section 2. Eventually,
Switch 1, which still has no idea where Subsection iv is, updates its bridging table, as shown in the
following table:
183
ID | Port Facing Direction ID | Port Facing Direction ID | Port Facing Direction ID | Port Facing Direction
In complex networks, this process can quickly lead to huge packet transmission cycles as the same
packet is sent repeatedly.
Spanning Tree Protocol helps eliminate loops in a network by turning off additional routes that can
create a loop. The blocked routes are enabled automatically if the primary path gets deactivated.
To understand the steps followed by STP in eliminating bridge loops, consider the following example
where three switches are connected to form a simple network (see Figure 7 on page 184). To maintain
redundancy, more than one path exists between each device. The switches communicate with each
other by using Bridge Protocol Data Units (BPDUs) sent every 2 seconds.
NOTE: BPDUs are frames that consist of bridge ID, the bridge port where it originates, the
priority of the bridge port, cost of the path and so on. BPDUs are sent as multicast MAC address
01:80:c2:00:00:00. BPDUs can be of three types: configuration BPDUs, topology change
notification (TCN) BPDUs, and topology change acknowledgment (TCA) BPDUs.
184
To eliminate network loops, STP performs the following steps in this sample network:
1. Elects a root bridge (or switch). To elect a root switch, STP uses the bridge ID. The bridge ID is 8
bytes in length and consists of two parts. The first part is 2 bytes of information known as bridge
priority. The default bridge priority is 32,768. In this example, the default value is used for all the
switches. The remaining 6 bytes consist of the MAC address of the switch. In this example, Switch1
is elected as the root switch because it has the lowest MAC address.
2. Elects the root ports. Typically, root ports use the least-cost paths from one switch to the other. In
this example, assume that all paths have similar costs. Therefore, the root port for Switch 2 is the
port that receives packets through the direct path from Switch 1 (cost 4), because the other path is
through Switch 3 (cost 4 + 4) as shown in Figure 8 on page 185. Similarly, for Switch 3, the root port
is the one that uses the direct path from Switch 1.
185
3. Selects the designated ports. Designated ports are the only ports that can receive and forward
frames on switches other than the root switch. They are generally the ports that use the least-cost
paths. In Figure 9 on page 185, the designated ports are marked.
Because there is more than one path involved in the network and the root ports and designated ports
are identified, STP can block the path between Switch 2 and Switch 3 temporarily, eliminating any Layer
2 loops.
In a Layer 2 environment, you can configure various spanning-tree protocol versions to create a loop-
free topology in Layer 2 networks.
A spanning-tree protocol is a Layer 2 control protocol (L2CP) that calculates the best path through a
switched network containing redundant paths. A spanning-tree protocol uses bridge protocol data unit
(BPDU) data frames to exchange information with other switches. A spanning-tree protocol uses the
information provided by the BPDUs to elect a root bridge, identify root ports for each switch, identify
designated ports for each physical LAN segment, and prune specific redundant links to create a loop-
free tree topology. The resulting tree topology provides a single active Layer 2 data path between any
two end stations.
NOTE: In discussions of spanning-tree protocols, the terms bridge and switch are often used
interchangeably.
The Juniper Networks MX Series 5G Universal Routing Platforms and EX Series switches support STP,
RSTP, MSTP, and VSTP.
• The original Spanning Tree Protocol (STP) is defined in the IEEE 802.1D 1998 specification. A newer
version called Rapid Spanning Tree Protocol (RSTP) was originally defined in the IEEE 802.1w draft
specification and later incorporated into the IEEE 802.1D-2004 specification. A recent version called
Multiple Spanning Tree Protocol (MSTP) was originally defined in the IEEE 802.1s draft specification
and later incorporated into the IEEE 802.1Q-2003 specification. The VLAN Spanning Tree Protocol
(VSTP) is compatible with the Per-VLAN Spanning Tree Plus (PVST+) and Rapid-PVST+ protocols
supported on Cisco Systems routers and switches.
• RSTP provides faster reconvergence time than the original STP by identifying certain links as point to
point and by using protocol handshake messages rather than fixed timeouts. When a point-to-point
link fails, the alternate link can transition to the forwarding state without waiting for any protocol
timers to expire.
• MSTP provides the capability to logically divide a Layer 2 network into regions. Every region has a
unique identifier and can contain multiple instances of spanning trees. All regions are bound together
using a Common Instance Spanning Tree (CIST), which is responsible for creating a loop-free
topology across regions, whereas the Multiple Spanning-Tree Instance (MSTI) controls topology
within regions. MSTP uses RSTP as a converging algorithm and is fully interoperable with earlier
versions of STP.
187
• VSTP maintains a separate spanning-tree instance for each VLAN. Different VLANs can use different
spanning-tree paths. When different VLANs use different spanning-tree paths, the CPU processing
resources being consumed increase as more VLANs are configured. VSTP BPDU packets are tagged
with the corresponding VLAN identifier and are transmitted to the multicast destination media
access control (MAC) address 01-00-0c-cc-cc-cd with a protocol type of 0x010b. VSTP BPDUs are
tunneled by pure IEEE 802.1q bridges.
NOTE: All virtual switch routing instances configured on an MX Series router are supported
using only one spanning-tree process. The Layer 2 control protocol process is named l2cpd.
This example blocks and logs the non-designated RSTP port ge-1/2/0 after the BPDU timeout interval
expires:
[edit]
protocols {
rstp {
interface ge-1/2/0 {
bpdu-timeout-action block;
}
}
}
NOTE: This is not a complete configuration. You must also fully configure RSTP, including the
ge-1/2/0 interface.
Before you begin, you must fully configure the spanning-tree protocol, including instance interfaces. You
can configure RSTP, MSTP, or VSTP at the following hierarchy levels:
• [edit protocols]
188
1. Include the bpdu-timeout-action statement with either the block or log option for the spanning-tree
protocol interface.
[edit]
protocols {
rstp {
interface interface-name {
bpdu-timeout-action (log | block);
}
}
}
[edit]
protocols {
mstp {
interface interface-name {
bpdu-timeout-action (log | block);
}
}
}
• For all VSTP instances on a physical interface configured at the global level or a the VLAN level:
[edit]
protocols {
vstp {
interface interface-name {
bpdu-timeout-action (log | block);
}
vlan vlan-id {
interface interface-name {
bpdu-timeout-action (log | block);
}
189
}
}
}
2. To display the spanning-tree protocol loop protection characteristics on an interface, use the show
spanning-tree interface operational command.
IN THIS SECTION
Requirements | 189
Configuration | 192
Verification | 193
EX Series switches provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree protocol (RSTP), and Multiple Spanning Tree Protocol (MSTP). Loop protection increases
the efficiency of STP, RSTP, and MSTP by preventing interfaces from moving into a forwarding state that
would result in a loop opening up in the network.
This example describes how to configure loop protection for an interface on an EX Series switch in an
RSTP topology:
Requirements
This example uses the following hardware and software components:
Before you configure the interface for loop protection, be sure you have:
IN THIS SECTION
Topology | 191
A loop-free network in spanning-tree topologies is supported through the exchange of a special type of
frame called bridge protocol data unit (BPDU). Peer STP applications running on the switch interfaces
use BPDUs to communicate. Ultimately, the exchange of BPDUs determines which interfaces block
traffic (preventing loops) and which interfaces become root ports and forward traffic.
A blocking interface can transition to the forwarding state in error if the interface stops receiving BPDUs
from its designated port on the segment. Such a transition error can occur when there is a hardware
error on the switch or software configuration error between the switch and its neighbor. When this
happens, a loop opens up in the spanning tree. Loops in a Layer 2 topology cause broadcast, unicast, and
multicast frames to continuously circle the looped network. As a switch processes a flood of frames in a
looped network, its resources become depleted and the ultimate result is a network outage.
CAUTION: An interface can be configured for either loop protection or root protection,
but not for both.
Three EX Series switches are displayed in Figure 10 on page 191. In this example, they are configured
for RSTP and create a loop-free topology. Interface ge-0/0/6 is blocking traffic between Switch 3 and
Switch 1; thus, traffic is forwarded through interface ge-0/0/7 on Switch 2. BPDUs are being sent from
the root bridge on Switch 1 to both of these interfaces.
This example shows how to configure loop protection on interface ge-0/0/6 to prevent it from
transitioning from a blocking state to a forwarding state and creating a loop in the spanning-tree
topology.
191
Topology
Table 11 on page 191 shows the components that will be configured for loop protection.
Table 11: Components of the Topology for Configuring Loop Protection on EX Series Switches
Property Settings
• The root port is responsible for forwarding data to the root bridge.
192
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
• The designated port forwards data to the downstream network segment or device.
This configuration example uses an RSTP topology. However, you also can configure loop protection for
STP or MSTP topologies at the [edit protocols (mstp | stp)] hierarchy level.
Configuration
IN THIS SECTION
Procedure | 192
Procedure
[edit]
set protocols rstp interface ge-0/0/6 bpdu-timeout-action
block
Step-by-Step Procedure
Results
Verification
IN THIS SECTION
Purpose
Before loop protection is triggered on interface ge-0/0/6, confirm that the interface is blocking.
Action
Meaning
The output from the operational mode command show spanning-tree interface shows that ge-0/0/6.0 is
the alternate port and in a blocking state.
Purpose
Verify the loop protection configuration on interface ge-0/0/6. RSTP has been disabled on interface
ge-0/0/4 on Switch 1. This will stop BPDUs from being sent to interface ge-0/0/6 and trigger loop
protection on the interface.
Action
Meaning
The operational mode command show spanning-tree interface shows that interface ge-0/0/6.0 has
detected that BPDUs are no longer being forwarded to it and has moved into a loop-inconsistent state.
The loop-inconsistent state prevents the interface from transitioning to a forwarding state. The interface
recovers and transitions back to its original state as soon as it receives BPDUs.
IN THIS SECTION
Requirements | 196
Configuration | 198
Verification | 199
NOTE: This example uses Junos OS for EX Series switches with support for the Enhanced Layer
2 Software (ELS) configuration style. If your switch runs software that does not support ELS, see
"Example: Configuring Loop Protection to Prevent Interfaces from Transitioning from Blocking to
Forwarding in a Spanning Tree on non-ELS EX Series Switches" on page 177. For ELS details, see
Using the Enhanced Layer 2 Software CLI.
EX Series switches provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree protocol (RSTP), and Multiple Spanning Tree Protocol (MSTP). Loop protection increases
the efficiency of STP, RSTP, and MSTP by preventing interfaces from moving into a forwarding state that
would result in a loop opening up in the network.
196
This example describes how to configure loop protection for an interface on an EX Series switch in an
RSTP topology:
Requirements
This example uses the following software and hardware components:
Before you configure the interface for loop protection, be sure you have:
IN THIS SECTION
Topology | 197
A loop-free network in spanning-tree topologies is supported through the exchange of a special type of
frame called bridge protocol data unit (BPDU). Peer STP applications running on the switch interfaces
use BPDUs to communicate. Ultimately, the exchange of BPDUs determines which interfaces block
traffic (preventing loops) and which interfaces become root ports and forward traffic.
A blocking interface can transition to the forwarding state in error if the interface stops receiving BPDUs
from its designated port on the segment. Such a transition error can occur when there is a hardware
error on the switch or software configuration error between the switch and its neighbor. When this
happens, a loop opens up in the spanning tree. Loops in a Layer 2 topology cause broadcast, unicast, and
multicast frames to continuously circle the looped network. As a switch processes a flood of frames in a
looped network, its resources become depleted and the ultimate result is a network outage.
CAUTION: An interface can be configured for either loop protection or root protection,
but not for both.
Three EX Series switches are displayed in Figure 11 on page 197. In this example, they are configured
for RSTP and create a loop-free topology. Interface ge-0/0/6 is blocking traffic between Switch 3 and
197
Switch 1; thus, traffic is forwarded through interface ge-0/0/7 on Switch 2. BPDUs are being sent from
the root bridge on Switch 1 to both of these interfaces.
This example shows how to configure loop protection on interface ge-0/0/6 to prevent it from
transitioning from a blocking state to a forwarding state and creating a loop in the spanning-tree
topology.
Topology
Table 12 on page 197 shows the components that will be configured for loop protection.
Table 12: Components of the Topology for Configuring Loop Protection on EX Series Switches
Property Settings
Table 12: Components of the Topology for Configuring Loop Protection on EX Series Switches
(Continued)
Property Settings
• The root port is responsible for forwarding data to the root bridge.
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
• The designated port forwards data to the downstream network segment or device.
This configuration example uses an RSTP topology. However, you also can configure loop protection for
MSTP topologies at the [edit protocols mstp ] hierarchy level.
Configuration
IN THIS SECTION
Procedure | 198
Procedure
[edit]
set protocols rstp interface ge-0/0/6 bpdu-timeout-action
block
199
Step-by-Step Procedure
Results
Verification
IN THIS SECTION
Purpose
Before loop protection is triggered on interface ge-0/0/6, confirm that the interface is blocking.
200
Action
Meaning
The output from the operational mode command show spanning-tree interface shows that ge-0/0/6 is the
alternate port and in a blocking state.
Purpose
Verify the loop protection configuration on interface ge-0/0/6. RSTP has been disabled on interface
ge-0/0/4 on Switch 1. This will stop BPDUs from being sent to interface ge-0/0/6 and trigger loop
protection on the interface.
Action
Meaning
The operational mode command show spanning-tree interface shows that interface ge-0/0/6 has detected
that BPDUs are no longer being forwarded to it and has moved into a loop-inconsistent state. The loop-
inconsistent state prevents the interface from transitioning to a forwarding state. To clear the BPDU
error, issue the operational mode command clear error bpdu interface on the switch. The interface
recovers and transitions back to its original state as soon as it receives BPDUs.
SEE ALSO
Example: Configuring Faster Convergence and Network Stability on ELS Devices with RSTP | 32
6 CHAPTER
IN THIS SECTION
Understanding Bridge Priority for Election of Root Bridge and Designated Bridge | 208
Understanding Root Protection for Spanning-Tree Instance Interfaces in a Layer 2 Switched Network | 208
Configuring VPLS Root Protection Topology Change Actions to Control Individual VLAN Spanning-Tree
Behavior | 211
Example: Configuring Root Protection to Enforce Root Bridge Placement in Spanning Trees on non-ELS EX
Series Switches | 213
Example: Configuring Root Protection to Enforce Root Bridge Placement in Spanning Trees on EX Series
Switches With ELS | 220
IN THIS SECTION
Redundancy is built into many networks through the use of alternate links and paths, which often take
the shape of rings. When multiple hosts are attached to customer edge (CE) routers and provider edge
(PE) routers to secure virtual private LAN service (VPLS), this technique is often called multihoming.
204
Figure 12 on page 204 shows hosts connected to CE routers and to a VPLS network through two PE
routers. The CE routers are also connected, forming a kind of ring structure.
Benefits of Multihoming
Multihoming multihoming is basically giving your computing device or network a presence on more than
one network. When both links are up, both links are fully utilized, increasing overall throughput. If one of
the links fails, the other still carries traffic so you have redundancy.
Multihoming is used in network bridges, repeaters, range extenders, firewalls, proxy servers, gateways,
and when using a virtual machine, configured to use network address translation (NAT).
205
The two PE routers have their own links to a VPLS network service as shown in Figure 12 on page 204,
but are not directly connected to each other. All four edge routers run some type of spanning-tree
protocol with root protection enabled, and only one PE interface will be in the forwarding state, the
other being blocked.
Assume this forwarding interface is through PE1. If the link between CE1 and CE2 fails, then the
blocking PE2 interface must detect a root protection switch and move to the forwarding state. All of the
MAC addresses learned by CE2 that connect to the VPLS network service through PE1 need to be
flushed. In the same way, when the link between CE1 and CE2 is restored, PE2 again detects the root
protection switch and begins blocking again. Now all of the MAC addresses learned by CE2 that connect
through PE2 need to be flushed. All of this is controlled by configuring VPLS root protection topology
change actions on the CE routers.
The Layer 2 ring connects to the multiprotocol link switching (MPLS) infrastructure through two PE
routers. Link breaks on the ring are protected by running a version of the spanning-tree protocol with
the root-protect option enabled.
The virtual private network (VPN) protocols at Layer 3, however, are not aware of the blocking state that
results from this root protection setup (rings or loops are not permitted at Layer 2 because the Layer 2
protocols will not function properly).
Multiple hosts attach to CE routers, which are attached to each other as well as to the PE routers that
access the VPLS network cloud. Any single link between the edge routers can fail without impacting the
hosts’ access to the VPLS services.
At a global level, each type of spanning-tree protocol has a priority hold time associated with it. This is
the number of seconds, in the range from 1 through 255 seconds, that the system waits to switch to the
primary priority when the first core domain comes up. The default is 2 seconds. This allows the
maximum number of core domains to come up, and some might be slower than others.
The default number of seconds to hold before switching to the primary priority when the first core
domain comes up is 2 seconds.
When an MX Series router or an EX Series switch in a VPLS multihomed Layer 2 ring is running a
spanning-tree protocol with root protection enabled, you can modify the default actions taken by the
router or switch when the topology changes. To do this, configure the VPLS root protection topology
change actions.
You can include the statement at the [edit protocols (mstp | rstp | vstp)] hierarchy level (to control global
spanning-tree protocol behavior) or at the [edit protocols vstp vlan vlan-id] hierarchy level (to control a
particular VLAN).
206
NOTE: VPLS root topology change actions are configured independently of VPLS, the spanning-
tree protocol, or the spanning-tree protocol root protect option.
By default, if root protect is enabled and then the topology changes, the bridges do not flush the media
access control (MAC) address cache of the MAC addresses learned when other interface ports were
blocked.
To change the default behavior, you can use the statement vpls-flush-on-topology-change.
You can include the statement at the [edit protocols (mstp | rstp | vstp)] hierarchy level (to control global
spanning-tree protocol behavior) or at the [edit protocols vstp vlan vlan-id] hierarchy level (to control a
particular VLAN).
Specifically, MAC flush messages are sent from the blocked PE to LDP peers based on the mapping of
system identifier to IP addresses as specified using the system-id statement.
NOTE: VPLS root topology change actions are configured independently of VPLS, the spanning-
tree protocol, or the spanning-tree protocol root protect option.
However, to keep the Layer 2 ring functioning in a multihomed environment with link failures, the
spanning-tree protocol running on the MX Series routers requires the following additional configuration:
The VPN protocols have to act on the blocking and unblocking of interfaces by the spanning-tree
protocol. Specifically, media access control (MAC) flush messages need to be sent by the blocking PE
router to LDP peers in order to flush the MAC addresses learned when other interface ports were
blocked.
Also, if an active PE router with VPLS root protection bridging enabled loses VPLS connectivity, root
protection requires that the bridge switch to the other PE router to maintain connectivity. The spanning-
tree protocol needs to be aware of the status of the VPLS connectivity on the PE router. If the MAC
address cache is not flushed when the topology changes, frames could be sent to the wrong device.
You can control the actions taken by the MX Series router when the topology changes in a multihomed
Layer 2 ring VPLS environment using VPLS root protection.
207
When an MX Series router or an EX Series switch in a VPLS multihomed Layer 2 ring is running a
spanning-tree protocol with root protection enabled, you can modify the default actions taken by the
router or switch when the topology changes. To do this, configure the VPLS root protection topology
change actions.
The system identifier for bridges in the ring is not configured by default.
You can include the statement at the [edit protocols (mstp | rstp | vstp)] hierarchy level (to control global
spanning-tree protocol behavior) or at the [edit protocols vstp vlan vlan-id] hierarchy level (to control a
particular VLAN).
NOTE: VPLS root topology change actions are configured independently of VPLS, the spanning-
tree protocol, or the spanning-tree protocol root protect option.
When an MX Series router or EX Series switch in a VPLS multihomed Layer 2 ring is running a spanning-
tree protocol with root protection enabled, you can modify the default actions taken by the router or
switch when the topology changes. To do this, configure the VPLS root protection topology change
actions.
The default value of the backup bridge is 32,768. You can set the backup bridge priority to a value from
0 through 61440, in increments of 4096.
To change the default value, you can use the following statement backup-bridge-priority vpls-ring-backup-
bridge-priority
You can include the statement at the [edit protocols (mstp | rstp | vstp)] hierarchy level (to control global
spanning-tree protocol behavior) or at the [edit protocols vstp vlan vlan-id] hierarchy level (to control a
particular VLAN).
NOTE: VPLS root topology change actions are configured independently of VPLS, the spanning-
tree protocol, or the spanning-tree protocol root protect option.
208
Use the bridge priority to control which bridge is elected as the root bridge and also to control which
bridge is elected the root bridge when the initial root bridge fails.
The root bridge for each spanning-tree protocol instance is determined by the bridge ID. The bridge ID
consists of a configurable bridge priority and the MAC address of the bridge. The bridge with the lowest
bridge ID is elected as the root bridge. If the bridge priorities are equal or if the bridge priority is not
configured, the bridge with the lowest MAC address is elected the root bridge.
The bridge priority can also be used to determine which bridge becomes the designated bridge for a
LAN segment. If two bridges have the same path cost to the root bridge, the bridge with the lowest
bridge ID becomes the designated bridge.
Consider a sample scenario in which a dual-homed customer edge (CE) router is connected to two other
provider edge (PE) routers, which function as the VPLS PE routers, with MSTP enabled on all these
routers, and with the CE router operating as the root bridge. Integrated Routing and Bridging (IRB)
interface is configured for the VPLS routing instances on the routers. In such a network, the MAC
addresses that are learned in the VPLS domain continuously move between the LSI or virtual tunnel (VT)
interfaces and the VPLS interfaces on both the PE routers. To avoid the continuous movement of the
MAC addresses, you must configure root protection by including the no-root-port statement at the [edit
routing-instances routing-instance-name protocols mstp interface interface-name] hierarchy level and configure
the bridge priority as zero by including the bridge priority 0 statement at the [edit routing-instances
routing-instance-name protocols mstp] hierarchy level on the PE routers. This configuration on the PE routers
is required to prevent the CE-side facing interfaces from becoming the root bridge.
IN THIS SECTION
Peer STP applications running on interfaces use BPDUs to communicate. Ultimately, the exchange of
BPDUs determines which interfaces block traffic and which interfaces become root ports and forward
traffic.
A root port elected through this process has the possibility of being wrongly elected. A user bridge
application running on a PC can generate BPDUs, too, and interfere with root port election. This is when
root protection is useful.
Root protection allows network administrators to manually enforce the root bridge placement in a
Layer 2 switched network.
When root protection is enabled on an interface, it is enabled for all the STP instances on that interface.
If the bridge receives superior BPDUs on a port that has root protect enabled, that port transitions to a
root-prevented STP state and the interface is blocked. This prevents a bridge that should not be the root
bridge from being elected the root bridge. The interface is blocked only for instances for which it
receives superior BPDUs. Otherwise, it participates in the spanning-tree topology.
After the bridge stops receiving superior BPDUs on the port with root protect enabled and the received
BPDUs time out, that port transitions back to the STP-designated port state.
NOTE: An interface can be configured for either root protection or loop protection, but not for
both.
Enable root protection on interfaces that should not receive superior bridge protocol data units (BPDUs)
from the root bridge and must not be elected as the root port.
Interfaces that become designated ports are typically located on an administrative boundary. If the
bridge receives superior STP BPDUs on a port that has root protection enabled, that port transitions to a
root-prevented STP state (inconsistency state) and the interface is blocked. This blocking prevents a
bridge that should not be the root bridge from being elected the root bridge. After the bridge stops
receiving superior STP BPDUs on the interface with root protection, the interface returns to a listening
state, followed by a learning state, and ultimately back to a forwarding state. Recovery back to the
forwarding state is automatic.
210
This example configures a bridge priority of 36k, a backup bridge priority of 44k, a priority hold time
value of 60 seconds, a system identifier of 000203:040506 for IP address 10.1.1.1/32, and sets the
bridge to flush the MAC cache on a topology change for MSTP only.
[edit]
protocols {
mstp {
bridge-priority 36k;
backup-bridge-priority 44k;
priority-hold-time 60;
system-id 000203:040506 {
10.1.1.1/32;
}
vpls-flush-on-topology-change;
}
}
[edit]
user@host# edit protocols (mstp | rstp | vstp <vlan vlan-id>)
[edit ... protocols (mstp | rstp | vstp <vlan vlan-id>) interface interface-name]
user@host# set no-root-port
4. Verify the configuration of root protect for the spanning-tree instance interface:
[edit ... protocols (mstp | rstp | vstp <vlan vlan-id>) interface interface-name]
user@host# top
user@host# show ... protocols
...
(mstp | rstp | vstp <vlan vlan-id>) {
interface interface-name {
no-root-port;
}
}
To configure VPLS root protection topology change actions to control a particular VLAN:
[edit]
user@host# edit protocols (STP Type) vstp vlan vlan-id
2. (Optional) Change the priority of the backup bridge in a VPLS multihomed Layer 2 ring with MPLS
infrastructure:
3. (Optional) Change the hold time before switching to the primary priority when the first core domain
comes up:
The system-id-value is configured in the format nnnnnn:nnnnnn, where n = any digit from 0 to 9.
NOTE: There are no default values for the system identifier or host IP addresses.
5. Configure bridges to flush the MAC address cache (of the MAC addresses learned when other
interfaces ports were blocked) when the spanning-tree topology changes:
6. Verify the configuration of VPLS root protection topology change actions to control a particular
VLAN:
[edit]
protocols {
vstp {
vlan vlan-id {
backup-bridge-priority priority; # Default is 32,768.
priority-hold-time seconds; # Default is 2 seconds.
system-id system-id-value {
ip-address;
}
vpls-flush-on-topology-change;
}
}
}
213
IN THIS SECTION
Requirements | 213
Configuration | 216
Verification | 217
EX Series switches provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree protocol (RSTP), and Multiple Spanning Tree Protocol (MSTP). Root protection increases
the efficiency of STP, RSTP, and MSTP by allowing network administrators to manually enforce the root
bridge placement in the network.
This example describes how to configure root protection on an interface on an EX Series switch:
Requirements
This example uses the following hardware and software components:
Before you configure the interface for root protection, be sure you have:
IN THIS SECTION
Topology | 216
214
Peer STP applications running on switch interfaces exchange a special type of frame called a bridge
protocol data unit (BPDU). Switches communicate interface information using BPDUs to create a loop-
free topology that ultimately determines the root bridge and which interfaces block or forward traffic in
the spanning tree.
However, a root port elected through this process has the possibility of being wrongly elected. A user
bridge application running on a PC can generate BPDUs, too, and interfere with root port election.
To prevent this from happening, enable root protection on interfaces that should not receive superior
BPDUs from the root bridge and should not be elected as the root port. These interfaces are typically
located on an administrative boundary and are designated ports.
• The interface is blocked only for instances for which it receives superior BPDUs. Otherwise, it
participates in the spanning-tree topology.
CAUTION: An interface can be configured for either root protection or loop protection,
but not for both.
Four EX Series switches are displayed in Figure 13 on page 215. In this example, they are configured for
RSTP and create a loop-free topology. Interface ge-0/0/7 on Switch 1 is a designated port on an
administrative boundary. It connects to Switch 4. Switch 3 is the root bridge. Interface ge-0/0/6 on
Switch 1 is the root port.
This example shows how to configure root protection on interface ge-0/0/7 to prevent it from
transitioning to become the root port.
215
Table 13 on page 215 shows the components that will be configured for root protection.
Table 13: Components of the Topology for Configuring Root Protection on EX Series Switches
Property Settings
Table 13: Components of the Topology for Configuring Root Protection on EX Series Switches
(Continued)
Property Settings
Switch 2 Switch 2 is connected to Switch 1 and Switch 3. Interface ge-0/0/4 is the alternate port in the RSTP
topology.
Switch 3 Switch 3 is the root bridge and is connected to Switch 1 and Switch 2.
Switch 4 Switch 4 is connected to Switch 1. After root protection is configured on interface ge-0/0/7, Switch 4
will send superior BPDUs that will trigger root protection on interface ge-0/0/7.
• The root port is responsible for forwarding data to the root bridge.
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
• The designated port forwards data to the downstream network segment or device.
This configuration example uses an RSTP topology. However, you also can configure root protection for
STP or MSTP topologies at the [edit protocols (mstp | stp)] hierarchy level.
Topology
Configuration
IN THIS SECTION
Procedure | 217
Procedure
To quickly configure root protection on interface ge-0/0/7, copy the following command and paste it
into the switch terminal window:
[edit]
set protocols rstp interface ge-0/0/7 no-root-port
Step-by-Step Procedure
Results
Verification
IN THIS SECTION
Purpose
Before root protection is triggered on interface ge-0/0/7, confirm the interface state.
Action
Meaning
The output from the operational mode command show spanning-tree interface shows that ge-0/0/7.0 is a
designated port in a forwarding state.
219
Purpose
A configuration change takes place on Switch 4. A smaller bridge priority on the Switch 4 causes it to
send superior BPDUs to interface ge-0/0/7. Receipt of superior BPDUs on interface ge-0/0/7 will
trigger root protection. Verify that root protection is operating on interface ge-0/0/7.
Action
Meaning
The operational mode command show spanning-tree interface shows that interface ge-0/0/7.0 has
transitioned to a root inconsistent state. The root inconsistent state makes the interface block,
discarding any received BPDUs, and prevents the interface from becoming a candidate for the root port.
When the root bridge no longer receives superior STP BPDUs from the interface, the interface will
recover and transition back to a forwarding state. Recovery is automatic.
220
IN THIS SECTION
Requirements | 220
Configuration | 223
Verification | 224
NOTE: This example uses Junos OS for EX Series switches with support for the Enhanced Layer
2 Software (ELS) configuration style. For ELS details, see Using the Enhanced Layer 2 Software
CLI.
EX Series switches provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid
Spanning Tree protocol (RSTP), and Multiple Spanning Tree Protocol (MSTP). Root protection increases
the efficiency of STP, RSTP, and MSTP by allowing network administrators to manually enforce the root
bridge placement in the network.
This example describes how to configure root protection on an interface on an EX Series switch:
Requirements
This example uses the following software and hardware components:
Before you configure the interface for root protection, be sure you have:
IN THIS SECTION
Topology | 223
Peer STP applications running on switch interfaces exchange a special type of frame called a bridge
protocol data unit (BPDU). Switches communicate interface information using BPDUs to create a loop-
free topology that ultimately determines the root bridge and which interfaces block or forward traffic in
the spanning tree.
However, a root port elected through this process has the possibility of being wrongly elected. A user
bridge application running on a PC can generate BPDUs, too, and interfere with root port election.
To prevent this from happening, enable root protection on interfaces that must not receive superior
BPDUs from the root bridge and must not be elected as the root port. These interfaces are typically
located on an administrative boundary and are designated ports.
• The interface is blocked only for instances for which it receives superior BPDUs. Otherwise, it
participates in the spanning-tree topology.
CAUTION: An interface can be configured for either root protection or loop protection,
but not for both.
Four EX Series switches are displayed in Figure 14 on page 222. In this example, they are configured for
RSTP and create a loop-free topology. Interface ge-0/0/7 on Switch 1 is a designated port on an
administrative boundary. It connects to Switch 4. Switch 3 is the root bridge. Interface ge-0/0/6 on Switch
1 is the root port.
This example shows how to configure root protection on interface ge-0/0/7 to prevent it from
transitioning to become the root port.
222
Table 14 on page 222 shows the components that will be configured for root protection.
Table 14: Components of the Topology for Configuring Root Protection on EX Series Switches
Property Settings
Table 14: Components of the Topology for Configuring Root Protection on EX Series Switches
(Continued)
Property Settings
Switch 2 Switch 2 is connected to Switch 1 and Switch 3. Interface ge-0/0/4 is the alternate port in the RSTP
topology.
Switch 3 Switch 3 is the root bridge and is connected to Switch 1 and Switch 2.
Switch 4 Switch 4 is connected to Switch 1. After root protection is configured on interface ge-0/0/7, Switch 4
will send superior BPDUs that will trigger root protection on interface ge-0/0/7.
• The root port is responsible for forwarding data to the root bridge.
• The alternate port is a standby port for the root port. When a root port goes down, the alternate port
becomes the active root port.
• The designated port forwards data to the downstream network segment or device.
This configuration example uses an RSTP topology. However, you also can configure root protection for
STP or MSTP topologies at the [edit protocols mstp ] hierarchy level.
Topology
Configuration
IN THIS SECTION
Procedure | 224
Procedure
To quickly configure root protection on interface ge-0/0/7, copy the following command and paste it into
the switch terminal window:
[edit]
set protocols rstp interface ge-0/0/7 no-root-port
Step-by-Step Procedure
Results
Verification
IN THIS SECTION
Purpose
Before root protection is triggered on interface ge-0/0/7, confirm the interface state.
Action
Meaning
The output from the operational mode command show spanning-tree interface shows that ge-0/0/7 is a
designated port in a forwarding state.
Purpose
A configuration change takes place on Switch 4. A smaller bridge priority on the Switch 4 causes it to
send superior BPDUs to interface ge-0/0/7. Receipt of superior BPDUs on interface ge-0/0/7 will trigger
root protection. Verify that root protection is operating on interface ge-0/0/7.
Action
[output truncated]
Meaning
The operational mode command show spanning-tree interface shows that interface ge-0/0/7 has transitioned
to a root inconsistent state. The root inconsistent state makes the interface block, discarding any
received BPDUs, and prevents the interface from becoming a candidate for the root port. When the root
bridge no longer receives superior STP BPDUs from the interface, the interface will recover and
transition back to a forwarding state. Recovery is automatic.
7 CHAPTER
IN THIS SECTION
Unblocking a Switch Interface That Receives BPDUs in Error (CLI Procedure) | 236
Unblocking an Interface on non-ELS EX Series Switches That Receives BPDUs in Error (CLI Procedure) | 237
Checking for a MAC Rewrite Error Condition Blocking a Spanning-Tree Instance Interface | 238
Clearing a MAC Rewrite Error Condition Blocking a Spanning-Tree Instance Interface | 239
Clearing a MAC Rewrite Error on an Interface with Layer 2 Protocol Tunneling | 239
IN THIS SECTION
Purpose | 230
Action | 230
Meaning | 230
230
Purpose
Use the monitoring feature to view status and information about the spanning-tree protocol parameters
on your EX Series switch.
Action
To display spanning-tree protocol parameter details in the J-Web interface, select Monitor > Switching >
STP.
To display spanning-tree protocol parameter details in the CLI, enter the following commands:
Meaning
Field Values
Bridge Parameters
The bridge ID consists of a configurable bridge priority and the MAC address of
the bridge.
Root cost Calculated cost to reach the root bridge from the bridge where the command is
entered.
231
Field Values
Root port Interface that is the current elected root port for this bridge.
Hello time The time for which the bridge interface remains in the listening or learning state.
Forward delay The time for which the bridge interface remains in the listening or learning state
before transitioning to the forwarding state.
Maximum age Maximum age of received bridge protocol data units (BPDUs).
Number of topology changes Total number of spanning-tree protocol topology changes detected since the
switch last booted.
Designated Port ID Port ID of the designated port for the LAN segment to which the interface is
attached.
Field Values
• Forwarding (FWD)
• Blocking (BLK)
• Listening
• Learning
• Disabled
Role MSTP or RSTP port role, Designated (DESG), backup (BKUP), alternate (ALT), or
root.
Next BPDU Transmission Number of seconds until the next BPDU is scheduled to be sent.
On an MX Series router with a spanning-tree protocol enabled, the detection of a possible bridging loop
from spanning-tree protocol operation can raise a bridge protocol data unit (BPDU) error condition on
the affected spanning-tree instance interface.
To check whether a spanning-tree instance interface is blocked due to a BPDU error condition:
233
1. To check the status of spanning-tree instance interface, use the show interfaces command:
• If the BPDU Error field is Detected and the link is down, the interface is blocked.
In order to trace spanning-tree protocol operations, you can set spanning-tree protocol-specific trace
options in the spanning-tree protocol configuration.
For general information about tracing and global tracing options, see the statement summary for the
global traceoptions statement in the Junos OS Routing Protocols Library for Routing Devices.
You can enable global routing protocol tracing options at the [edit routing-options] Hierarchy Level. For
general information about tracing and global tracing options, see the statement summary for the global
traceoptions statement in the Junos OS Routing Protocols Library for Routing Devices.
In addition, you can enable STP-specific trace options at the following hierarchy levels:
[edit]
user@host# edit ... protocols (mstp | rstp | vstp)
NOTE: Use the trace flag all with caution. This flag may cause the CPU to become very
busy.
b. To disable an individual spanning-tree protocol-specific option, include the disable option with the
flag statement.
5. Verify the spanning-tree protocol-specific trace options:
[edit]
...
routing-options {
traceoptions {
...global-trace-options-configuration...
}
}
}
protocols {
(mstp | rstp | vstp) {
traceoptions { # Spanning-tree protocol-specific.
file filename <files number> <size bytes> <world-readable | no-world-
readable>;
flag flag <flag-modifier> <disable>;
}
}
}
...
236
[edit]
routing-options {
traceoptions {
file routing-log size 10m world-readable;
flag all;
}
}
protocols {
rstp {
traceoptions {
file rstp-log size 10m world-readable;
flag all;
}
}
}
EX Series and QFX Series switches use bridge protocol data unit (BPDU) protection on interfaces to
prevent them from receiving BPDUs that could trigger a spanning-tree misconfiguration. If BPDUs are
received on a BPDU-protected interface, the interface either shuts down or transitions to a blocking
state and stops forwarding frames. In the latter scenario, after the misconfiguration that triggered the
BPDUs being sent to an interface is fixed in the topology, the interface can be unblocked and returned
to service.
NOTE: This topic applies to Junos OS for EX Series and QFX switches with support for the
Enhanced Layer 2 Software (ELS) configuration style. For switches that do not support ELS, see
"Unblocking an Interface on non-ELS EX Series Switches That Receives BPDUs in Error (CLI
Procedure)" on page 237. For ELS details, see Using the Enhanced Layer 2 Software CLI.
All interfaces on the switch will be reenabled (unblocked) after the timer expires. However, once an
interface on the switch receives a new spanning-tree protocol BPDU, the interface returns to the
blocked state.
This command will only reenable an interface but the BPDU configuration for the interface will
continue to exist unless you remove the BPDU configuration explicitly.
EX Series switches use bridge protocol data unit (BPDU) protection on interfaces to prevent them from
receiving BPDUs that could trigger a spanning-tree misconfiguration. If BPDUs are received on a BPDU-
protected interface, the interface either shuts down or transitions to a blocking state and stops
forwarding frames. In the latter scenario, after the misconfiguration that triggered the BPDUs being sent
to an interface is fixed in the topology, the interface can be unblocked and returned to service.
[edit ethernet-switching-options]
user@switch# set bpdu-block disable-timeout 30
All interfaces on the switch will be re-enabled (unblocked) after the timer expires. However, once an
interface on the switch receives a new spanning-tree protocol BPDU, the interface returns to the
blocked state.
238
This command will only re-enable an interface but the BPDU configuration for the interface will
continue to exist unless you remove the BPDU configuration explicitly.
To clear the blocked status of a spanning-tree instance interface on routers or on switches running
Junos OS with support for the Enhanced Layer 2 Software (ELS) configuration style:
• To clear the blocked status of a spanning-tree instance interface on switches running Junos OS that
does not support ELS, use the clear ethernet-switching bpdu-error interface command. See
"Unblocking an Interface on non-ELS EX Series Switches That Receives BPDUs in Error (CLI
Procedure)" on page 237 for details.
NOTE: When you configure BPDU protection on individual interfaces (as opposed to on all the
edge ports of the bridge), you can use the disable-timeout seconds option to specify that a blocked
interface is automatically cleared after the specified time interval elapses (unless the interval is 0).
To check whether an interface or a spanning-tree instance interface is blocked due to a MAC rewrite
error condition:
239
• If the value in the Physical interface includes Enabled, Physical link is Up and the value of the
BPDU Error field is None, the interface is enabled
• If the value in the Physical interface field is Enabled, Physical link is Down and the value in the
BPDU Error field is Detected, the interface is blocked.
On devices with Layer 2 protocol tunneling (L2PT) configured, customer-facing ports should not receive
packets with the L2PT MAC address as the destination address unless you have a network topology or
configuration error. Under these conditions, when an interface with L2PT enabled receives an L2PT
packet, the interface state becomes disabled due to a MAC rewrite error, and you must subsequently re-
enable it to continue operation.
1. To check whether an interface with L2PT enabled has become disabled due to a MAC rewrite error
condition, use the show interfaces operational command:
If the interface status includes Disabled, Physical link is Down or Enabled, Physical link is Down and the
MAC-REWRITE Error field is Detected, then the device detected a MAC rewrite error that contributed to the
240
interface being down. When the device did not detect any MAC rewrite errors, the MAC-REWRITE Error
field is None.
For example, the following output shows the device detected a MAC rewrite error on the given
interface:
2. On routers, QFX Series switches, and EX Series switches that use the Enhanced Layer 2 Software
configuration style, you can clear a MAC rewrite error from the Junos CLI.
To clear a MAC rewrite error from an interface that has L2PT enabled, use the clear error mac-rewrite
operational command:
The forwarding delay timer specifies the length of time a spanning-tree protocol bridge port remains in
the listening and learning states before transitioning to the forwarding state. Setting the interval too
short could cause unnecessary spanning-tree reconvergence. Before changing this parameter, you
should have a thorough understanding of spanning-tree protocols.
8 CHAPTER
We've consolidated all Junos CLI commands and configuration statements in one place. Learn about the
syntax and options that make up the statements and commands and understand the contexts in which
you’ll use these CLI elements in your network configurations and operations.
Click the links to access Junos OS and Junos OS Evolved configuration statement and command
summary topics.
• Configuration Statements
• CLI Commands