INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Network access with Port translation  (Read 2653 times)

Facel

  • World Citizen
  • ***
  • Posts: 201
Network access with Port translation
« on: March 21, 2018, 09:00:51 am »

Is it possible to access MC server from outside my network with a translation port on my router, instead of having the same port (52199) on the external and internal network, I have a different port number when accessing from outside that is leading to my 52199 port ?


Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Network access with Port translation
« Reply #1 on: March 21, 2018, 09:10:15 am »

You can use NAT to modify the port.
Logged

Facel

  • World Citizen
  • ***
  • Posts: 201
Re: Network access with Port translation
« Reply #2 on: March 21, 2018, 09:25:11 am »

Yes ... but how can I tell MC that inside my network the server port is 52199, and outside my network the port should be 12345 ?

Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Network access with Port translation
« Reply #3 on: March 21, 2018, 09:29:10 am »

I'm not really expert on this subject, but the router should be able to do that with NAT.  You'd run the server on 52199 (although you could change it if you prefer).

The wiki has a topic on Network Access.
Logged

Facel

  • World Citizen
  • ***
  • Posts: 201
Re: Network access with Port translation
« Reply #4 on: March 21, 2018, 09:52:11 am »

The router translate an External IP adress + Port number A  into  an  Internal IP Adress + Port number B

In JRiver case when you try to load a library JRiver first try to find the Internal IP adresse of the server then switch automatically for searching the External IP adress + Port number B for the client connexion.

This is quite nice because it is simple. 

I simply wanted to apply "my security policy" with having a different port number A on the external adress pointing to the internal port number B (that would also have been changed).

I understand that it is possible to modify Port Number B but port number B should remain the same as port Number A.



Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Network access with Port translation
« Reply #5 on: March 21, 2018, 05:43:35 pm »

You can't do that when you connect to MC from outside your network using the Access Key method. You need to connect to MC using an IP Address or URL. If you use either of those methods you lose the built-in capability to use WOL to wake your MC Server, but that may not be an issue for you. Lots of routers won't forward a Magic Packet into your LAN anyway.

You haven't' said what you are using to connect to MC from outside your network. Different Clients have different capabilities. i.e. JRemote verses a MC Client.

So inside your network, connect using the Access Key. Leave the MC Server running with port 52199.

From outside your network, connect using your internet IP Address or the URL of your network, perhaps using the DynDNS service, for example. i.e. www.xxx.yyy.zzz:12345, which is then port forwarded and translated to aaa.bbb.ccc.ddd:52199.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

Facel

  • World Citizen
  • ***
  • Posts: 201
Re: Network access with Port translation
« Reply #6 on: March 22, 2018, 11:50:45 am »

Thanks RoderickGI for your clear answer

You haven't' said what you are using to connect to MC from outside your network. Different Clients have different capabilities. i.e. JRemote verses a MC Client.

I am using MC client on my Windows Laptop, but I would like also to use JRemote on my Iphone. (I didi not have tested it yet, because I was trying
some "impossible" Networlk adress tranlation !!

Inside my network I also have a headless Linux MC Client (based on a Allo USBridge = Raspberry), but this client does not wake up my MC Server (based on a Windows NUC)
I have to find out this issue. This is why  I first use JRemote for waking up my MC server, and then I switch on my Linux MC Client.

Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Network access with Port translation
« Reply #7 on: March 22, 2018, 04:50:22 pm »

I would expect a headless Linux MC Client to wake a MC Server, if the MC Client is started or restated when you need to use it. The Client would need to be connecting to the Server library by default. But if the MC Client was already running but hadn't been used for a while and the MC Server had gone to sleep "underneath" it, then the MC Client will not wake the MC Server. This is something that JRiver needs to work on. (i.e. A Client which is already running should check if the Server is awake or asleep and should wake a sleeping MC Server is necessary.)

I don't know how you would get a headless Linux MC Client to wake a sleeping server at the moment, other than rebooting the Client. But your JRemote method is a good workaround if the Client reboot doesn't work.

As for waking a MC Server from outside your LAN, effectively Wake On WAN, the biggest issue is whether your Modem/Router will pass a Magic Packet from the WAN to the LAN, and if it will send that Magic Packet out on the broadcast address for your LAN. I tried to get this working recently using Wireshark to watch for Magic Packets, and using my mobile phone via the mobile network so that it was outside my LAN, and I found that my router simply will not pass the Magic Packet. So my MC Server stays on all the time if I want to access it from outside my LAN. I was using Gizmo, but the issue will be the same with JRemote.

Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

Facel

  • World Citizen
  • ***
  • Posts: 201
Re: Network access with Port translation
« Reply #8 on: March 23, 2018, 03:59:29 am »

I would expect a headless Linux MC Client to wake a MC Server, if the MC Client is started or restated when you need to use it. T

it is absolutly not the case.  MC server is asleep and headless linux MC client is switch off.  When linux MC client is switch on it does not wake up MC server.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Network access with Port translation
« Reply #9 on: March 23, 2018, 07:43:48 pm »

Well, as I said, I expect it should. There is something wrong. Or maybe WOL hasn't been implemented in MC on Linux, but I couldn't imagine why that would be the case. Linux, the OS I mean, supports WOL generally.

That Client definitely connects to the MC Server automatically when rebooted? If it didn't, that would be a reason for WOL not to be activated.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner
Pages: [1]   Go Up