Showing posts with label LAN1 & LAN2. Show all posts
Showing posts with label LAN1 & LAN2. Show all posts

Thursday, October 28, 2010

Double Router Forwarding process

As a CCTV Engineer / Technician its very hard to configure Double Router Forwarding for your Installed DVR. As a Technical Writer this post is dedicated to all who call / Mail for writing this Process. My aim is to keep this guide as simple as possible, while still providing you with the information you need to know.

As you can imagine, port forwarding through two routers is a bit more complex than port forwarding through one router. Below is a diagram of a double routed network.

Important Things to Notice:
· Both "Router #1" and "Router #2" have TWO IP addresses; an Internal IP address and an External IP address.

·    There are TWO LANs (Local Area Networks).

·    There are TWO WANs (Wide Area Networks). If there is a LAN then there is an accompanying WAN.
Now that we have identified these things we can go on to learn how they affect us.


Network Address Translation
For the sake of readability, from now on I will refer to "Router #1" and "Router #2" as "R1" and"R2" respectively.
Every router does NAT (Network Address Translation), and has both an internal IP address and an external IP address. The external IP address is the one that connects that router to the WAN (Wide Area Network). Usually the WAN is the Internet. The internal IP address connects the router to the internal network. Our network here is a bit more complex than the basic network.
R1's external IP address connects R1 to the Internet, just like any other network. R1 also has an internal IP address which provides NAT to the internal LAN1 network below it. The only thing connected to LAN1 is the router R2. R2 connects to LAN1 with an external IP address. Notice that R2's external IP address does not connect to the internet, but to another private network. Another way to say that is, R2's WAN IP address is external to R2 but internal to R1. R2 then provides NAT to the LAN2 network below it. R2 provides NAT through its internal IP address. The computers then connect to LAN2 and receive data from R2.
Let's assign IP addresses to everything, and see how it would look.

Notice that the IP addresses that exist on LAN1 differ from the IP addresses on LAN2. The IP addresses that are on LAN1 are 192.168.1.1 and 192.168.1.5. The IP addresses that are on LAN2 are 10.0.0.1 and 10.0.0.15. Here is another diagram to help show the network divisions:

Configure Port Forwards

Okay enough idle chatter. Let's talk about how to forward ports through this network.

Step 1

We want to forward ports from the WAN of R1 to a computer connected to LAN2. To do this we need to forward the ports in R1 to R2's external IP address. In this example we would log into R1 and forward ports to 192.168.1.5.
Note: In order to connect to R1's web interface one will probably have to plug a computer directly into R1 and establish a connection on LAN1.


Step 2

The next step is to forward ports from R2 to the proper network device whether it be a computer, XBOX, or PS3. (The Proper network device is the device on which you run the program for which you are forwarding ports.) In our example we would log into R2, and then forward ports to 10.0.0.15.
If you are having trouble forwarding ports or just don't want to deal with the hassle of doing it manually, check out PFConfig; a software tool that automatically forwards your ports.

Using the Free Router Detector you can know IP address for each host. Download Now & Install.


Static IP Addresses

You have now set up port forwards in your double router network and everything is working without a hitch. That's great, but if you have not configured static IP addresses for the network devices for which you have forwarded ports then your port forwarding settings are just waiting to break. When your port forward settings stop working, the most likely cause is that the network device for with you have forwarded ports has obtained a different internal IP address than the internal IP address that it had when you originally configured your port forward settings. The result is that your ports are no longer forwarded to the correct IP address.

How do I stop my port forward settings from breaking?
Static IP addresses allow you to assign an IP address to a network device and ensure that its IP address does not change.
The network devices for which ports are being forwarded need to have a static IP address. If a device does not have a static IP address, then it has a dynamic IP address. Dynamic IP addresses can/will change. As stated earlier, if the IP address of a network device for which ports you've forwarded ports changes, the ports will not be forwarded to the correct place. So it is important to setup a static IP address on the network devices for which you intend to forward ports.
The same applies to R2 in our example. R2's external IP address should really be static. This is not too big of a problem if R2 is the only network device connected to LAN1. If R2 is the only device on LAN1, it is unlikely that its IP address will change. If you have other devices on LAN1, you really need to setup a static IP address on R2. You would make configurations for a static IP address in the WAN section of R2.