What's new

Portforward?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

rslarsen

Occasional Visitor
Hi
I have 2 computers with same programs installed, they use same ports but with two different lan ip's. How can I portforward both computers to the same ports?
Have tried to do it, but Asuswrt-Merlin RT-AC66U says the port is in use.
It was possible on my old router with DD-WRT on.
 
Hi
I have 2 computers with same programs installed, they use same ports but with two different lan ip's. How can I portforward both computers to the same ports?
Have tried to do it, but Asuswrt-Merlin RT-AC66U says the port is in use.
It was possible on my old router with DD-WRT on.

There is no way you can forward a given port to two different IPs. How is the router supposed to figure out which of the two computer it should forward the connection request to? It just doesn't make any sense.

If DD-WRT allowed this, then it meant only the first rule actually worked, and the second one was completely ignored, as iptables would jump the first matching rule.
 
Well I don't know how DD-WRT could handle two ports at same time on two different computers, but it worked. I could use both computers at same time at same ports.

But thanks anyway for your answer. I have to use different port for each program.
 
Well I don't know how DD-WRT could handle two ports at same time on two different computers, but it worked.

Trust me on this: it didn't.

Picture this: two computers running a web server on port 80. On your router you forward port 80 to both servers.

Now someone tries to visit one of your websites. It connects to your router's port 80. The router has to forward the traffic to one of your two servers.

Now how can the router figure out WHICH of your two web servers contains the desired website? It cannot. All it knows is: "Someone connected to port 80 using the TCP protocol. I'm supposed to forward this to another computer because I have a forward rule."

So if you have BOTH forward rules entered in the firewall, it will pick up the first port forward, and never use the second one. So, the visitor will always see the web content of the first server.

Just because you could run the web server on both machines at the same time does not mean that both will be reachable from the Internet. You probably thought that your forwards were working because you were able to run the program on both computers, but only one of them was really reachable from the Internet.
 
Last edited:
rslarsen said:
I have 2 computers with same programs installed, they use same ports but with two different lan ip's. How can I portforward both computers to the same ports?

The best you could do is by using port triggering instead of port fowarding. This way, you could setup a port that would reach the lan device that triggers it. But this is more difficult to setup than port fowarding (and not always possible). But it won't allow simultaneous access to 2 devices on the lan at the same port, but it allows more flexibility as no static ip is necessary for the lan device like port fowarding requires. So it allows more than one device on the lan using the same application (but not at the same time) to receive external traffic on the same port when triggered.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top