Before beginning the spanning tree protocol

Before we bring the bridges up with the spanning tree protocol enabled, we’ll first:

Configure bridge to use the spanning tree protocol

On each bridge node, bring down the bridge interface:

sudo ip link set br0 down

and then run

sudo brctl stp br0 on

to turn on the spanning tree algorithm. Run

brctl show br0

and confirm that you see a “yes” in the “STP enabled” column on each bridge.

Also make a node of each bridge’s bridge ID, which is displayed as 16 hex digits. The bridge ID is formed by concatenating a priority value and the MAC address of the br0 interface:

Identify the bridge that has the lowest bridge ID. This is the bridge that would be the root bridge, if all of the bridges were active.

Lab report: Show the brctl show br0 output for each bridge (include the prompt, so that it is evident which bridge each output is from). Which bridge would be elected the root bridge in the spanning tree (if you did not change any bridge priority)?

Understanding the showstp outut

We will monitor the progress of the spanning tree protocol on the bridges by watching the output of

brctl showstp br0

on each bridge.

In this output, make a note of where to find:

Initially, before you bring any bridge up, each bridge considers itself to be the root bridge. However, by exchanging BPDUs, they will eventually converge and all agree on the same root bridge.

Change bridge priority

The experiment procedure is easier to describe and follow along with as a group if we all have the same root bridge in our networks. Therefore, we will set the priority of one bridge to be lower than the rest, so that this bridge will definitely be the root bridge.

On “bridge-2”, run

sudo brctl setbridgeprio br0 0x7000

to set the bridge priority to 0x7000 (this is lower than the default 0x8000, so this bridge will have the lowest bridge ID in the network and will become the root bridge).

Run

brctl showstp br0

and verify that this change was applied.

Lab report: After changing the priority on “bridge-2”, which bridge do you expect will be the root bridge in the spanning tree?