SMCROUTE.CONF(5)
π SMCROUTE.CONF π
okay bestie, so this is smcroute.conf from the File Formats Manual β it's literally the config file format for smcrouted and we're gonna go through every single bit of it together π«Ά
β¨ NAME β¨
smcroute.conf β the config file format for smcrouted π
πΈ DESCRIPTION πΈ
okay so first things first, plot twist: the file smcroute.conf is, strictly speaking, not critical to how smcrouted runs. like, some warnings might get logged, and as long as the daemon wasn't started with -N, it just enables VIFs for every interface it can find and then vibes, waiting for commands from smcroutectl(8). but likeβ¦ as you can tell from that caveat, any non-trivial setup literally requires an smcroute.conf. no cap. π
On most systems the configuration file(s) live in:
/etc/smcroute.confβ the traditional location, holding all the routes, group joins, and interfaces./etc/smcroute.d/*.confβ recently an include directive got added tosmcroute.conf, which lets you include other files. by convention/etc/smcroute.d/has been chosen as the default in the bundled examplesmcroute.conf. more on the include directive below, bestie.
In debug mode, smcrouted logs the success of parsing each line and setting up a route. there's also a basic syntax validator built-in, see smcrouted(8) for more info. π₯
π SYNTAX π
this section spills the tea on the syntax of each of the available config file directives.
Comments start with β#β and run to the end of line. See the βEXAMPLEβ below. β
phyint IFNAME [enable | disable] [mrdisc] [ttl-threshold TTL]β By default all interfaces on the system are enabled and possible to route between, provided they have theMULTICASTinterface flag set. Thephyintdirective can be used to selectively enable, or disable, interfaces from being mapped to virtual interfaces (VIFs), which the multicast routing stack actually employs. VIFs are limited, most operating systems only have 32, so it is recommended to disable all interfaces by default, withsmcrouted -N, and enable them one by one using this directive.mrdiscis an IPv4 specific feature flag to enable Multicast Router Discovery protocol, RFC4286, announcement. This standard is supported by some switch (and router) manufacturers and may be used instead of havingmgroupstatements for all possible multicast groups you may want to forward.ttl-thresholdis a very useful setting to help implement "TTL scoping". I.e., the minimum TTL level a multicast stream must exceed for the kernel to consider it to be routed. The default value (1) means a TTL of 2 or higher is needed for a frame to be forwarded to the routing stack, otherwise it is considered link-local. Seesmcrouted(8)for more information on multicast scoping.
Note: allphyintdirectives must be read bysmcroutedbefore anymgroupormroutethat refer to them! Hence, either place allphyintdirectives in the mainsmcroute.confor, if/etc/smcroute.d/*.confis used, first in a file named,00-phyint.conf, or similar.
mgroup from IIF [source SOURCE[/LEN]] group GROUP[/LEN]β Join a multicast group, with optional prefix length, on a given inbound interface (IIF). The source address is optional, but if given a source specific (SSM) join is performed. Every/LENis translated to as many sources and groups as specified. To attempt to overcome (configured) kernel limitations,smcroutedprobes the amount of joins available per socket. When the socket has been exhausted, another one is opened. At most 2048 sockets are opened.- The purpose of joining groups is to use layer-2 signaling to inform switches, and other routers, to open up multicast traffic to your interfaces. Leaving a group is not supported from the configuration file, instead remove the
mgroup, or trim its arguments,SIGHUPorsmcrouβtectl reloadyour daemon.
- The purpose of joining groups is to use layer-2 signaling to inform switches, and other routers, to open up multicast traffic to your interfaces. Leaving a group is not supported from the configuration file, instead remove the
Note: use of the mgroup command should be avoided if possible. Instead configure "router ports" or similar on the switches (bridges) on your LAN. This to have them direct all the multicast to your router, or direct select groups if they have such capabilities. Usually MAC multicast filters exist.
mroute from IIF [source SOURCE[/LEN]] group GROUP[/LEN] to OIF [OIF ...]β Add a multicast route for packets received on network interface IIF, originating from IP address SOURCE, and sent to the multicast group address GROUP, to the outbound network interface(s) OIF [OIF ...].- The interfaces provided as IIF and OIF can be any network interface name available in the system, as long as it has the
MULTICASTflag set. Furthermore, the kernel usually only forwards traffic if the interface(s) have an IP address. These are limitations posed by the kernel, notsmcrouted. - To add a
(*,G)route, either leave SOURCE out completely or set it to0.0.0.0, and if you want to specify a range, setGROUP/LEN, e.g.225.0.0.0/24.
- The interfaces provided as IIF and OIF can be any network interface name available in the system, as long as it has the
include PATHβ Include anothersmcroute.conffile, or set of files. Matching is performed usingglob(3), and matches are sorted alphabetically. By convention, the examplesmcroute.confbundled withsmcroutedincludes/etc/smcroute.d/*.conf.
π¦ EXAMPLE π¦
smcrouted supports reading and setting up multicast routes from a config file. The default location is /etc/smcroute.conf, but this can be overridden using the -f FILE command line option.
The IIF and OIF arguments below are interface names, or interface wildcards of the form eth+, which matches eth0, eth10, etc. Wildcards are available for inbound interfaces. π
#
# smcroute.conf example
#
# Syntax:
# phyint IFNAME <enable|disable> [mrdisc] [ttl-threshold <1-255>]
# mgroup from IIF [source ADDR[/LEN]] group GROUP[/LEN]
# mroute from IIF [source ADDR[/LEN]] group GROUP[/LEN] to OIF [OIF ...]
# include /path/to/*.conf
# Assuming smcrouted was started with the `-N` flag. Enable interfaces
# required for inbound and outbound traffic. TTL scoping is enabled on
# all interfaces, e.g., to use eth0 as n outbound interface (OIF), all
# multicast frames must have a TTL of 12 or greater when ingressing.
phyint eth0 enable ttl-threshold 11
phyint eth1 enable ttl-threshold 3
phyint eth2 enable ttl-threshold 5
phyint virbr0 enable ttl-threshold 5
# Instruct the kernel to join the multicast group 225.1.2.3 on interface
# eth0. Then add an mroute of the same multicast stream, from the host
# 192.168.1.42 on interface eth0 and forward to eth1 and eth2.
mgroup from eth0 group 225.1.2.3
mroute from eth0 source 192.168.1.42 group 225.1.2.3 to eth1 eth2
# Similarly, but using source-specific group join
mgroup from virbr0 source 192.168.123.110 group 225.1.2.4
mroute from virbr0 source 192.168.123.110 group 225.1.2.4 to eth0
# Allow multicast for group 225.3.2.1, from ANY source, ingressing on
# interface eth0 to be forwarded to eth1 and eth2. When the kernel
# receives a frame from unknown multicast sender, it asks smcrouted who
# use this "template" to match against, if the ingressing interface and
# group matches, smcrouted installs an (S,G) route in the kernel MFC.
mgroup from eth0 group 225.3.2.1
mroute from eth0 group 225.3.2.1 to eth1 eth2
# The previous is an example of the (*,G) support. It is also possible
# to specify a range of such rules.
mgroup from eth0 group 225.0.0.0/24
mroute from eth0 group 225.0.0.0/24 to eth1 eth2
# Include any snippet in /etc/smcroute.d/, but please remember that
# all phyint statements must be read first.
include /etc/smcroute.d/*.conf
π CAVEATS π
bestie listen up, this part matters. The source address is optional for both IPv4 and IPv6 multicast routes, this is called (*,G) routing. When omitted, smcrouted dynamically installs (S,G) routes, matching the group and inbound interface, to the kernel when it learns of new inbound multicast. This feature was inherited from mrouted(8), and may not work as intended in all use-cases. Also, depending on kernel and CPU load, account for the setup time to detect and install the route β expect at least one initial frame to be lost when using (*,G) rules. π
π FILES π
/etc/smcroute.conf/etc/smcroute.d/*.conf
π SEE ALSO π
smcrouted(8), smcroute.conf(5)
π§ AUTHORS π§
SMCRoute was originally created by Carsten Schill <carsten@cschill.de>. Initial IPv6 support by Todd Hayton <todd.hayton@gmail.com>. Initial FreeBSD support by Micha Lenk <micha@debian.org>.
SMCRoute is currently maintained by Joachim Wiberg <troglobit@gmail.com>, and Micha Lenk <micha@debian.org> at GitHub: https://github.com/troglobit/smcroute
and that's the whole page, no notes π this was the Debian build, dated August 15, 2021 β slay, go configure your multicast routes bestie, you got this π«Άβ¨
π¦ where this page comes from
- debian bookworm: smcroute 2.5.6-1 Β· GPL-2.0-or-later
- debian trixie: smcroute 2.5.7-1 Β· GPL-2.0-or-later
- fedora 43: smcroute 2.5.7-4.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LicenseRef-Fedora-Public-Domain
- fedora 44: smcroute 2.5.7-5.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: smcroute 2.5.7
- opensuse-leap 16.0: smcroute 2.5.7-bp160.1.6 Β· GPL-3.0-only
- opensuse-leap 16.0: smcroute 2.5.7-bp160.1.6 Β· GPL-3.0-only
- opensuse-leap 16.0: smcroute 2.5.7-bp160.1.6 Β· GPL-3.0-only
- opensuse-leap 16.0: smcroute 2.5.7-bp160.1.6 Β· GPL-3.0-only
- ubuntu noble: smcroute 2.5.6-3 Β· GPL-2.0-or-later
- ubuntu questing: smcroute 2.5.7-1
- ubuntu resolute: smcroute 2.5.7-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: smcroute 2.5.7-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms