How I got Roon working over OpenVPN (hard for me, easy for you)

Quick update,

Thanks to Aaron, my Roon client on the iPhone can see the Roon core on the Mac at home, when the iPhone is connected to Wireguard VPN on the Raspberry Pi!
Really amazing… :grinning:

This required some changes to the udp-proxy-2020 code and a network routing rule on the Mac (my router is too basic and does not allow it).

I’m sure Aaron will post the details.

Thanks really a lot to him, without his help I could have not make it work.

Definitely interested in getting this to work with Wireguard. Might just as well switch over my UniFi USG from L2TP/IPSEC to Wireguard too

Just set up Wireguard on my UniFi USG3. That’s already a win in my book over LT2P/IPSec or OpenVPN.

@Aaron_Turner and @Francesco: would be interested in your findings to get udp-proxy-2020 to work with wireguard on my USG. Sounds like a fun weekend project no? :smile:

@Nepherte: I just merged the fix for Wireguard support. In theory you should just be able to specify your wg0 interface as well as the Ethernet interface (eth0, etc) and it should “just work”. You can build from source or wait for the 0.0.5 release which will have a binary build for the USG.

That said, if it doesn’t work, I’m happy to work with you to make it work.

I’ll be curious to hear if you get Wireguard working on a USG and what kind of performance you see. My expectation would be that you’d see similar performance as with OpenVPN since it won’t be able to take advantage of the hardware accelleration that IPSec has.

Much appreciated! I’ll wait for the 0.0.5 release :slight_smile: Not exactly sure how to cross-compile on my mac for the usg (not a C/C++/Go person to be honest). I would appreciate if you can ping here when 0.0.5 is available.

I’ll make sure to report back my findings once I’ve tried it out. I feel like Roon over VPN is so close now :slight_smile:

I’m lucky enough to have pretty fast internet speeds (within the country effectively get 1gbps). Plus I don’t have that much simultaneous vpn connections (just me when I’m outside and for whatever reason, need something that’s only accessible within the home network). So all in all, the speeds for now are more than acceptible, hardware accelerated or not.

already published binaries.

Big shout out too @Aaron_Turner for his contributions. After installing and running udp-proxy-2020 + configuring the USG firewall to allow traffic for my wireguard subnet, I have Roon over VPN working.

For the sake of traceability, and to whomever it may concern, I’ll write up some instructions in a dedicated thread to more easily support that use case, and backreference to this thread to provide some context.

2 Likes

@Aaron_Turner
Thanks again for the help!
I’ve downloaded and recompiled the sourced for the 0.0.5 tag and created a little service file for systemd, so that the service starts automatically at boot and it is controllable via the usual systemctl command.

It works smoothly!

Here’s a detailed write-up on how to piece it all together with WireGuard on a UniFi USG: How to: Roon Mobile over WireGuard on a UniFi USG

2 Likes

So, I’ve got it running on a Raspberry Pi running Wireguard.

I compiled it and ran it with the --eth0,wg0 parameter as those are the ports.

Now when I connect (4G and VPN), the roon mobile app sees the server and can browse albums, but I can only play to the endpoints that are on the home network - it does not see the iphone as an endpoint.

If I connect on wifi without the VPN, the app shows the iphone as an endpoint.

And ideas on where I should look?

  1. Fully quit Roon on your phone (easiest is to reboot your phone) and
  2. Restart udp-proxy-2020 with the --debug flag.
  3. Connect to the VPN
  4. Start Roon on your phone

You should see a bunch of logs fly by once your phone finds your Roon Core. If you can, open a bug in github or you can email me: synfinatic at gmail dot com and send me the logs.

It happens to me as well once in a while. I simply close Roon completely on the iPhone and open it again…

Edit:
Well, a better way is:
Go to options - audio in Roon on the iPhone.
You should see your phone in status “enabling”
Disable it and enable it again.


1 Like

It kinda sounds like the default 90sec cache I have configured for hosts on non-broadcast enabled networks is too short. You can try increasing it using the --cachettl option.

Posting in the correct thread now:

Hi! I have tried using udp-proxy-2020 on a pfSense install. It works fine from one local interface/subnet/VLAN to another, but not over a site2site OpenVPN. The error message I get is:

DEBU[0009]/home/vagrant/udp-proxy-2020/cmd/listen.go:191 main.(*Listen).sendPackets() ovpns1: Unable to send packet; no discovered clients

Here is the ifconfig output:

ovpns1: flags=8151<UP,POINTOPOINT,RUNNING,PROMISC,MULTICAST> metric 0 mtu 1500
options=80000
inet6 fe80::96c6:91ff:fe1c:4d06%ovpns1 prefixlen 64 scopeid 0x9
inet 10.51.9.1 --> 10.51.9.2 netmask 0xffffffff
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: tun openvpn
Opened by PID 28015

Can I make this work somehow?

Cheers

The command I am running:

./udpproxy2020 --debug --port 1456 --interface em0.10,ovpns1

Debug output:
DEBU[0018]/home/vagrant/udp-proxy-2020/cmd/listen.go:121 main.(*Listen).handlePackets() em0.10: received packet and fowarding onto other interfaces
DEBU[0018]/home/vagrant/udp-proxy-2020/cmd/send.go:32 main.(*SendPktFeed).Send() ovpns1: sending out because we’re not em0.10
DEBU[0018]/home/vagrant/udp-proxy-2020/cmd/listen.go:145 main.(*Listen).sendPackets() processing packet from em0.10 on ovpns1
DEBU[0018]/home/vagrant/udp-proxy-2020/cmd/listen.go:191 main.(*Listen).sendPackets() ovpns1: Unable to send packet; no discovered clients

1 Like

this is faulty behaviour of the ios roon app

this also happens inside a normal netwerk withouth VPN / different subnets

see also here

Isn’t this so easy to just install two (one each place) ipfire.org, and it should work ?

Then you have OpenVPN point to point, not road warrior.

For site-to-site VPN’s you’ll need to be able to install udp-proxy-2020 on both ends of the tunnel. Honestly I don’t recall off the top of my head if that will work or if there will need to be a code change, due to how things are tracked. But I gotta take care of some honey do list items so that’ll have to wait until later.

Anyways, install it on the other end and let me know. If it doesn’t work, it should be pretty easy (I think, famous last words) to add a feature to support this use case. If it doesn’t work and you can do an IPSec site-to-site VPN, I’m honestly more confident that will work (again, you’ll need to run udp-proxy-2020 on both ends of the tunnel), but I’m pretty sure I can get OpenVPN working with some code changes.

Hi, thanks Aaron!

I tested now with it running on both ends. Still, the message I get is:

Client side were the broadcast is generated:

DEBU[0004]/home/vagrant/udp-proxy-2020/cmd/listen.go:145 main.(*Listen).sendPackets() processing packet from em0.10 on ovpnc2
DEBU[0004]/home/vagrant/udp-proxy-2020/cmd/listen.go:191 main.(*Listen).sendPackets() ovpnc2: Unable to send packet; no discovered clients

OpenVPN client side initialization:
./udpproxy2020 --debug --port 1456 --interface em0.10,ovpnc2
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:43 main.newListener() em0.10: ifIndex: 6
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:53 main.newListener() em0.10 network: ip+net string: fe80::96c6:91ff:fe14:f244/64
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:53 main.newListener() em0.10 network: ip+net string: 172.27.36.129/25
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:85 main.newListener() Listen: {em0.10 0xc0000560c0 [1456] 172.27.36.255 false 250000000 0 0xc0000123c0 map[]}
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:43 main.newListener() ovpnc2: ifIndex: 10
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:85 main.newListener() Listen: {ovpnc2 0xc000056340 [1456] true 250000000 0 0xc000012480 map[]}
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:54 main.initializeInterface() em0.10: applying BPF Filter: udp port 1456
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:66 main.initializeInterface() Opened pcap handle on em0.10
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:54 main.initializeInterface() ovpnc2: applying BPF Filter: udp port 1456
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:66 main.initializeInterface() Opened pcap handle on ovpnc2
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/main.go:98 main.main() Initialization complete!

On the OpenVPN Server side there are no packages received.

OpenVPN Server side initialization:
./udpproxy2020 --debug --port 1456 --interface em0.10,ovpns1
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:43 main.newListener() em0.10: ifIndex: 6
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:53 main.newListener() em0.10 network: ip+net string: fe80::96c6:91ff:fe1c:4d06/64
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:53 main.newListener() em0.10 network: ip+net string: 172.16.26.1/24
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:85 main.newListener() Listen: {em0.10 0xc0000560c0 [1456] 172.16.26.255 false 250000000 0 0xc0000123c0 map[]}
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:43 main.newListener() ovpns1: ifIndex: 9
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/listen.go:85 main.newListener() Listen: {ovpns1 0xc000056340 [1456] true 250000000 0 0xc000012480 map[]}
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:54 main.initializeInterface() em0.10: applying BPF Filter: udp port 1456
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:66 main.initializeInterface() Opened pcap handle on em0.10
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:54 main.initializeInterface() ovpns1: applying BPF Filter: udp port 1456
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/interfaces.go:66 main.initializeInterface() Opened pcap handle on ovpns1
DEBU[0000]/home/vagrant/udp-proxy-2020/cmd/main.go:98 main.main() Initialization complete!

Great if you can do some “tweaks” to make it work :slight_smile:

So one thing: you’ve specified the wrong port for Roon. Roon runs on 9003, not 1456.