![]() |
|||||||||
![]() |
![]() |
||||||||
|
|||||||||
Port Forwarding with Two Routers.If you have not read our What is Port Forwarding page, now would be a good time to do so. I'm going to try 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.
Here is a picture of a double routed network. ![]()
The first router called R1 has an internal and an external ip address. The second router also has an internal and an external
ip address. Every router does NAT(Network Address Translation), and has 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 it's 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. I'm going to include another picture here, to help show the
network divisions. ![]() Okay enough idle chatter. Let's talk about how to forward ports through this network. 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. It is important to note, that to connect to R1's web interface we will probably have to plug a computer directly into R1. The next step is to forward ports from R2 to the computer you plan on running the program on. In our example we would log into R2, and then forward ports to 10.0.0.15. We should really think about static ip addresses at this point. The computer that the ports are being forwarded to needs to have a static ip address. If you do not have a static ip address, then you have a dynamic ip address. Dynamic ip addresses can/will change. If the ip address on that computer changes, the ports will not be forwarded to the correct place. So it is important to setup a static ip address on the computer you are forwarding ports to. The same thing is true about R2. R2's external ip address should really be static. This is not too big of a problem if R2 is the only thing connected to LAN1. If R2 is the only device on LAN1, it is unlikely that it's ip address will change. If you have other devices on LAN1, you really need to setup a static ip address on R2. This would be setup in the WAN section of R2. |