I used to use “include=” myself but stop since it was always confusing – I could not see what actual interfaces made up a interface-list if they used include= via CLI or script or winbox.
This is likely impossible. “interface lists” aren’t really lists, they are bits set in a value related to every interface.
There does not seem to be a query function in RouterOS to ask which interfaces are (dynamic) member of a certain list.
My understanding is that when he has a list like the default “static” or “dynamic” lists, he wants to know which interfaces are member of that.
He does not want to get the word “static”, he wants a list of all interfaces that are considered static.
I understand the problem as if you do something like this
/interface list add name=EXAMPLE include=WAN,dynamic exclude=LAN,static"
How do you get the list of members of the EXAMPLE list?
Not saying a script couldn’t potentially get some list, but the lists can actually have multiple levels of hierechary too (e.g. /interface/list/add name=EXAMPLE2 include=EXAMPLE exclude=dynamic), it’s not so simple.
IMO, issue is /interface/list/member/print only shows the actual interface assignment, but NOT ones that are “include=” by reference in the list. Ideally, the print show the results of the EXAMPLE list AFTER applying the include= & exclude= – like how “D” items appear in /ip/firewall/address-list for DNS names resolved.
This was of course only an example. The actual situation is more complex than that, see the post by Amm0.
Also note that you can create your own dynamic lists, e.g. from a PPP profile.
without going into the ridiculousness of 3 or more linked lists, but remaining in practice…
and without going into the ridiculousness that one member of LAN is also a member of the WAN…
Just one fast example, without too much accuracy
/interface list add name=EXAMPLE include=WAN,dynamic exclude=LAN,static"
/interface
:foreach item in=[find where dynamic or ([:len [:find [:tostr [list member find where list="WAN"]] [:tostr $".id"]]] > 0) ] do={
:put [get $item name]
}
Even if ridiculous, you might still what to see just how ridiculous it is, somehow . These are typically used in a firewall, so as audit, be would good to know definitively what the actual interfaces the firewall would consider after processing include=/exclude=. Also why I stop using include= myself since "resolving by hand" get tricky quickly.
But more realistic is if you had a lot of VLANs and wanted to group them for the firewall, the top-level LAN might have include= of other lists (say "INTERNET_ONLY", "MGMT_ACCESS", "DMZ", etc.) used by firewall. You can obviously avoid by just putting an interface into multiple lists, but that isn't as structured as include= could be.
Just to clarify: I wanted a command that would list members of the list after building the dependency tree and then filtering per algorithm specified in the docs. This is useful mainly to verify that I got it right.