User avatar
RiccardoMoretti
Posts: 65
Joined: Fri May 25, 2012 5:33 am

MiniDLNA across subnets

Sat Aug 24, 2013 7:41 pm

Ok here's the challenge.
I have 2 Pi s one running MINIDLNA (working perfectly) address 192.168.1.34

The second one I have set up as a Wi-Fi hotspot as described in http://elinux.org/RPI-Wireless-Hotspot

The 2nd pi has an eth0=192.168.1.2 and the Wi-FI set up with a dhcp server 192.168.42.200-192.168.42.250

The Wifi Access point works perfectly!

Here's the issue
because the 2nd pi gives out an address of 192.168.42.X which is on a different subnet to the minidlna server, the SSDP from the minidlna server on 192.168.1.34 gets to 192.168.1.2. However the eth0 on 192.168.1.2 does not forward or route this traffic to the wan0 address of 192.168.42.X.

I believe minidlna sends a broadcast to 239.255.255.250 (multicast) so how do I get the Pi on 192.168.1.2 to forward this multicast packet to the wan interface 0 (192.168.42.0)??

Right now I'm messing about with smcroute but I'm not getting the commands correctly.
I'm trying

smcroute -a eth0 192.168.1.2 239.255.255.250 wlan0

User avatar
RiccardoMoretti
Posts: 65
Joined: Fri May 25, 2012 5:33 am

Re: MiniDLNA across subnets

Sat Aug 24, 2013 10:44 pm

Im getting this when I try to start the deamon

Code: Select all

[email protected] ~ $ service smcroute start
Starting static multicast router daemon: INIT: IGMP socket open; Errno(1): Operation not permitted
INIT: MRT_INIT failed; Errno(1): Operation not permitted
INIT: ICMPv6 socket open; Errno(97): Address family not supported by protocol
INIT: MRT6_INIT failed; Errno(97): Address family not supported by protocol
INIT: Kernel does not support multicast routing; Errno(92): Protocol not available

and I have this in the config.txt

Code: Select all

CONFIG_IP_MROUTE=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y


ak2766
Posts: 1
Joined: Sat Oct 05, 2013 2:01 am

Re: MiniDLNA across subnets

Sat Oct 05, 2013 2:10 am

Hey Riccardo.

For me, even after configuring SMCROUTE, I also had to patch minidlna's minissdp.c per instructions found at SourceForge:
http://sourceforge.net/p/minidlna/support-requests/13/

Let me know how you fair with the link above. If you are still having issues with configuring SMCROUTE, let me know and I'll be glad to help.

Cheers,
ak.

hmiyake
Posts: 1
Joined: Sun Nov 17, 2013 6:28 am

Re: MiniDLNA across subnets

Sun Nov 17, 2013 6:52 am

I'm also having issues with smcroute daemon not starting, with the following issue:

Code: Select all

$ sudo smcroute -d
NIT: ICMPv6 socket open; Errno(97): Address family not supported by protocol
INIT: MRT6_INIT failed; Errno(97): Address family not supported by protocol
Seems though, that the issue (https://github.com/raspberrypi/linux/issues/358) with the Raspberry Pi kernel not being complied with IP multicasting options enabled has been resolved recently (Nov. 11, 2013), according to the latest posts.

So, upon running "rpi-update" and rebooting, the kernel now shows 3.10.18+ (was 3.6.11+ Aug 30 2013), and the below options looks enabled.

CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y

rbn
Posts: 136
Joined: Tue Dec 27, 2011 8:32 pm
Location: Near Peterborough
Contact: Website

Re: MiniDLNA across subnets

Thu Jan 16, 2014 8:57 pm

I'm also having issues with smcroute daemon not starting, with the following issue:

CODE: SELECT ALL
$ sudo smcroute -d
NIT: ICMPv6 socket open; Errno(97): Address family not supported by protocol
INIT: MRT6_INIT failed; Errno(97): Address family not supported by protocol
I have exactly the same problem with getting smcroute going. Anyone got solutions?

Leaskovski
Posts: 13
Joined: Tue May 12, 2015 9:29 am

Re: MiniDLNA across subnets

Tue May 12, 2015 9:33 am

Hi guys,

I have exactly the same issues with MiniDLNA and OpenVPN running on my setup. I want the uPnp broadcasts that MiniDNLA pushes out on to the LAN to also get pushed out to the VPN clients. I did try using a bridge setup with OpenVPN and that worked fine, however the OpenVPN client on Android doesn't support bridge mode (tap), so I am back to a Tunnel (tun) and need to get the broadcasts over on to the VPN subnet.

Any ideas, help? I to can't get smcroute to start on the Pi.

Thanks

Leaskovski
Posts: 13
Joined: Tue May 12, 2015 9:29 am

Re: MiniDLNA across subnets

Wed May 13, 2015 3:40 pm

Ok, I have got past the last error (as mentioned in previous posts). Basically, smcroute looks for IPV6, and if it isn't there then it basically says you can't do it. To get around this, I have enabled IPV6 as per here...

http://weblog.aklmedia.nl/tag/raspberry-pi/

So, I am now getting the following error...

Code: Select all

INIT: MC-Router IPv4 API already in use; Errno(98): Address already in use
INIT: MC-Router IPv6 API already in use; Errno(98): Address already in use
INIT: Kernel does not support multicast routing; Errno(92): Protocol not available
Joy. I think I am going to hunt around to see if a uPnP proxy exists.

Leaskovski
Posts: 13
Joined: Tue May 12, 2015 9:29 am

Re: MiniDLNA across subnets

Thu May 14, 2015 1:16 pm

Ok, I have abandoned smcroute in favour of using igmpproxy (http://sourceforge.net/projects/igmpproxy/).

I had to download, compile and install. I did this using the following commands (run under "sudo -s")...

Code: Select all

apt-get install gcc make
cd /usr/src
wget http://downloads.sourceforge.net/project/igmpproxy/igmpproxy/0.1/igmpproxy-0.1.tar.gz
tar -xzf igmpproxy-0.1.tar.gz
cd igmpproxy-0.1
./configure
make
make install
Once installed, I had to build a config file to use with the new binary (not in "sudo -s" anymore)...

Code: Select all

sudo nano /etc/igmpproxy.conf
I set my config file contents to...

Code: Select all

quickleave

phyint eth0 upstream  ratelimit 0  threshold 1
altnet 192.168.0.0/24
altnet 10.8.0.0/24

phyint tun0 downstream  ratelimit 0  threshold 1
altnet 10.8.0.0/24
note: the above IP's are, 192.168.0.0/24 is my LAN in my home where my PI resides which is running MiniDLNA, OpenVPN and Samba. 10.8.0.0/24 is the IP address that get assigned to my OpenVPN clients when they connect. Eth0 is the wired LAN connection on the PI. Tun0 is the interface for the OpenVPN tunnel (bridge isn't support on android OpenVPN client, otherwise I wouldn't be here!)

So with the above setup, you can launch igmpproxy from the command line just for testing. I will set it up to run as a daemon later.

Code: Select all

sudo igmpproxy -dv /etc/igmpproxy.conf
note: the -dv option is for display lots of output.

With the above running, I connected my phone to the VPN and launched BubbleUPnP to see if I could see the MiniDLNA service. I couldn't see the service, however I could see some form of communication and attempt of routing of multicasts. I got the following output...

Code: Select all

adding VIF, Ix 0 Fl 0x0 IP 0x1400a8c0 eth0, Threshold: 1, Ratelimit: 0
adding VIF, Ix 1 Fl 0x0 IP 0x0100080a tun0, Threshold: 1, Ratelimit: 0
joinMcGroup: 224.0.0.2 on tun0
RECV Membership query   from 10.8.0.1        to 224.0.0.1
RECV V2 member report   from 10.8.0.1        to 224.0.0.2
The IGMP message was from myself. Ignoring.
Inserted route table entry for 239.255.255.250 on VIF #-1
The origin for route 239.255.255.250 changed from 192.168.0.6 to 10.8.0.6
The origin for route 239.255.255.250 changed from 10.8.0.6 to 192.168.0.6
RECV Membership query   from 10.8.0.1        to 224.0.0.1
RECV V2 member report   from 10.8.0.1        to 224.0.0.2
The IGMP message was from myself. Ignoring.
Removing MFC: 192.168.0.6 -> 239.255.255.250, InpVIf: 0
MRT_DEL_MFC; Errno(2): No such file or directory
Inserted route table entry for 239.255.255.250 on VIF #-1
select() failure; Errno(4): Interrupted system call
Got a interupt signal. Exiting.
Removing MFC: 192.168.0.6 -> 239.255.255.250, InpVIf: 0
MRT_DEL_MFC; Errno(2): No such file or directory
All routes removed. Routing table is empty.
Shutdown complete....
Has anyone got any ideas as to why the multicast might not be getting through to the VPN client?

References:
http://ubuntuforums.org/showthread.php?t=1203591
http://www.projectiwear.org/~plasmahh/t_home.html

Return to “Networking and servers”