Skip to main content

User Manual

Disabling STP support on a router switch port

In some cases, when connecting home clients to the router via wire (TV, NAS, computer, TV set-top box, etc.), you may notice a constant connection loss/recovery on the network port. This may be related to the STP (Spanning Tree Protocol), which is used in Keenetic routers to organise a Mesh Wi-Fi System.

In this case, you can see messages like these in the router's system log (in the example shown, the problem is on port 2):

[I] 01:08:14 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link up at port 2 (1000FD/AN). 
[I] 01:08:14 kernel: br0: port 1(eth2.1) entered blocking state 
[I] 01:08:14 kernel: br0: port 1(eth2.1) entered listening state 
[I] 01:08:17 kernel: br0: port 1(eth2.1) entered learning state 
[I] 01:08:18 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link down at port 2. 
[I] 01:08:18 kernel: br0: port 1(eth2.1) entered blocking state 
[I] 01:08:18 kernel: br0: port 1(eth2.1) entered listening state 
[I] 01:08:21 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link up at port 2 (1000FD/AN). 
[I] 01:08:21 kernel: br0: port 1(eth2.1) entered blocking state 
[I] 01:08:21 kernel: br0: port 1(eth2.1) entered listening state 
[I] 01:08:24 kernel: br0: port 1(eth2.1) entered learning state 
[I] 01:08:27 kernel: br0: port 1(eth2.1) entered forwarding state 
[I] 01:08:27 kernel: br0: topology change detected, propagating

Starting with KeeneticOS 3.4.1, the STP protocol has been added to prevent loops. This protocol is used for all wired connections in a Wi-Fi System.

When the topology changes, the STP tree is rebuilt in the built-in switch through the stages of blocking > listening > learning > forwarding.

When a port is brought up from the off state (a network client connects to it), the router has to check if switching it on will cause a loop. To do this, it temporarily blocks communication (entered blocking state) and examines incoming network packets (entered listening state and then learning state). This takes some time, and data transmission through all local ports is blocked for a few seconds. When the router realises it is safe to switch on the port and does not cause a loop, data transmission resumes (entered forwarding state).

STP triggering can also occur if there are devices on the router's LAN that frequently change the Ethernet connection state (e.g. due to a bad wired connection). Here is an example of a log when there is frequent "twitching" of the link on port 2:

[I] 08:43:10 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link up at port 2 (1000FD/AN). 
[I] 08:43:21 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link down at port 2. 
[I] 08:43:23 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link up at port 2 (1000FD/AN). 
[I] 08:43:36 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link down at port 2. 
[I] 08:43:38 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link up at port 2 (1000FD/AN). 
[I] 08:43:50 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link down at port 2. 
[I] 08:43:53 ndm: Network::Interface::Switch: "GigabitEthernet0/1": switch link up at port 2 (1000FD/AN).

This behaviour leads to a rearrangement of the STP topology and, as a consequence, to the disconnection of the link for a short period of time. To avoid such behaviour, you can disable the STP protocol on the network port of the built-in switch to which the end equipment is connected. For this purpose, starting from KeeneticOS 3.5 version, a special command role iseg has been added.

On the router (Wi-Fi System Controller), through the command-line interface (CLI), execute the role iseg command so that the router does not react to link changes on the port.

For example, to disable STP on port 2 of the switch, run the commands in sequence:

interface GigabitEthernet0/1 role iseg
system configuration save

Important

Do not connect a Keenetic Extender captured in a Wi-Fi System to the port on which the role iseg command is used, as this will create a loop.