Apologies in advance for poor understanding of networking...


  1. Existing LAN with internet access:,;
  2. NAS device with installed Plex media server "Media Server":
  • connected to LAN by ethernet cable with static IP 192.168.0.xxx;
  • Able to access internet directly (i.e NOT connected through VPN);
  1. RaspberryPi VPN access point:
  • Setup using https://pimylifeup.com/raspberry-pi-vpn-access-point/
  • Connected to LAN through Eth0;
  • Static IP setup: 192.168.0.xxx;
  • Devices connecting through wlan given IP addresses192.168.220.xxx;
  • Device with media server client app ("Client Device") connects to access point and given static ip (in network settings on Client Device NOT on RaspberryPi);
  • Openvpn installed with connection to commercial VPN provider (downloaded openvpn config file from vendor);
  • all traffic routed through VPN tun0.
  • Single iptables entry: sudo iptables -t nat -A POSTROUTING -o tun -j MASQUERADE


  1. RaspberryPi VPN access point works well through VPN;
  2. Other media client apps connected to LAN without VPN (NOT RPi access point) stream media from Media Server well;
  3. media client apps connecting from internet cannot stream media from Media Server with/without VPN (NOT an issue - problem for another day).


  1. "Client Device" connection through RPi access point to Media Server unreliable and VERY slow (Presume routed through VPN);
  2. Tried all config settings in Plex server and Client apps (manual IP and port etc.) without success;
  3. I read the question and answer at Route LAN traffic through eth0, not tun0, on my VPN access point and tried adding the following without success: sudo iptables -A FORWARD -i wlan0 -j ACCEPT sudo iptables -A FORWARD -i eth0 -j ACCEPT
  4. my internet searches suggest that adding route or push route entries to openvpn config file may assist - but my attempts gave failed (likely user error).

Please assist if you can.


I was able to accomplish the split routing using the explanation provided at https://www.system-rescue.org/networking/Destination-port-routing/ You cannot use ip route directly to route traffic based on ports. You first need to 'mark' traffic based on port, then create separate routing table to route the marked traffic to the interface you require.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.