Ylianst/MeshCentralRouter

Implement a way to have a "permanent" port mapping

Closed this issue · 2 comments

Currently if I want to open a port, I have to:

  • Open MeshCentral Router
  • Connect using password
  • Find the remote from gui
  • Create the port mapping

I would like instead:

  • Have MeshCentral Router start automatically as a service in the background
  • MeshCentral Router reconnects automatically silently
  • MeshCentral Router remembers the previous port mappings and allows them to persist on restart

Once you have mappings setup, save the mappings like this:

image

It will create a .mcrouter file. You can edit this file with a text editor. You can add your account password if you like:

{
  "hostname": "central.mesh.meshcentral.com",
  "username": "admin",
  "password": "xxxxxxx",
  "certhash": "1A77E61E99CEB54A0BF8FA8CADE27290692C1CE9F72AF68C7CECAECAC7531179B4767A060C8E31D19E01911D0E80AB7A",
  "mappings":[
    {
      "nodeName": "AmtMachine15",
      "meshId": "mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c",
      "nodeId": "node//B2RZYRSSGZiNaha47HIz4qT7WKxCF1CN1v1iiuUy$55NQM96eP5L4jNyilKzxY4e",
      "appId": 3,
      "protocol": 1,
      "localPort": 50030,
      "remotePort": 3389
    }
  ]
}

Then, double click on this .mcrouter file and associate the file type to MeshCentralRouter.exe if it's not already done. When you click on your mapping, MeshCentralRouter will open, login and start the mappings right away.

Let me know if that works.

si458 commented

you should also look into meshcmd.exe as this allows you to port forward from the command line
https://ylianst.github.io/MeshCentral/meshcmd/#meshcentral-tcp-port-mapping
so you can use something like a shortcut in the startup menu to run and keep it alive