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.
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.
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
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.
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.
One thought on “DIY NAS â€“ Port Forwarding and Dynamic DNS”