|SMCROUTED(8)||System Manager's Manual (smm)||SMCROUTED(8)|
smcroutedis a static multicast routing daemon providing fine grained control over the multicast forwarding cache (MFC) in the UNIX kernel. Both IPv4 and IPv6 are fully supported.
smcroutedcan be used as an alternative to dynamic multicast daemons like mrouted(8), pimd(8) or pim6sd(8) in situations where static multicast routes should be maintained and/or no proper IGMP or MLD signaling exists. Multicast routes exist in the UNIX kernel only as long as a multicast routing daemon is running. On Linux, multiple multicast routers can run simultaneously using different multicast routing tables. To run
mroutedat the same time, set the former to use a routing table other than the default (0).
smcroutedmodifies the kernel routing table and needs either full superuser rights, or
CAP_NET_ADMINon Linux. This also applies to the friendly control tool smcroutectl(8).
smcroutedenables multicast routing on all available, and multicast capable, interfaces in the system. These interfaces are enumerated as VIFs, virtual interfaces, of which most UNIX systems have a very limited amount, usually 32. This daemon option inverts the behavior so no interfaces are enabled by default. Useful on systems with many interfaces, where multicast routing only makes use of a few. The config file setting phyint IFNAME enable is required to enable the required interfaces.
-lLEVEL to increase verbosity. Returns non-zero on error.
smcroutectl flushcommand, which can be called manually on topology changes.
smcroutedhas loaded/reloaded all static multicast routes from the configuration file, or when a source-less (ANY) rule has been installed.
-Ifoo would make
/etc/foo.conf, write its PID to
/var/run/foo.pidand create an IPC socket for
smcroutectlthe same option can be used to select the proper
smcroutedinstance to send IPC to. This option is required for both daemon and client when running multiple
smcroutedinstances, using multiple routing tables, on Linux.
smcroutedis built with mrdisc support (Linux, and IPv4, only). RFC4286.
smcroutedis built with libcap support.
-iNAME. Regardless, setting this option overrides all others, but it is recommended to use the ident option instead.
ip mrule add iif eth0 lookup 123 ip mrule add oif eth0 lookup 123
Note:Only available on Linux.
smcroutectl. Use this to override the default socket path, derived from the daemon identity,
-iNAME. This option can be useful when overriding the identity is not sufficient, e.g. for testing. The default depends on how
smcroutedis configured at build time, see FILES.
-eCMD option is useful if you want to trigger other processes to start when
smcroutedhas completed installing dynamic multicast routes from (*,G) rules in /etc/smcroute.conf, or when a source-less (ANY) route, a.k.a (*,G) multicast rule, from /etc/smcroute.conf. is matched and installed. For instance, calling conntrack on Linux to flush firewall connection tracking when NAT:ing multicast. The script CMD is called with an argument reload or install to let the script know if it is called on SIGHUP/startup, or when a (*,G) rule is matched and installed. In the latter case
smcroutedalso sets two environment variables:
group. Beware that these environment variables are unconditionally overwritten by
smcroutedand can thus not be used to pass information to the script from outside of
smcroutedstarts up it scans for available network interfaces that have the
MULTICASTflag set. Provided the
-Nflag is not set, each interface is enumerated as a virtual interface (VIF) which is what the kernel's multicast routing stack uses. The enumeration process on some operating systems also require each interface to have an IP address, but Linux and FreeBSD systems only require the ifindex and the MULTICAST flag. If the interface does not yet exist when
-dSEC flag can be used to delay startup. Otherwise
smcroutedneeds to be reloaded (e.g., using SIGHUP) when a new interface has been added to the system. Since VIFs are a limited resource, most operating systems only support 32 in total, the administrator may need to declare which interfaces to use for multicast routing using the /etc/smcroute.conf
phyintdirective. It is recommended to always start
-Nflag, disabling VIF creation by default, and then selectively enable each of the interfaces you are going to route between. See smcroute.conf(5) for more information.
Administrative scoping (RFC2365)
smcroutedthis is left to the administrator to manage. See mrouted(8), and mrouted.conf(5), for more details.
mroute from eth0 group 220.127.116.11 to eth1 eth2 mroute from eth0 source 18.104.22.168 group 22.214.171.124 to eth1 eth2 mroute from eth0 group ff2e::42 to eth1 eth2 mroute from eth0 source 2001:3::1 group ff2e::43 to eth1 eth2
smcroutectl removecommand. The first three parameters are sufficient to identify the source of the multicast route. The intended purpose of
smcroutedis to aid in situations where dynamic multicast routing does not work properly. However, a dynamic multicast routing protocol is in nearly all cases the preferred solution. The reason for this is their ability to translate Layer-3 signaling to Layer-2 and vice versa (IGMP or MLD). Note: the optional source address multicast routes are not installed in the kernel multicast forwarding cache (MFC) by
smcrouted. Instead, it dynamically installs new routes to the kernel MFC, matching the group and inbound interface, when the kernel notifies
smcroutedusing "upcalls" called
NOCACHEmessages. This feature was grafted onto
smcroutedfrom mrouted(8), and may not work as intended in all use-cases.
smcroutedis capable of simple group join and leave by sending commands to the kernel. The kernel then handles sending Layer-2 IGMP/MLD join and leave frames as needed. This can be used for testing but is also useful sometimes to open up multicast from the sender if located on a LAN with switches equipped with IGMP/MLD Snooping. Such devices will prevent forwarding of multicast unless an IGMP/MLD capable router or multicast client is located on the same physical port as you run
smcroutedon. However, this feature of
smcroutedis only intended as a workaround. Some platforms impose a limit on the maximum number of groups that can be joined, some of these systems can be tuned to increase this limit. For bigger installations it is strongly recommended to instead address the root cause, e.g. enable multicast router ports on intermediate switches, either statically or by enabling the multicast router discovery feature of
smcrouted. To emulate a multicast client using
smcroutedyou use the
leavecommands to issue join and leave commands for a given multicast group on a given interface IFNAME. The GROUP may be given in an IPv4 or IPv6 address format. The command is passed to the daemon that passes it to the kernel. The kernel then tries to join the multicast group GROUP on interface IFNAME by starting IGMP, or MLD for IPv6 group address, signaling on the given interface. This signaling may be received by routers/switches connected on that network supporting IGMP/MLD multicast signaling and, in turn, start forwarding the requested multicast stream eventually reach your desired interface.
smcroutedinstances, using the
-tID command line flag, one per routing table on Linux, it is required to use the
-iNAME option to both daemon and client. This because the name of the IPC socket used for communicating is composed from the identity. ping(8) or iperf(1). Either of which is capable of creating multicast traffic with an adjustable TTL. Iperf in particular is useful since it can act both as a multicast source (sender) and a multicast sink (receiver). For more advanced IP multicast testing the mcjoin(1) tool can be used.
smcrouted -s -l debug’ to enable.
smcroutedwrites its process ID to /var/run/smcroute.pid upon startup, unless the
-iNAME options are used to change the identity or file name used. The following signals are supported:
smcroutedto reload its configuration file and activate the changes.
smcrouted. Defined interfaces to use, groups to join, and routes to set when starting, or reloading
smcroutedon SIGHUP. Like the PID file, the name of the configuration file may be different depending on command line options given to the daemon. Most notably,
-IIDENT defines the full suite of files used by the
smcrouteddaemon. See smcroute.conf(5) for details.
smcroutedwhen it has started up and is ready to receive commands. See also the
-PFILE options which can change the default name.
smcroutedfor use by
smcroutectl. Same caveats apply to this file as the previous two, command line options
-SFILE to the daemon can be used to change the socket file name.
smcroutedleverages BSD sysexits.h exit codes (64-78), which process supervisors like systemd(1) and finit(8) understands. The following table details what codes are used for and how to interpret them.
|64||EX_USAGE||Invalid command line option, or missing argument|
|69||EX_UNAVAILABLE||Multicast routing socket (or table) already in use|
|79||EX_SOFTWARE||Internal error, bug in
|76||EX_PROTOCOL||Kernel does not seem to support multicast routing|
|77||EX_NOPERM||Not enough permissions to run|
|78||EX_CONFIG||Parse error in configuration file|
|August 15, 2021||Debian|