Multicast
In such a small setup something like pim
or mospf
is just too much, however i found
that igmpproxy is just too little for me. So I'm using smcroute
. This daemon is for static
multicast routing which is just what I need for my single-router home setup. One minor issue though -
startup for this piece of software is really poor.
In fact it can just start the daemon. And packaged version 0.92 does not use config files. So - here's my version of the startup and config:
files/etc/init.d/smcroute: #!/bin/sh /etc/rc.common # Copyright (C) 2006-2010 OpenWrt.org # Copyright (C) 2012 Ruslan.N.Marchenko START=50 smc_join_group() { local cfg=$1 config_get from "$cfg" "from" config_get group "$cfg" "group" network_get_device FROM "$from" smcroute -j $FROM $group } smc_add_route() { local cfg=$1 config_get from "$cfg" "from" config_get group "$cfg" "group" config_get to "$cfg" "to" network_get_device FROM "$from" network_get_device TO "$to" [ -z "$src" ] && src=0.0.0.0 smcroute -a $FROM $src $group $TO } start() { smcroute -d config_load smcroute . /lib/functions/network.sh config_foreach smc_join_group mgroup config_foreach smc_add_route mroute } stop() { smcroute -k }
That's it. And for this startup - you can use such config:
files/etc/config/smcroute: config mgroup option from wlan0 option group 225.3.19.154 config mroute option from wlan0 option group 225.3.19.154 option to lan
Note: you can skip option src 1.2.3.4
in mroute
section, in that case
it will be defaulted to 0.0.0.0 - i.e. any (if it is dynamic). Also note: this startup script
does not support multiple dst interfaces. Feel free to add if you want or need to.
Ehm.. what? IPv6 multicast? Well, you can use mrd6, I still haven't found use for it so give me some time. Or give the world some time to port everything to IPv6 stack :)
Do not forget - place all these files to files/...
before packaging image so
that they appear in final rom. Otherwise - create them just on the device using jffs overlay.