mctl —
mctl |
[ -hmptv ]
[-i
NAME ]
[-u
FILE ]
[COMMAND ] |
mctl queries a running
mcd(8) over its IPC
socket and shows the queriers, the group memberships and the multicast state
of the bridge. Without a command it runs
show.
Most bridge state comes from the iproute2 tools
ip(8) and
bridge(8), and from
jq(1). Their BusyBox
versions are not enough, use
check to
confirm.
-h,
--help
- Show usage and, when
mcd is running,
the available commands.
-i,
--ident=NAME
- Talk to an
mcd started with the same
-i
NAME.
-m,
--monitor
- Run the command every two seconds, like
watch(1).
-p,
--plain
- Plain table headings, no terminal control characters. Implied for JSON
output.
-t,
--no-heading
- Skip table headings.
-u,
--ipc=FILE
- IPC socket, default derived from the identity. Also settable with the
MCD_SOCK environment variable.
-v,
--version
- Show version and exit.
-C,
--complete
WORD...
- Used by the shell completion scripts. Prints the candidates for the last
word, which may be partial, from the running daemon's command list, one
per line. Prints nothing when no daemon is running.
Output width follows the terminal.
Completion scripts for
bash(1) and
zsh(1) are installed
with
mctl. The commands come from the
running daemon, so they are not completed while it is down.
Commands can be abbreviated, e.g.
s i for
show interfaces. Adding
json to a
show command gives machine readable output.
show
[igmp
]
[json
]
- Overview: global settings, bridge port roles, the queriers and the group
memberships. In JSON the queriers are split in
“multicast-queriers” for IGMP and
“mld-queriers” for MLD.
show
status
[json
]
- Global settings.
show
interfaces
[json
]
- One row per interface and protocol: VLAN, protocol, elected querier,
state, query interval, querier timeout, MRD and protocol version. The JSON
output also has the interface's
router-timeout, the other querier
present interval.
show
groups
[json
]
- IGMP and MLD group memberships, as seen by the bridge.
show
router-ports
[json
]
- Multicast router ports, grouped per bridge.
show
routers
[json
]
- Multicast routers heard through Multicast Router Discovery, RFC 4286, per
interface and protocol: address, advertisement interval, query interval,
robustness and seconds until the entry expires. An entry goes when its
router sends a termination, or after three advertisement intervals of
silence. Routers are heard whether or not
mrd is on for the interface.
show
mdb
- The bridge multicast forwarding database, as
‘
bridge mdb show’ but readable.
check
- Verify that the tools listed above are available.
version
- Show the version of the running
mcd.
help
- List the commands the running
mcd
supports.
MCD_SOCK
- IPC socket path, overridden by
-u.
- /run/mcd.sock
- Default IPC socket, follows the identity. The group owner is set at build
time, see ‘
configure
--with-group’.
$ mctl show interfaces
Interface VID Proto Querier State Interval Timeout MRD Ver
vlan1 IGMP 192.168.1.1 Up 125 None on 3
vlan1 MLD fe80::7a4c:9bff:fe12:3456 Up 125 None on 2
br0 42 IGMP 0.0.0.0 Up 125 None off 3
br0 42 MLD :: Up 125 None off 2
The IPC protocol is plain text, one command per connection, so other programs
can use it directly:
echo "show igmp json" | socat - UNIX-CONNECT:/run/mcd.sock
mcd.conf(5),
mcd(8)
mctl is maintained by
Joachim Wiberg,
Tobias Waldekranz and the KernelKit team,
https://kernelkit.org.
See
mcd(8) for its
history.