Using UPnP local server with VPN

Hi, I am running OSMC on RPi3 with IPVanish VPN.
The VPN appears to be working correctly but could it be this is preventing me using my local UPnP server. When I try and add a video file none of the UPnP servers running on my local network on NAS boxes appear. In fact no choices appear when I try and browse to add files and all I can do is enter a name for the video source.
AFAIK there cannot be any DNS or name resolution at this stage so how do I get my UPnP servers to show when browsing?

UPnP uses a disovery protocol called “Simple Service Discovery Protocol” (SSDP) that broadcasts on IP address OpenVPN will treat this as a public IP address and therefore route it through the VPN tunnel, tun0, rather than to the local network.

Please run the following from the command line:

sudo apt-get update
sudo apt-get install iproute2

Assuming your Pi is on a wired connection (eth0), please then run:

sudo ip route add dev eth0

If this works, you need to make it a permanent feature of your system. Adding it to /etc/rc.local might work or, alternatively, you could run it when OpenVPN starts. To do so, add these two lines to the VPN .conf file

script-security 2
up /path/to/script

where the script will contain the ip route command. Make it executable and owned by root:root. It should run with root privilege so doesn’t need sudo.

I had forgotten this post and moved on a bit although not so much forward! I am now using a Vero 4K and have returned to using VPN after years of not using it.

Clearly the Vero system is different and after enabling UPnP/DLNA I can now see my Twonky server and access and play from my library (except that no thumbnails have appeared, a problem for a new post.)

My question is how and why is this working when I have ipVanish installed and VPN Manager tells me I am logged into another country and I have not set up any special routes?

Grateful for some guidance/recommended reading before I broadcast my library to the world.

As far as I know DLNA/UPnP works on a local level ( inside your house) and vpn only affects your Internet traffic

This contradicts the suggestion above that SSDP broadcast will be treated as a public IP and be routed through the VPN tunnel. What has changed?

Then I’m sorry, ignore me please I hope someone else can help out

Hi and thanks for the reply. You are right that UPnP works for me now, hence the question. I have no idea since the VPN is in place and yet I can see my NAS UPnP server.

Your question, while relevant and interesting, doesn’t provide some important context. For example, did you have success with the ip command? Do you still use the ip command now – and if not, why not? And have you changed your network in any way in the past three years?

I have no way of knowing, but it’s also possible that OpenVPN have changed their code to make allowances for SSDP traffic and similar protocols.

Hi and thanks for the reply. It has been three years. Different device and many updates later. I am just trying to pick up the threads as I try to get Vero 4k device working as I want and read my first post. Will get back to you when I get stuck.
Thanks again.