Channels for HDHomeRun across networks

I have a multiple-VLAN setup with HDHomeRun on one VLAN, with most clients also on the same VLAN, but some clients on another VLAN.

In order to make this work with the HDHomeRun app, all I had to do was setup socat on a Raspberry Pi that is connected to both VLANs. The socat command looks like this

socat -lm udp-recvfrom:65001,fork,so-bindtodevice=eth0.5 udp-sendto:REAL-IP-ADDRESS:65001

As stated, this works just fine for the real HDHomeRun app. The clients on VLAN 5 send packets to the broadcast address, they get received by the Pi, the Pi sends them on the real network as itself, and the responses get received by the Pi and sent to the original client as if they came from the Pi. That is, as if the Pi were the HDHomeRun from the point of view of clients on VLAN 5, but obviously it is not.

If I put Wireshark on the response, I can clearly see full HTTP URLs in it, including the real HDHomeRun IP and port number. The URLs I see are for the lineup.json resource. That resource, in turn, also includes full URLs to port 5004 for each of the channels.

Unfortunately, for reasons I don't understand, Channels for HDHomeRun (the app that directly connects without a DVR) tries to connect to the Pi's IP address on port 5004, thus nothing can actually be played.

Why would Channels be trying to connect to the address of the Pi despite the fact that the URLs clearly include the full IP address?

For now I've resolved the issue by shutting down the forwarder (so the real HDHomeRun app no longer works) and manually configuring the tuner's IP address in Channels for HDHomeRun. This is acceptable, but I'd like Channels to work even with the forwarder around, and I don't really understand why it seems to be using the wrong IP.

I should mention this is completely separate from my normal DVR setup. This is strictly HDHomeRun and Channels for HDHomeRun, no DVR server is present at this site.

Sounds like a bug in the app. In the meantime why don't you try one of these 2 options:

  1. forward tcp port 5004 as well
  2. use iptables to forward udp. the apps should see the actual IP of the HDHR device:
# Forward UDP broadcast on port 65001 to REAL-IP-ADDRESS
$ iptables -t nat -A PREROUTING -i eth0.5 -p udp --dport 65001 -d 255.255.255.255 -j DNAT --to-destination REAL-IP-ADDRESS:65001
$ iptables -A FORWARD -p udp -d REAL-IP-ADDRESS --dport 65001 -j ACCEPT