In many cases, you want to have access from a device to an isolated network such as your company intranet to which the device does not have direct connection, but your personal computer does.
A common situation is when you're developing applications for mobile devices that needs the connection between the devices and some back-end servers placed inside an intranet where, for some reasons, only your laptop has ability to connect to though a Virtual Private Network (VPN), eg: When you are working from home.
So how can you still get your mobiles connected to the back-end servers for testing from home? It's easy and can quickly be done by some simple steps:
- Make sure your mobile can connect to your laptop, eg: Through a WIFI network which you most likely already had at home.
- Setup an ssh tunnel from your laptop to the back-end servers to drive any traffic from your mobile devices to the servers through your laptop.
For the second step, on a Mac, you can simply open up your terminal and type something like this:
$ ssh -Lyour.local.ipaddress:port1:your.backend.serveraddress:port2 yoursshaccount@serveraddress.where.you.wanttoconnect
(You better use a port greater than or equal to 1024 because lower ones are reserved ports and you need some special dealing to open them up)
For example:
$ ssh -L192.168.2.100:7777:work.mycompany.com:22 duynv@gate.mycompany.com
This means open an ssh connection as user duynv to host gate.mycompany.com. While the session is
openned, redirect all traffic to port 7777 on the local machine (192.168.2.100) to
port 22 on machine work.mycompany.com
You can add more servers, ports to the list as needed and then you're all set.
Now you can use your mobile devices, connect to your laptop, on a specific port and enjoy trying apps on your mobile without having to deal with tons of complexity getting your devices connected to the intranet, and more importantly you can make your works done remotely from home.
No comments:
Post a Comment