DIY NAS – Port Forwarding and Dynamic DNS

Ready so say “hello world” proper? In order to access your DIY NAS or home server or game server or whatever that is hosted at your house, you will need to do something called “port forwarding”. Port forwarding is usually performed and set up at the router level. Since there are hundreds and thousands of routers, I will be recommending you a few sites that you can take reference from. I will be using a popular custom router firmware (DDWRT) to illustrate the different steps that you will need to take in order to forward your ports correctly.

This guide will still be useful because the option names and the way you go about entering the values are somewhat similar. After you have successfully forwarded your ports, I will be teaching you how to setup a dynamic DNS service. This is to ensure that your service is accessible at all times.

Port forwarding in layman’s term is simply to direct a port on your WAN IP (wide area network) to a port on your LAN IP (local area network). The only way you can access a LAN service from outside the local network is via the WAN. Thus, port forwarding allows access to your NAS or server or whichever service you host from the outside.

To start, navigate to your router page. It usually is 192.168.1.1 but if you have it configured otherwise, access it accordingly.

router web UI manager

Locate something along the lines of “port mapping”, “port forwarding”, “forward” or simply anything that contains the keyword “port”, “forward” or “map(ing)”. It might be a sub section under another main category so try opening all the options till you find the port forwarding options.

There should be the following options (your option titles may vary but their functionalities remain the same); name/application, protocol, source, port from/port range, ip address /client/local ip, port to/local port.

port forward settings

Here are some explanations as to what each option does:

Name/application: to title what that port forward does. For your own reference.
protocol: there are usually three options, UDP, TCP and both. Google up the terms for more info.
port from: the WAN port that you want to forward.
ip address: your local ip address. For example the ip address of your NAS.
port to: the LAN port that you want to forwarded to.

Everything is pretty much self-explanatory. Say you have a web server on the standard port 80. The LAN ip address of the server is 192.168.1.10. You want to access the web server on the port 8000 on your wan ip address (this is given by your ISP. Simply google “what is my ip” for your wan ip address. Make sure you aren’t tunneled or using a proxy/vpn). The options will thus be filled in as follows:

Name/application: web server
protocol: both
port from: 8000
ip address: 192.168.1.10
port to: 80

Once you’ve done that. Save the settings and apply them. Restart your router if necessary. Once that is done simply use the following site to check if it is opened: http://www.canyouseeme.org/ (enter the wan port (port from) that you have opened). It should say that the port is open or something along those lines.

That is it! You have access to your local service from outside your local network! Now some tips if you are still unsure on going about it. The following site: http://portforward.com is amazing. You should be able to find your router there. If you still cannot find your router or something similar, simply google “[insert your router model] port forward”. You can also check your router manual for any instructions.

portforward.com

Now that you’ve learnt how to forward your ports, it is time to ensure that you have a static “wan ip address”. Most ISP will not provide home consumers with a static WAN ip. Usually when you reset your gateway/modem, a new WAN ip is issued to you. This meant that if you only have your WAN ip bookmarked or stored, you will not be able to access your local service should your WAN ip change.

Thankfully there is something called “dynamic DNS”. In layman’s term, dynamic DNS allows you to have something like a domain name that will always be updated to your latest WAN ip. Thus by accessing that domain name, you will always be directed to your current active WAN ip.

Dynamic DNS is usually setup at the router’s end as well. Most routers support such a feature. If it doesn’t I would suggest you upgrading your router to one that supports it. Firstly, navigate to your dynamic dns options page. The option should be called “ddns” or “dynamic DNS” or something along those lines. Check to see if there are any preset services available. I’ll be using the free service http://freedns.afraid.org/. Create an account if you haven’t done so already. If you’re using any other service, do use google to find tutorials on how to set it up.

Once you have your account set up, go on and create a new subdomain. Select “Type: A”.

Once you’ve done that, access the “Dynamic DNS” page. Located the subdomain and copy the url in “Direct URL”. From what you have copied, copy just the portion after the “?”. In the “Host Name” on the DDWRT (router) page, enter your domain name (e.g swiftnas.mooo.com) followed with a comma and then whatever you have copied. The update interval can be left as it is. You can reduce the number to make it more responsive and update more frequently. The number of updates you can get varies from service to service. Apply the settings and check if it is good to go by pinging the domain name.

It should show your current WAN IP address.

You have successfully gained access to your local service from the outside.

Hello world!

No votes yet.
Please wait...

One thought on “DIY NAS – Port Forwarding and Dynamic DNS”

Leave a Reply

Your email address will not be published. Required fields are marked *