OPNsense Forum

English Forums => General Discussion => Topic started by: hsing on March 22, 2024, 10:19:46 AM

Title: Queries on Bridge RSTP Configuration
Post by: hsing on March 22, 2024, 10:19:46 AM
Hi all, I was wondering if anyone is familiar with configuring the Spanning Tree Protocol (RSTP/STP)? I've encountered some issues while attempting to configure the bridge interface, mainly involving the settings for Hello time (seconds) and Priority.

I tried modifying the settings using both the WebGUI and CLI methods, but neither yielded the expected results. Initially curious about the default value of Hello time (2 seconds), I wanted to reduce it to its minimum limit (1 second) for testing. However, when attempting to make this modification using the CLI command ifconfig bridge0 hellotime 1, I was met with the error message ifconfig: BRDGSHT 1: Operation not permitted, indicating that the operation was not allowed, hence I was unable to successfully change the Hello time to 1 second.

Furthermore, regarding the Priority setting, I noticed that the bridge's Priority is adjustable, but when I expected to change it to 10000, it turned out to be 8192 instead. I am curious if there is a fixed rule for this. In addition, the changes I made to the Priority Interface did not show any updates. The same goes for the Path cost.

I hope to receive help and guidance from everyone regarding the issues mentioned above with bridge RSTP settings. Thank you all!
Title: Re: Queries on Bridge RSTP Configuration
Post by: Patrick M. Hausen on March 22, 2024, 10:33:13 AM
The priority is not an arbitrary value but a choice from a fixed power-of-two-ish set if I am not mistaken.

According to the FreeBSD man page (https://man.freebsd.org/cgi/man.cgi?query=ifconfig&sektion=8&apropos=0&manpath=FreeBSD+13.3-STABLE) the minimum is 0 and the maximum 61440.

I found some documentation by Cisco (https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst4000/8-2glx/configuration/guide/spantree.html#wp1175769) that lists the possibly values as:
0
4096
8192
12,288
16,384
20,480
24,576
28,672
32,768
36,864
40,960
45,056
49,152
53,248
57,344
61,440


No idea about the hello timer in FreeBSD, sorry.
Title: Re: Queries on Bridge RSTP Configuration
Post by: hsing on March 25, 2024, 02:36:04 AM

Thank you very much for your response, your suggestions have been incredibly helpful to me! Regarding the setting of priority, I referred to the Cisco documentation you provided, and my tests show that it works as expected. As for the hello time aspect, I plan to further consult Cisco, FreeBSD, or other relevant documents to see if I can find a solution. Regardless, I want to express my sincere gratitude for the valuable advice you have provided. Thank you so much.  :D
Title: Re: Queries on Bridge RSTP Configuration
Post by: hsing on March 25, 2024, 08:52:41 AM
Hi everyone. Regarding the priority setting for bridge0, as replied by Patrick M. Hausen, the available parameters are as follows: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440. These parameters can be modified in both the WebGUI and CLI.

Additionally, as mentioned in the Priority (Interface) note, "Set the Spanning Tree priority of the interface to a value. The default is 128. The minimum is 0, and the maximum is 240, with increments of 16." I successfully modified it in the CLI using the ifconfig <bridge_interface> ifpriority <interface> <value> command, with parameters being multiples of 16, ranging from 16*1 to 16*15. Unexpectedly, I was unable to make the modifications via the WebGUI; I wonder if anyone else has encountered this issue?

Lastly, the same situation occurs with Path cost (Interface), where modifications using the CLI command ifconfig <bridge_interface> ifpathcost <interface> <value> were successful, with parameters ranging from 2000 to 2000*100000. However, I faced issues modifying it via the WebGUI as well. Has anyone else experienced this?

Thank you all!