Ramirow
Veteran OT User
- Joined
- Aug 22, 2009
- Messages
- 584
- Solutions
- 15
- Reaction score
- 301
- Location
- Argentina
- YouTube
- ramirogrant
Hello everybody! Well, this is my first tutorial, I hope you'll find it useful. It gave me a lot of trouble to port forward two routers, that's why I've decided to make this tutorial, I'm pretty sure more people out there are facing or will, maybe, face this problem in a near future.
Anyways, port forwarding trough two routers(Or a modem and a router) is more complex than port forwarding trough one.
Let's look at this pictures.
A) This is a single routed network.
B) This is a double routed network.
The first router called A1 has an internal and an external ip address. The second router called A2 also has an internal and an external ip address. Every router does NAT (Network Address Translation). The external ip address is the one that connects that router to the WAN (Wide Area Network). The internal ip address connects the router to the internal network. A1's external ip address connects to the Internet, just like any other network. A1 also has an internal ip address which provides NAT to the internal LAN 1 network below it. The only thing connected to LAN1 is the router A2. A2 connects to LAN 1 with an external ip address. Notice that A2's external ip address does not connect to the internet, but to another private network. A2 then provides NAT to the LAN 2 network below it. A2 provides NAT through it's internal ip address. The computers then connect to LAN 2 and receive data from A2.
Ok, now that we understand how this network works, let's get to the point.
1) We want to forward ports from the WAN of A1 to a computer connected to LAN 2. To do this we need to forward the ports in A1 to A2's external ip address.
2) The next step is to forward ports from A2 to the computer you plan on running the program on.
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 the ip address on that computer changes, the ports will not be forwarded to the correct place.
Let's give an example.
A1 is connected to the WAN (Wide Area Network) or you can call it, Internet. It's External IP is 190.46.18.214 and his Internal IP is 192.168.1.1 (Lan 1)
A2 is connected to Lan 1 with an external IP Adress, 192.168.1.33 (Note that A2's External IP Adress doesn't connect to the internet but to another private network). It's Internal IP Adress is 192.168.0.1 (Lan 2)
Your computer is connected to A2 and has an Internal IP Adress, 192.168.0.101.
So, how should it be done? (For this example we will forward port 7171)
We'll log into A1 router, and port forward to A2's "External IP Adress".
(A1= Port: 7171 forwarded to 192.168.1.33)
After that, we'll log into A2 router and port forward to your Computer's Internal IP Adress.
(A2= Port: 7171 forwarded to 192.168.0.101)
And that's it! If you think I should add something just tell me, please comment! I Hope you find this useful!
Feel free to msg me if you need something.
Anyways, port forwarding trough two routers(Or a modem and a router) is more complex than port forwarding trough one.
Let's look at this pictures.
A) This is a single routed network.
B) This is a double routed network.
The first router called A1 has an internal and an external ip address. The second router called A2 also has an internal and an external ip address. Every router does NAT (Network Address Translation). The external ip address is the one that connects that router to the WAN (Wide Area Network). The internal ip address connects the router to the internal network. A1's external ip address connects to the Internet, just like any other network. A1 also has an internal ip address which provides NAT to the internal LAN 1 network below it. The only thing connected to LAN1 is the router A2. A2 connects to LAN 1 with an external ip address. Notice that A2's external ip address does not connect to the internet, but to another private network. A2 then provides NAT to the LAN 2 network below it. A2 provides NAT through it's internal ip address. The computers then connect to LAN 2 and receive data from A2.
Ok, now that we understand how this network works, let's get to the point.
1) We want to forward ports from the WAN of A1 to a computer connected to LAN 2. To do this we need to forward the ports in A1 to A2's external ip address.
2) The next step is to forward ports from A2 to the computer you plan on running the program on.
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 the ip address on that computer changes, the ports will not be forwarded to the correct place.
Let's give an example.
A1 is connected to the WAN (Wide Area Network) or you can call it, Internet. It's External IP is 190.46.18.214 and his Internal IP is 192.168.1.1 (Lan 1)
A2 is connected to Lan 1 with an external IP Adress, 192.168.1.33 (Note that A2's External IP Adress doesn't connect to the internet but to another private network). It's Internal IP Adress is 192.168.0.1 (Lan 2)
Your computer is connected to A2 and has an Internal IP Adress, 192.168.0.101.
So, how should it be done? (For this example we will forward port 7171)
We'll log into A1 router, and port forward to A2's "External IP Adress".
(A1= Port: 7171 forwarded to 192.168.1.33)
After that, we'll log into A2 router and port forward to your Computer's Internal IP Adress.
(A2= Port: 7171 forwarded to 192.168.0.101)
And that's it! If you think I should add something just tell me, please comment! I Hope you find this useful!
Feel free to msg me if you need something.
Attachments
-
1 tuto.JPG8.2 KB · Views: 209 · VirusTotal
-
2 tuto.JPG12.7 KB · Views: 203 · VirusTotal
Last edited by a moderator: