Accessing Your Server When You're Away From HomeWant to control your server and services from away from home? I did and here's how I achieved it.
Setting Up A Static Hostname for your Home NetworkTo access your server from outside of your home network you need to know your network's unique address on the internet, this is done using an IP address that is assigned to you by your ISP. Sadly this IP address isnt always the same, it is 'dynamic'* and can change at any time.
Thankfully there is a solution to this problem of not being able to know for certain your IP address when you're away from home, you can use a free hostname service which can assign a non-changing address to your changing IP address. So, for example, instead of 80.3.229.20 (an IP address) you can access myServer.dyndns.com
I use and recommend
DynDNS, a totally free, spam free service which is very well supported. Create and verify an account on their site.
On the first page you see after you have verified your account you will be presented with various paid account options, the free option is below all of these.
On the following page you get to choose the address for your network. Choose carefully, you might be typing it in regularly in the future! I am of the opinion shorter is better.
Leave 'Host with IP address' selected.
Fill in your current IP address, this is given to you below the text box. This will be correct if you are on the same network, even if you are not on the same computer.
'Proceed to Checkout' then 'Activate Services' on the next two pages. You should then see that your new address was 'Successfully Activated'
Now you have your address you need to make sure it is updated when your IP address changes. Many routers support DynDNS and can do this update automatically so I suggest you google 'DynDNS your_router_name' to see if you can take that route.
Alternatively you can download a tiny DynDNS client which will sit on your server and handle the IP updates. Download it from:
http://dyn.com/support/clients/When installing ensure you leave 'start with Windows' checked, this ensures the tool is always running so it can update your IP address if it changes.
However I suggest you Uncheck the 'Dyn Internet Guide' which is an unrequired tool of no use.
Log in to the application when it loads.
Select your hostname in the 'My Hosts' window, click 'Apply' and you now have a hostname that will update for you automatically!
*Some ISP's will allow you to have a static IP address but it usually costs extra.
Setting A Static IP Address in Windows Server 2008 R2Now that we have a static address for your home network we can access the router from anywhere. We now need to have any requests forwarded by our router to the correct machine (in this case our HP Microserver). To do this we setup rules in the router to forward certain requests to certain machines. To do this we need to know the IP address of the server so we will make it static.
Firstly we'll find out the current IP address of the box, we'll use this and set it as the permanent IP address.
In the Start menu search box type 'cmd' and press enter. In the command window that opens type 'ipconfig' and press enter.
In the results you will see the current 'IPv4 Address', 'Subnet Mask' and 'Default Gateway'. You will need these later!
In the Start menu search box type 'Network connections' and click the result 'View Network Connections'
In the window that opens, right click on the 'Local Area Connection' and select 'Properties'
Select 'Internet Protocol Version 4 (TCP/IPv4)' and press 'Properties'
Select 'Use the following IP address' and fill in the details as you saw them in the command window earlier. Take note of the IP address for later.
In the DNS section I like to use the third party service from
http://www.opendns.com/ You can use the same values as my image or go to the site for yourself and you will see them at the bottom of the page.
Click 'Validate Settings Upon Exit' and click OK.
Your server now has a static IP (in this case mine is using 192.168.0.13)
Setting Up Port Forwarding On Your RouterThis will vary substantially by router so you may need to google for a specific guide for your router. I am using a Virgin Media Super Hub.
To access your router you need to put the IP address into your browser. The address is the 'default gateway' you used earlier, quite often it will be 192.168.0.1
Log in to your router, if you dont know the login details they may be written on the router itself, if not, google for the defaults.
The area you are looking for in the settings is 'Port Forwarding', this may be under 'Advanced Settings' section if there is one.
The way port forwarding works is that any requests for a specific port can be routed to the machine which hosts the service on that port. I have the following rules set up, depending on which applications you use you may only want some of these:
Port | Application |
3389 | Remote Desktop |
5000 | CouchPotato |
8081 | SickBeard |
8080 | sabNZBd |
9091 | Transmission |
Now! Combining all of the above steps you should be able to access any services hosted on your server from anywhere in the world!
In the windows 'Remote Desktop Connection' you can simply type your dyndns address (myServer.dyndns.com) and hit connect!
For other services type you dyndns address followed by the port number into your browser eg:
myServer.dyndns.com:5000 for CouchPotato
myServer.dyndns.com:8080 for sabNzbd etc
I STRONGLY advise you to set up a strong username and password for any service you expose over the internet otherwise anyone will be able to access them and mess with your business!