• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Double Router Port Forwarding

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.

9543d1314165888-double-router-port-forwarding-1-tuto.jpg


B) This is a double routed network.

9544d1314166165-double-router-port-forwarding-2-tuto.jpg


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

Last edited by a moderator:
A2 can't have external IP 192.168.1.33, because than he can't even reach A1 (192.168.0.1) because they are in a different subnet.

Also A2 can't have 192.168.1.33 as external IP and 192.168.1.1 as internal IP because those 2 IP's are in the same subnet, that way the router won't know if he has to send an packet to an internal address or external address.

and ofcourse your computer's internal address can't be 192.168.0.101 because that will cause the computer not being able to reach A2 because he is in a different subnet.

The idea is nice but you've messed up some of the IP addresses I believe.

Also this has nothing to do with the operating system and/or windows, its the network options.
 
Well..Those are the actual IP's of my D-link (192.168.0.1) and my Zyxel :/ and that's how I've forwarded them, and that port set does work. Zyxel's pool starting adresses starts at 192.168.1.33 and so on (For external ips), maybe that's why 192.168.1.1 is setted to be internal ip. Anyways, just tried to give an example so other people get the idea, those ips may and will vary in other computers and networks.

Thanks for the comment n.n


EDIT: And my computer's internal ip is that one listed too :p
 
It shouldnt be possible normally unless you mess around with the subnetmask.
Also for practical reasons I would put A1 internal and A2 external on 192.168.0.X and A2 internal and PC on 192.168.1.X that should always work and be easier to maintain.

Could you give the used subnetmasks on the 3 devices?
 
I think i've messed up something in the post, In my real situation, that A2 is A1, hahaha it's so confusing, too many numbers.
I have them this way. A1 is connected to the wan, and it's internal ip is 192.168.1.1. A2 internal ip is 192.168.0.1 with dhcp enabled ('cause im too lazy to disable, and my computer is the only one connected so it's unlikely that my ip will change) and my computer internal ip is 192.168.0.101

EDIT: I've updated the main post. Check now, it should be right.
 
So I was right (yeah!) you messed the ips up.
Nice tut if you just change that.

Im running a similar setup but behind R1 are my servers and behind R2 the office network.
Though my R1 is not a nat router and doesnt need portforwarding.
 
Hahaha you were right (sigh) Changed.
And thanks :D

I see, I've heard that if you have multiple routers and you want to port forward it's easier to set dmz, to send all incoming data to an specific place on the private network, but never really tested it.
 
Uh very useful tutorial dude !
I agree with u it's so confusing , i'm still learning about dns , subnet , and then i ll' start my otserv..
But thanks btw , i ll' save it here , if i need someday :p
 
I have follow your tutorail but after all my ports still closed.
my inside ip is 192.168.0.100 @a2
router a2 got the ip 192.168.1.14
so I setup in router a2 port 7171 for 192.168.0.100 and router a1 port 7171 for 192.168.1.14.
I already check if firewall blocks the ports.
 
Back
Top