Goutam
Goutam

Reputation: 31

How to enable brctl stp using python script?

In mininet I am building a topology using LinuxBridge from mininet.nodelib.LinuxBridge) instead of OVSKernelSwitch.

s1 = net.addSwitch('s1', cls=LinuxBridge)

we can enable the stp of s1 from the command line by

brctl stp s1 on

How to enable the STP of the bridge s1 directly from the writing python script instead of CLI.

For example, in OVSKernelSwitch we write:

s1.cmd('ovs-vsctl set bridge s1 stp-enable=true')

to enable the stp to break the loop in the network topology.

What is the brctl stp enable script? I have tried with:

s1.cmd('brctl stp' , s1, 'on')

but it is unable to enable the stp.

Upvotes: 2

Views: 1935

Answers (1)

felipealencar
felipealencar

Reputation: 41

You could try using call procedures in your Python script. Example:

from subprocess import call
...
call('brctl stp s1 on')

Upvotes: 1

Related Questions