Multicast across subnets - smcroute

Hi

I am having trouble getting my HEOS device recognised through multicast across different subnets. This page mentions all the (multicast) requirements for it to work.

My setup is as follows:
ISP router (local IP 192.168.10.254) with OpenWRT router attached (192.168.10.8). The clients connect to the OpenWRT router on:
br-lan: 192.168.1.0/24
br-guest: 192.168.2.0/24
br-iot: 192.168.3.0/24

I have split VPN (using vpnbypass):
192.168.1.128/25 and br-guest go over VPN.

The HEOS device has 192.168.3.41 and the mobile phone with the app that's trying to connect 192.168.1.102. In the firewall I have allowed input from, and temporarily allowed all traffic between br-lan and br-iot until I can get it to work and I can ping 192.168.3.41 from br-lan just fine. mroutes are as follows:

root@R7800:~# ip -s mroute
(192.168.1.42,225.1.2.3)         Iif: eth0       Oifs: eth1(ttl 3)  State: resolved
  0 packets, 0 bytes, Age 1426.69
(192.168.3.41,239.255.255.250)   Iif: br-iot      State: resolved
  1052 packets, 634448 bytes, Age 7.82
(192.168.10.10,239.255.255.250)  Iif: wlan1       State: resolved
  43 packets, 8686 bytes, Age 7.60
(192.168.1.102,239.255.255.250)  Iif: br-lan      State: resolved
  24 packets, 3752 bytes, Age 637.86

I tried using igmpproxy but couldn't get it to work and removed it. Now I've installed smcroute because I imagine I need something along the lines of

mroute from br-iot group 239.255.255.250 to br-lan

However, when I run smcrouted -n it gives me the following error:

root@R7800:~# smcrouted -n
smcroute[6552]: SMCRoute v2.4.4
smcroute[6552]: IPv4 multicast routing API already in use: Address in use
smcroute[6552]: IPv6 multicast routing API already in use: Address in use
smcroute[6552]: Another multicast routing application is already running.

I don't know what routing API it is referring to. Is there a way to find out?
This is the content of init.d:

root@R7800:~# ls /etc/init.d
adblock          etherwake        nfsd             sysntpd
banip            firewall         nlbwmon          system
bcp38            fstab            odhcpd           ucitrack
boot             gpio_switch      openvpn          uhttpd
bootcount        irqbalance       rpcbind          umount
collectd         led              rpcd             urandom_seed
cron             log              samba            urngd
ddns             luci_statistics  smcroute         usbmode
dnsmasq          lvm2             sqm              vpnbypass
done             miniupnpd        sysctl
dropbear         network          sysfixtime

Firstly, how can I find out what is preventing smcroute from running?

Secondly, is the proposed mroute the right one for the job? Is it also necessary to change the TTL or anything else?

Thanks

2 Likes

Try with netstat -anp
It will show you address, port and process.

Right, that just gives me a whole lot of information but hasn't really gotten me closer to figuring it out. I tried looking up some of the names mentioned but didn't find one to be responsible? Here is the output:

root@R7800:~# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1958/uhttpd
tcp        0      0 10.8.8.4:53             0.0.0.0:*               LISTEN      4492/dnsmasq
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      4492/dnsmasq
tcp        0      0 192.168.1.1:53          0.0.0.0:*               LISTEN      4492/dnsmasq
tcp        0      0 192.168.3.1:53          0.0.0.0:*               LISTEN      4492/dnsmasq
tcp        0      0 192.168.10.8:53         0.0.0.0:*               LISTEN      4492/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1320/dropbear
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1958/uhttpd
tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN      2423/smbd
tcp        0      0 192.168.1.1:445         0.0.0.0:*               LISTEN      2423/smbd
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:32777           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:32778           0.0.0.0:*               LISTEN      5511/rpc.statd
tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN      2423/smbd
tcp        0      0 192.168.1.1:139         0.0.0.0:*               LISTEN      2423/smbd
tcp        0      0 0.0.0.0:32780           0.0.0.0:*               LISTEN      5512/rpc.mountd
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1385/rpcbind
tcp        0   1904 192.168.1.1:22          192.168.1.131:60994     ESTABLISHED 28134/dropbear
tcp        0      0 :::80                   :::*                    LISTEN      1958/uhttpd
tcp        0      0 fe80::c88b:17bd:1734:fbcb:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 ::1:53                  :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3a94:edff:fe39:f1c4:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3a94:edff:fe39:f1c3:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fd46:d11:e59:10::1:53   :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3a94:edff:fe39:f1c3:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fd46:d11:e59:20::1:53   :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3894:edff:fe39:f1c5:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3a94:edff:fe39:f1c6:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3a94:edff:fe39:f1c5:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 fe80::3894:edff:fe39:f1c5:53 :::*                    LISTEN      4492/dnsmasq
tcp        0      0 :::22                   :::*                    LISTEN      1320/dropbear
tcp        0      0 :::443                  :::*                    LISTEN      1958/uhttpd
tcp        0      0 fd46:d11:e59:10::1:445  :::*                    LISTEN      2423/smbd
tcp        0      0 ::1:445                 :::*                    LISTEN      2423/smbd
tcp        0      0 :::2049                 :::*                    LISTEN      -
tcp        0      0 :::32777                :::*                    LISTEN      -
tcp        0      0 :::32778                :::*                    LISTEN      5511/rpc.statd
tcp        0      0 fd46:d11:e59:10::1:139  :::*                    LISTEN      2423/smbd
tcp        0      0 ::1:139                 :::*                    LISTEN      2423/smbd
tcp        0      0 :::32780                :::*                    LISTEN      5512/rpc.mountd
tcp        0      0 :::111                  :::*                    LISTEN      1385/rpcbind
udp        0      0 127.0.0.1:1023          0.0.0.0:*                           5511/rpc.statd
udp        0      0 0.0.0.0:32777           0.0.0.0:*                           -
udp        0      0 0.0.0.0:32778           0.0.0.0:*                           5511/rpc.statd
udp        0      0 0.0.0.0:32780           0.0.0.0:*                           5512/rpc.mountd
udp        0      0 10.8.8.4:53             0.0.0.0:*                           4492/dnsmasq
udp        0      0 127.0.0.1:53            0.0.0.0:*                           4492/dnsmasq
udp        0      0 192.168.1.1:53          0.0.0.0:*                           4492/dnsmasq
udp        0      0 192.168.3.1:53          0.0.0.0:*                           4492/dnsmasq
udp        0      0 192.168.10.8:53         0.0.0.0:*                           4492/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           4492/dnsmasq
udp        0      0 0.0.0.0:33095           0.0.0.0:*                           3449/openvpn
udp        0      0 0.0.0.0:62802           0.0.0.0:*                           1385/rpcbind
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1385/rpcbind
udp        0      0 192.168.1.255:137       0.0.0.0:*                           2424/nmbd
udp        0      0 192.168.1.1:137         0.0.0.0:*                           2424/nmbd
udp        0      0 0.0.0.0:137             0.0.0.0:*                           2424/nmbd
udp        0      0 192.168.1.255:138       0.0.0.0:*                           2424/nmbd
udp        0      0 192.168.1.1:138         0.0.0.0:*                           2424/nmbd
udp        0      0 0.0.0.0:138             0.0.0.0:*                           2424/nmbd
udp        0      0 :::32777                :::*                                -
udp        0      0 :::32778                :::*                                5511/rpc.statd
udp        0      0 :::32780                :::*                                5512/rpc.mountd
udp        0      0 :::546                  :::*                                2104/odhcp6c
udp        0      0 :::547                  :::*                                1572/odhcpd
udp        0      0 :::547                  :::*                                1572/odhcpd
udp        0      0 :::54831                :::*                                1385/rpcbind
udp        0      0 fe80::c88b:17bd:1734:fbcb:53 :::*                                4492/dnsmasq
udp        0      0 ::1:53                  :::*                                4492/dnsmasq
udp        0      0 fe80::3a94:edff:fe39:f1c4:53 :::*                                4492/dnsmasq
udp        0      0 fe80::3a94:edff:fe39:f1c3:53 :::*                                4492/dnsmasq
udp        0      0 fd46:d11:e59:10::1:53   :::*                                4492/dnsmasq
udp        0      0 fe80::3a94:edff:fe39:f1c3:53 :::*                                4492/dnsmasq
udp        0      0 fd46:d11:e59:20::1:53   :::*                                4492/dnsmasq
udp        0      0 fe80::3894:edff:fe39:f1c5:53 :::*                                4492/dnsmasq
udp        0      0 fe80::3a94:edff:fe39:f1c6:53 :::*                                4492/dnsmasq
udp        0      0 fe80::3a94:edff:fe39:f1c5:53 :::*                                4492/dnsmasq
udp        0      0 fe80::3894:edff:fe39:f1c5:53 :::*                                4492/dnsmasq
udp        0      0 :::111                  :::*                                1385/rpcbind
raw        0      0 0.0.0.0:2               0.0.0.0:*               2           5530/smcrouted
raw        0      0 ::%159:58               ::%1:*                  58          5530/smcrouted
raw        0      0 ::%158:58               ::%2:*                  58          2104/odhcp6c
raw        0      0 ::%158:58               ::%3:*                  58          1572/odhcpd
raw        0      0 ::%158:58               ::%4:*                  58          1572/odhcpd
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ]         DGRAM                      8708 3814/hostapd        /var/run/hostapd/wlan0
unix  2      [ ]         DGRAM                      8710 3814/hostapd        /var/run/hostapd/wlan0-1
unix  2      [ ACC ]     STREAM     LISTENING      17678 5530/smcrouted      /var/run/smcroute.sock
unix  13     [ ]         DGRAM                      3640 1201/logd           /dev/log
unix  2      [ ACC ]     STREAM     LISTENING       4409 1385/rpcbind        /var/run/rpcbind.sock
unix  2      [ ACC ]     STREAM     LISTENING       5724 2175/nlbwmon        /var/run/nlbwmon.sock
unix  2      [ ACC ]     STREAM     LISTENING       1734 232/ubusd           /var/run/ubus.sock
unix  2      [ ACC ]     STREAM     LISTENING       5832 2424/nmbd           /var/nmbd/unexpected
unix  2      [ ]         DGRAM                      8699 3498/wpa_supplicant /var/run/wpa_supplicant/wlan1
unix  2      [ ]         DGRAM                      1738 232/ubusd           
unix  3      [ ]         STREAM     CONNECTED       3642 1201/logd           
unix  2      [ ]         DGRAM                     20651 5512/rpc.mountd     
unix  2      [ ]         DGRAM                      4560 1436/netifd         
unix  3      [ ]         STREAM     CONNECTED      17609 -                   
unix  2      [ ]         DGRAM                      7656 3498/wpa_supplicant 
unix  3      [ ]         STREAM     CONNECTED       7996 232/ubusd           /var/run/ubus.sock
unix  2      [ ]         DGRAM                      5636 1572/odhcpd         
unix  3      [ ]         STREAM     CONNECTED      10671 4492/dnsmasq        
unix  3      [ ]         STREAM     CONNECTED       8703 232/ubusd           /var/run/ubus.sock
unix  3      [ ]         STREAM     CONNECTED       2316 1/procd             
unix  3      [ ]         STREAM     CONNECTED       5200 1436/netifd         
unix  3      [ ]         STREAM     CONNECTED       5265 1572/odhcpd         
unix  2      [ ]         DGRAM                     17630 5511/rpc.statd      
unix  3      [ ]         STREAM     CONNECTED       3643 232/ubusd           /var/run/ubus.sock
unix  3      [ ]         STREAM     CONNECTED       1740 232/ubusd           /var/run/ubus.sock
unix  2      [ ]         DGRAM                      8560 3814/hostapd        
unix  3      [ ]         STREAM     CONNECTED     616619 232/ubusd           /var/run/ubus.sock
unix  2      [ ]         DGRAM                      5198 1436/netifd         
unix  3      [ ]         STREAM     CONNECTED       4514 232/ubusd           /var/run/ubus.sock
unix  3      [ ]         STREAM     CONNECTED      20604 1385/rpcbind        /var/run/rpcbind.sock
unix  3      [ ]         STREAM     CONNECTED       5201 232/ubusd           /var/run/ubus.sock
unix  2      [ ]         DGRAM                      4364 1320/dropbear       
unix  3      [ ]         STREAM     CONNECTED     616618 28204/rpcd          
unix  2      [ ]         DGRAM                     10669 4492/dnsmasq        
unix  2      [ ]         DGRAM                      7852 3449/openvpn        
unix  3      [ ]         STREAM     CONNECTED       8702 3498/wpa_supplicant 
unix  2      [ ]         DGRAM                     17655 5530/smcrouted      
unix  3      [ ]         STREAM     CONNECTED      10672 232/ubusd           /var/run/ubus.sock
unix  2      [ ]         DGRAM                      4874 2104/odhcp6c        
unix  3      [ ]         STREAM     CONNECTED       8872 3814/hostapd        

Anyone able to tell what's blocking smcroute from starting?

Run in foreground, do not detach from the calling terminal. This also means that any further commands from that command line are run. Option flags, however, are accepted, but not command flags.

Did you stop the smcroute daemon before invoking
smcrouted -n via /etc/init.d/smcroute stop ?

If the TTL is not large enough (multicast traffic usually has a TTL of 1) then yes.

Take a look at this guide:

5 Likes

Right, it was that simple... thanks! I'll see how I go with the routing to see if I can get it to work.

Got it working!

Used these smcroutes in smcroute.conf:

mgroup from br-iot group 239.255.255.250
mgroup from br-lan group 239.255.255.250
mroute from br-iot group 239.255.255.250 to br-lan
mroute from br-lan group 239.255.255.250 to br-iot

and these custom firewall rules for TTL:

iptables -t mangle -A PREROUTING -i br-lan -d 239.255.255.250 -j TTL --ttl-inc 1
iptables -t mangle -A PREROUTING -i br-iot -d 239.255.255.250 -j TTL --ttl-inc 1
iptables -t mangle -A PREROUTING -i br-lan -d 224.0.0.0/4 -j TTL --ttl-inc 1
iptables -t mangle -A PREROUTING -i br-iot -d 224.0.0.0/4 -j TTL --ttl-inc 1

Thanks guys. Next hurdle is getting Spotify Connect to recognise devices across the subnets (it's possibly a mDNS problem)

4 Likes

I'm glad you got it working! :smile:

But you don't need those iptables rules, I guess.

iptables -t mangle -A PREROUTING -i br-lan -d 224.0.0.0/4 -j TTL --ttl-inc 1
iptables -t mangle -A PREROUTING -i br-iot -d 224.0.0.0/4 -j TTL --ttl-inc 1

224.0.0.0/4 does cover multicast addresses from 240.0.0.0 to 255.255.255.255 (all?).

1 Like

@neoc41 Is there a feed with smcroute 2.4.4 or did you compile OpenWrt from source with the package? Opkg seems to refer to an outdated version. I saw on github the package maintainer was changed and some discussion about which repository to use but I had trouble determining the outcome. Thank you for you help!

I'm not too sure. I just installed the latest version from opkg without a problem. I am on 19.07 snapshot by Hnyman though..

I found it in snapshots, thank you for your response.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.