What and Why?
These geeky phrases allow you to access something that is on your home wifi from the Internet while you are away from home. You might want to watch a security camera while you are away from home, or listen to the music collection that is on your home computer, etc.
Note that you can only do this with “network apps” that are set up to send things out over the network, like webservers, media servers, etc. Check the instructions for your app to see if it can do this.
I’ll try to keep things simple, but this will be slightly technical. To do this, you must be able to do these things:
- log into your home wifi router and change a setting.
- be able to install an app on a computer you always leave turned on in your home.
Every wifi router out there is different. I will tell you what settings to look for, but you will need to look up the features and instructions for your specific router model.
What is Port Forwarding?
Every time your computer, phone, or tablet connects to any network, it gets assigned a new IP address by the network. This lets the network keep track of all the devices connected to it. Every app on that device, which send stuff out to the network uses a different port number. So, IP address = the computer, phone, or tablet. Port number = one app running on that device.
How to Set Up Port Forwarding
When you are home, connected to your own wifi, you have one IP address. When you leave and go away from home, you have a different IP address. This changes every time you go somewhere and connect to a network again, whether it is wifi or a cellular data plan. Port forwarding is telling your router (which acts like the Great Wall of China around your in-house home network) that every time someone from the outside world tries to connect to it using a certain port, send that over to a specific app on a specific computer, phone, or tablet on your home wifi network.
To do this:
- Open a web browser on a computer that is plugged into your router with an ethernet cable, NOT one that is using wifi to connect.
- Type the address for your router into the web browser. This is usually http://192.168.1.1 (but not always).
- I’m assuming that you already know how to use your router, and that you set up a user name and password of your own when you bought it. You should get boxes that ask for that username and password. Most brands of routers have a default of something like “admin” for the user name and “password” for the password. You should change these to something no one else knows, that includes numbers and letters.
- The router’s internal settings web page will open. There might be a lot of tabs or menu items.
- You will need to know the internal IP address of the computer, phone, or tablet that you want to be able to connect to from the outside world.
- In Windows, click the start button, type “cmd” sans quotes, and then type “ipconfig” sans quotes. A lot of text will appear. Look for the spot where it says “IPv4 Address”. That string of four numbers is what you want to write down.
- On Android, go to the phone or tablet’s settings, then go to wifi settings, and tap the home network you are connected to. One of the pieces of info on that screen should be your IP Address. Write it down.
- Now that you are logged into your router, and the device that runs your app has a static internal IP on your home network, you need to know what port the network app uses. For example, a lot of normal webpage servers use port 80. The Android IP Webcam app I use has port 8080. Check the instructions or website for your app to see what port it uses. Write it down.
- Back to the router settings again. Look for a tab or section called Port Forwarding or Port Forwarding Range or NAS or something along those lines. I suggest you google specific port forwarding instructions for your router model.
- You should be able to enter or choose the device and enter the port number the app uses. You might have to enter the port number in two boxes. One is for the outside world (when you are trying to connect form away from home), and one is for the “inside” world of your home network.
- Look at your router’s “Status” page. You should be able to find the WAN address. This is the Wide Area Network address, or the IP address the router has to talk to the outside world. The address you would use when away from home to access your app would be http:// then your router’s WAN IP address, then colon, then the app port number. So, it might be something like this: http://220.127.116.11:8080
- You can test whether this is working by turning the wifi off on a cellphone, and using your data plan to try to connect to that address.
Dynamic DNS or “My WAN IP Changes When the Power Goes Out”
Just as your router randomly gives your phone a different IP each time you connect to your home wifi, your ISP randomly gives your router a different WAN IP address each time your router connects. So, if the router gets unplugged, or turned off, or the power goes out, when it reconnects, you will have a different IP. Some ISPs even just give you a new one every week, just because they can! Looking this up every time, so that you can access something when you are away from home gets old very fast. You could pay your ISP extra money to have a Static WAN IP address that never changes, but if you are just setting up something for your own use, this is an unnecessary expense. The answer is a Dynamic DNS or DynDNS service!
- Look in your router settings for a tab or section named “Dynamic DNS” or “DynDNS”. If you don’t see this, check the manual or the manufacturers web site. Many routers have this but not all of them. If your router has this, take a look at it. Some routers only let you use the service from dyndns.com, which is not free. Some have a list of compatible services, and some will let your enter “custom” info for any service.
- Set up an account on the service of your choice. You will get assigned an address like http://yoursite.noip.com or http:///yoursite.duckdns.org.
- Enter the required account information (from the service account you just created) into your router, and save settings.
- Use your new address with the app port number. For example, something like http://yoursite.duckdns.org:8080
What if My Router Doesn’t Support Dynamic DNS?
If your router doesn’t support Dynamic DNS, then you must choose a service that offers a Dynamic Update Client app. This is a small app that you install on a computer that is plugged into your router. You must always leave that computer turned on. It will send your new WAN IP address to the Dynamic DNS service each time it changes.
Once you have assigned a static internal IP address to the device your app runs on (in your router settings), set up a dynamic dns account, and added that to your router (or installed the updater app), you should be set! Welcome to the world of the home server. You can do cool things like these:
- Turn an old device into an Internet security camera
- Set up your own cloud storage (no more Box, Dropbox, OneDrive, iCloud, or Google Drive), for free, which no one else can see, read, or copy.
- Listen to your home music collection while you are away (1, 2, 3, 4).
- Run your own game server, so just you and a couple of friends can privately play a game like minecraft.
- Add a TV Tuner card to your home PC, connected to an antenna, and watch and record home TV while you are traveling.
- Run your own website at home