Hi everyone,
I am trying to write a script that needs to look at the port role in the bridge table.
For example, here is the stats print output of the bridging table.
> interface bridge port print stats
Flags: X - disabled, I - inactive, D - dynamic
0 interface=ether1 bridge=ap priority=0x80 path-cost=10 edge=auto point-to-point=auto external-fdb=auto status=in-bridge
port-number=1 role=designated-port edge-port=no edge-port-discovery=yes point-to-point-port=no external-fdb=no
sending-rstp=yes learning=yes forwarding=yes
1 I interface=ether2 bridge=ap priority=0x80 path-cost=10 edge=auto point-to-point=auto external-fdb=auto status=in-bridge
port-number=2 role=disabled-port edge-port=no edge-port-discovery=yes point-to-point-port=no external-fdb=no
sending-rstp=yes learning=no forwarding=no
2 I interface=ether3 bridge=ap priority=0x80 path-cost=10 edge=auto point-to-point=auto external-fdb=auto status=in-bridge
port-number=3 role=disabled-port edge-port=no edge-port-discovery=yes point-to-point-port=no external-fdb=no
sending-rstp=yes learning=no forwarding=no
3 D interface=wds1 bridge=ap priority=0x80 path-cost=100 edge=no point-to-point=yes external-fdb=no status=in-bridge
port-number=4 role=root-port edge-port=no edge-port-discovery=no point-to-point-port=yes external-fdb=no
sending-rstp=yes learning=yes forwarding=yes root-path-cost=180 designated-bridge=0x8000.00:0C:42:06:40:65
designated-cost=80 designated-port-number=4
Now I would like to pull the role out into a variable, however all I am getting is nothing.
> :put [/interface bridge port find inactive=no disabled=no ]
*0,*8
> :put [/interface bridge port get *0 interface ]
ether1
> :put [/interface bridge port get *0 role ]
>
Where that should return “designated-port.” I also cannot use the find argument to locate the interface either:
> :put [/interface bridge port find inactive=no disabled=no role=designated-port ]
>
The version we are currently running is 2.9.50
I guess my question is there a reason I cannot pull this information or is there another way to get the value? Am I able to parse the output of the print stats to get the role value?
Thanks.
Kevin