The following information can be helpful with port forwarding set up with a router. Some people may not know what port forwarding is, but it can be very useful knowledge to have these days. If you have a router at home this will likely come in handy at some point in time. A router works by routing the internet or network connection to all of your computers and devices. Everything is simple; the router makes all requests internally. The router sends the information to the computer that requests it and, if all is well, everyone is happy. Later, you decide to set up a security camera system, a DVR, host a website, or all of the above from home or the office.
You go to WhatIsMyIP.com and make note of your IP, then while you are out, you try to connect and it fails. All internal testing went well, but outside the network nothing seems to work. In fact, some of the more common questions we receive involve port forwarding. If you are in this position, then this information could prove useful. You can remotely connect to your DVR, camera system, or any internally hosted server or service.
What Is Port Forwarding?
A simple analogy is comparing your network to a phone system. The main phone line is like the IP address and ports are like phone extensions. If you call the main line without telling the operator (router) which extension you want, your call will go nowhere. The router has rules to send your request on particular ports to a certain host as defined by you, which is similar to defining your phone extension. Servers listen for incoming connections on certain ports. However, without telling your router where to send these connections, they will never arrive. Port forwarding sets up your router to correctly redirect external inbound service requests to the correct internal computer on your network.
Setup of a router for port forwarding only requires a few steps. However, while every router brand has a different web interface that you access to accomplish these steps, the following information should get you to the general area.
Do you think this is a pain? Believe it or not, your router is doing you a favor by acting as a firewall preventing inbound requests from getting to any of your devices. So with no ports set to forward, the router is another layer of protection.
How To Port Forward
First thing to do is locate the IP address of your router. Most of the time it is either 192.168.0.1 or 192.168.1.1. However, if you want to figure out the IP, here's how:
In Windows you will need to load up a command prompt. Then enter 'ipconfig' and you will see something similar to the image below.
What you are looking for is the “Default Gateway.” My router IP is 192.168.1.1. You should also do this on the computer that is the server and make note of what the IP address is. You can see that my internal IP is 192.168.1.105.
If you don't use Windows you will use the command netstat -nr for Mac and the command route in Linux.
Once you get the default gateway you need to enter it in to your web browser address bar as seen below.
Once you enter the address and hit enter, you will then see a login screen or prompt. You will need the username and password for your router.
Some common router default usernames and passwords are:
Linksys – Use admin for both username and password
Netgear – Use admin for username and password for the password
Making Changes to the Router
Once you are in to the router, where you will find the port forwarding settings depends on the manufacturer's portal. In Linksys, you will click on “Applications and Gaming,” as seen below. However, in some routers you may have to go in to the “Advanced” settings. Once you get to the “Port Forwarding” section you will either have a list (shown below with some examples from a Linksys router) or a section to add a new port forwarding rule. You will need the IP of the computer running your server (found earlier with the necessary command: ipconfig, netstat -nr, or route) and know what port the server is using. The examples below are actual ports that were needed to forward for certain games and servers to function correctly. After you are finished adding your entries make sure to enable your forwarding and save your settings.
Your server should now be able to receive incoming connections through your router. If you are still experiencing problems, it would be recommended that you re-check your settings on the router and check your Firewall settings on your server or computer.