Operating System Server 2012R2 - Site to Site VPN (1 Viewer)

xPETEZx

Portal Member
August 6, 2010
36
2
Home Country
England England
Hey Guys,

For years I have never had MediaPortal TV server work over VPN. I never dedicated too much time to it, and just used AMPdroid to watch TV when away from home.

Today I finally spent some time on it, and found the cause of the issue. Although I was defining my TV server by IP, it showed in logs that somewhere it was trying to resolve the host name.
I created a static entry in my hosts file, and lo-and behold, TV server works over VPN.

Now is where I am stretching....Site-to-Site VPN...

I have setup a Site-to-site VPN between 2 location, and was hoping to be able to use MediaPortal TV server at the remote location.
Routing works fine between the sites, can ping/access file shares/telnet etc etc.

However TV Server does not work. I can get to the EPG (which is further than I could without the Host file entry) but when I try and stream I get a "Stream failed" error.

I figure its something about how the stream is setup and transversing subnets isnt expected?

Basically subnet 1 is:

192.168.5.x
and subnet 2 is
192.168.10.x

As I said, routing works fine between the too.
The site to site is setup via 2x Server 2012R2 RRAS servers. (IKE tunnel)

This is more of a "be awesome if it worked" project than essential. (As I can use VPN to make it work)
But would love some feedback from anybody who has made it work.

Cheers
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    but when I try and stream I get a "Stream failed" error.
    Probably an issue with the RTSP/RTP connection. Maybe a firewall or something? The RTSP connection (for streaming control) requires the client to be able to access port 554 on the server, so should be easy to configure. The RTP connection (for carrying video, audio etc.) uses random ephemeral ports, so can be harder to configure. You may want to consider switching to UNC paths (SMB shares).
     

    xPETEZx

    Portal Member
    August 6, 2010
    36
    2
    Home Country
    England England
    Thanks

    How would switching to UNC paths help? Would it not end up using the IP anyway after its resolved?

    Will take a look at the ports and see if 554 is blocked anywhere on the RRAS.
     

    xPETEZx

    Portal Member
    August 6, 2010
    36
    2
    Home Country
    England England
    Alright...solved it.

    Apparently it was not only using host name, it also seemed to be trying to use the FQDN?
    I had only created a hosts file entry for the host name, not FQDN.
    Added another entry for FQDN and all worked!

    What I find surprising in all this thought, is that nowhere in my client config have I specified the host name. ITs just by IP.

    Where is it getting the Hostname/FQDN from? Is that passed from the server to the client at some point?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Alright...solved it.
    Thanks for reporting the solution - surely helpful for other people who may be looking to do the same as you. :)

    How would switching to UNC paths help? Would it not end up using the IP anyway after its resolved?
    It would end up using the IP address, but at the time I responded it wasn't clear whether the problem was blocked/unavailable ports, firewall configuration, DNS etc. Like I said previously: UNC paths can be easier to manage/configure from a port and firewall perspective.

    Where is it getting the Hostname/FQDN from? Is that passed from the server to the client at some point?
    I can't give a certain answer, but the following information might give you some clues...

    There are 3 types of connections between MediaPortal and TV Server:
    1. .NET remoting (port 31456) - this is used for the command/control connection (eg. start time-shifting, create a new schedule etc.).
    2. Database (MySQL port 3306; SQL Server ports 1433 and 1434) - this is used to retrieve and/or save information from/in the TV Server database.
    3. Streaming (RTSP port 554 and RTP ephemeral ports; UNC/SMB port 445) - this is used to stream live TV and/or recordings, or read time-shift and/or recording files directly from the server.
    (Note: the list of ports mentioned above is not intended to be exhaustive. Ports 137-139 may be needed for NetBIOS/DNS; ports 31457 and 31458 may be needed for the PowerScheduler plugin etc. etc. etc.)

    All of the above connections have separate configuration.

    .NET remoting connection configuration is the IP address or host name entered in MediaPortal Configuration.
    Database connection configuration is the gentle.config file copied from the server (c:\ProgramData\Team MediaPortal\MediaPortal TV Server) to the client (c:\ProgramData\Team MediaPortal\MediaPortal). That file is created/configured when you first install TV Server.
    Streaming configuration is the IP address selected in TV Server Configuration.

    If you want to know why the hostname is used then start by checking the configuration for those three connections. I can't guarantee that one of them will be the source... but that is the most likely situation.
     

    xPETEZx

    Portal Member
    August 6, 2010
    36
    2
    Home Country
    England England
    Thanks for the information.

    I had a look:

    So for
    1.) I have set the IP of the server
    2.) This value has just hostname
    3.) This was set to "Auto", I have now manually selected my IP from the drop down.

    After selecting an IP from the drop dwon for number 3, I could remove the hosts file entry from my remote client for the FQDN.

    If I could set the database connection value to IP too, I would note need a host file entry anymore at all.

    Would like to avoid statically setting the IP anywhere though. Have visions of some time in the future me changing the server IP and having all sorts of problems trying to figure out whats going on.

    Either way, this is all academic really. I know now all I need to do is make sure the hostname can be resolved on the remote network. Either by hosts file or other resolution.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    If I could set the database connection value to IP too, I would note need a host file entry anymore at all.
    You can do this. Just edit the gentle.config file on both server and client. I gave you the location(s) of the file in my previous reply.
     

    xPETEZx

    Portal Member
    August 6, 2010
    36
    2
    Home Country
    England England
    So is this value static?

    If the hostname of the system was changed, would this file be updated?

    If I statically set the IP in this file, Id be worried that years/months down the line I forget I set it in this file.

    I am happy with the solution for now.
    On any remote system I just add a hosts entry.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    So is this value static?
    Yes. It is your configuration. You can set it to be whatever you like. :)

    If the hostname of the system was changed, would this file be updated?
    No. As above. The file is created at install time and never changed by TV Server after that. Of course you can manually change it at any time, but most people don't.

    If I statically set the IP in this file, Id be worried that years/months down the line I forget I set it in this file.
    Personally I don't understand why this file would be any harder to remember than the other 2 places where the IP address is also set. ;)

    I am happy with the solution for now.
    On any remote system I just add a hosts entry.
    Sure. Ultimately the choice about how you configure your system is completely up to you. :)
     

    Users who are viewing this thread

    Top Bottom