Need help with smcroute?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

137 Stars 42 Forks GNU General Public License v2.0 863 Commits 11 Opened issues


Static multicast routing for UNIX

Services available


Need anything else?

Contributors list

SMCRoute - A static multicast routing daemon

Packaging status License Badge Travis Status Coverity Status

Table of Contents


SMCRoute is a UNIX/Linux tool to manage and monitor multicast routes. It supports both IPv4 and IPv6 multicast routing.

SMCRoute can be used as an alternative to dynamic multicast routers like mrouted or pimd in setups where static multicast routes should be maintained and/or no proper IGMP or MLD signaling exists.

Multicast routes exist in the UNIX kernel as long as a multicast routing daemon runs. On Linux, multiple multicast routers can run simultaneously using different multicast routing tables.


  • Configuration file support,
  • Daemon startup options support,
  • Support for restarting and reloading the
  • Source-less on-demand routing, a.k.a. (*,G) based static routing
  • Optional built-in mrdisc support, RFC4286
  • Support for multiple routing tables on Linux
  • Client with built-in support to show routes and joined groups
  • Interface wildcard matching,
    eth0, eth15


smcrouted [-nNhsv] [-c SEC] [-d SEC] [-e CMD] [-f CONF] [-l LVL] [-p USER:GROUP] [-t ID]
smcroutectl [-Fkhv] [COMMAND] [⟨add | rem⟩ ⟨ROUTE⟩] [⟨join | leave⟩ ⟨GROUP⟩]

To set multicast routes and join groups you must first start the daemon, which needs root privileges, or

. Use
smcrouted -n
to run the daemon in the foreground, as required by modern init daemons like systemd and Finit.

By default

is started with
-n -s
options, i.e. the daemon runs in the foreground and uses syslog.

By default

if the file exists. More startup options could be specified in this file. For example, to raise log level for debug purpose:

By default

, which can look something like this:
mgroup from eth0 group
mgroup from eth0 group source
mroute from eth0 group source to eth1 eth2

The first line means "Join multicast group on interface eth0". Useful if

is not directly connected to the source, but to a LAN with switches with IGMP snooping. Joining the group opens up multicast for that group towards
. See below Caveat for limitations.

The second

is for source specific group join, i.e. the host specifies that it wants packets from and no other source.

The third

line is the actual layer-3 routing entry. Here we say that multicast data originating from on
to the multicast group should be forwarded to interfaces

Note: To test the above you can use ping from another device. The multicast should be visible as long as your IP# matches the source above and you ping -- REMEMBER TO SET THE TTL >1

ping -I eth0 -t 2

The TTL is what usually bites people first trying out multicast routing. Most TCP/IP stacks default to a TTL of 1 for multicast frames, e.g. ping above requires

-t 2
, or greater. This limitation is intentional and reduces the risk of someone accidentally flooding multicast. Remember, multicast behaves like broadcast unless limited.

The TTL should preferably be set on the sender side, e.g. the camera, but can also be modified in the firewall on a router. Be careful though because the TTL is the only thing that helps prevent routing loops! On Linux the following

command can be used to change the TTL:
iptables -t mangle -A PREROUTING -i eth0 -d -j TTL --ttl-inc 1

Some commands, like this one, must usually be run with root privileges or the correct set of capabilities.


On some platforms there is a limit of 20 groups per socket. This stems from a limit in BSD UNIX, which also affects Linux. The setting that controls this is

, defined in the system header file
. Linux users can tweak this with the following
echo 40 > /proc/sys/net/ipv4/igmp_max_memberships

For large setups it is recommended to investigate enabling multicast router ports in the switches, either statically or by enabling support for multicast router discovery, RFC 4286, or possibly use a dynamic multicast routing protocol.

Action Scripts

smcrouted -e /path/to/script


-e CMD
a user script or command can be called when
receives a
or installs a multicast route to the kernel. This is useful if you, for instance, also run a NAT firewall and need to flush connection tracking after installing a multicast route.

Many Interfaces

smcrouted -N

With the

command line option SMCRoute does not prepare all system interfaces for multicast routing. Very useful if your system has a lot of interfaces but only a select few are required for multicast routing. Use the following in
to enable interfaces:
phyint eth0 enable
phyint eth1 enable
phyint eth2 enable

It is possible to use any interface that supports the


Multiple Routing Tables

On Linux it is possible to run multiple multicast routing daemons due to its support for multiple multicast routing tables. In such setups it may be useful to change the default identity of SMCRoute:

smcrouted -I mrt1 -t 1
smcrouted -I mrt2 -t 2


option alters the default syslog name, config file, PID file, and client socket file name used. In the first instance above,
will use:
  • /etc/mrt1.conf
  • /var/run/
  • /var/run/mrt1.sock

and syslog messages will use the

identity as well. Remember to use the same
also to

Client Tool

SMCRoute also has a client interface to interact with the daemon:

smcroutectl join eth0
smcroutectl add  eth0 eth1 eth2

If the daemon runs with a different identity the client needs to be called using the same identity:

smcrouted   -I mrt
smcroutectl -I mrt show

There are more commands. See the man page or the online help for details:

smcroutectl help

Note: Root privileges are required by default for

due to the IPC socket permissions.


Multicast often originates from different sources but usually not at the same time. For a more generic setup, and to reduce the number of rules required, it is possible to set (*,G) IPv4 multicast routes.


phyint eth0 enable mrdisc
phyint eth1 enable
phyint eth1 enable

mgroup from eth0 group mroute from eth0 group to eth1 eth2

or, from the command line:

# smcroutectl join eth0
# smcroutectl add  eth0 eth1 eth2

Also, see the

smcrouted -c SEC
option for periodic flushing of learned (*,G) rules, including the automatic blocking of unknown multicast, and the
smcroutectl flush

Another experimental feature is multicast router discovery, mrdisc, described in RFC4286. This feature is disabled by default, enable with

configure --enable-mrdisc
. When enabled it periodically sends out an IGMP message on inbound interfaces¹ to alert switches to open up multicast in that direction. Not many managed switches have support for this yet.

¹ Notice the

flag to the above
phyint eth0
directive, which is missing for

Build & Install

SMCRoute should in theory work on any UNIX like operating system which supports the BSD MROUTING API. Both Linux and FreeBSD are tested on a regular basis.

Linux Requirements

On Linux the following kernel config is required:

CONFIG_IP_MROUTE_MULTIPLE_TABLES=y       # For multiple routing tables
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y     # For multiple routing tables

*BSD Requirements

On *BSD the following kernel config is required:

options    MROUTING    # Multicast routing
options    PIM         # pimd extensions used for (*,G) support

General Requirements

Check the list of multicast capable interfaces:

cat /proc/net/dev_mcast

or look for interfaces with the

flag in the output from:

Some interfaces have the

flag disabled by default, like
. Usually this flag can be enabled administratively.

Configure & Build

The GNU Configure & Build system use

as the default install prefix. In many cases this is useful, but this means the configuration files, cache, and PID files will also use that prefix. Most users have come to expect those files in
and configure has a few useful options that are recommended to use. For SMCRoute you may want to use something like this:
./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/var/run
make -j5
sudo make install-strip

Usually your system reserves

for native pacakges, so most users drop
, installing to
, or use

Note: On some systems

may not be available in the configure script, try

Privilege Separation

As of SMCRoute v2.2 support for privilege separation using the

library was added. It is used to drop full root privileges at startup, retaining only
for managing the multicast routes.

The build system searches for the

library and header file(s). Bith
are required.

Note: Although support is automatically detected, the build system will issue a warning if

is missing. This can be silenced with
configure --without-libcap

Integration with systemd

For systemd integration

are required. When the unit file is installed,
can be used to enable and start
$ sudo systemctl enable smcroute.service
$ sudo systemctl start smcroute.service

Check that it started properly by inspecting the system log, or:

$ sudo systemctl status smcroute.service

Static Build

Some people want to build statically, to do this with

add the following
after the configure script. You may also need to add
, which will depend on your particular system:
./configure LDFLAGS="-static" ...

Building from GIT


script and the
files are generated and not stored in GIT. So if you checkout the sources from GitHub you first need to generated these files using

Origin & References

SMCRoute is maintained collaboratively at GitHub. Bug reports, feature requests, patches/pull requests, and documentation fixes are most welcome. The project was previously hosted and maintained by Debian at Alioth and before that by Carsten Schill, the original author.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.