Port forwarding for multiple internal IPs with only one external IP

dkeerl

Honorable
Nov 14, 2012
2
0
10,510
If I have a modem with two physical jacks (one external IP) and plug a router into each of those, then forward the same port on both routers, would that effectively let me bypass the limitation of one port to one IP?

I know just enough about networking to understand that in a typical household setup UPnP should take care of me but it's not. Also, I know that I can't forward a port to multiple IPs on one router but I don't know if that's a limitation of a consumer router or not.

Lastly, if that won't work, will subnetting?
 
Solution
If I read it right, you are trying to get both routers to have the external IP address and all incoming traffic should go to both.
Problem 1 ... 2 devices with the same IP address ... you just broke the internet (ok, not really, but all kinds of weird stuff is going to happen).
Problem 2 ... a modem with multiple LAN ports is really a modem/router and they generally connect the LAN ports to switch hardware, so you are not going to be sending all traffic to both routers. If the modem was using hub hardware then, yes, all data goes out on all ports, but you are back to problem 1.
Problem 3 ... let's say it did somehow work ... a client on the internet sends a request to your server(s). The request goes to both routers and both routers...
You can't forward the same packet to 2 places (at least not with consumer grade equipment).

I think the fix to your situation is to setup your servers on different ports. Many servers will allow you to configure the port you want to use. Using a webserver as an example ... we generally think of port 80 being the webserver port, but it doesn't have to be.

mysite.com:80 -> computer 1
mysite.com:81 -> computer 2
mysite.com:82 -> computer 3
 

kanewolf

Titan
Moderator
Consumer equipment can do what @anotherdrew says. You can use different ports on the WAN side to forward to multiple LAN IP addresses. This is what I do to make all 9 of my webcams accessible from the WAN.
With commercial equipment (think $25K+) you can do load balancing to a virtual IP address where a single port 80 incoming can be sent to one of a pool of servers. You can even have the load balancer look at a URL and route to a specifc host based on the URL. So mysite.com/url1 would go to a different host than mysite.com/url2
 
While port forwarding is simple to setup, it's antiquated. The better approach is to setup your own VPN server. Now the only open port you ever have to manage is the one supporting the VPN. And you can connect to your home devices as if you were physically there.

Granted, it would take some effort to learn how to do this. It's not as brain dead simple as port forwarding. But it's far more secure, and you avoid all these other issues involving the need for multiple IPs from the ISP, remapping ports, etc.
 

dkeerl

Honorable
Nov 14, 2012
2
0
10,510


Unfortunately I can't change what ports are in use as that was my first idea. So just using the two routers each with their own line to the modem wouldn't be the simple fix? I already have the two routers, they are even the same model.
 

kanewolf

Titan
Moderator
Unless you purchase additional public IPs from your ISP so that each router gets a public IP, it probably won't work. Most ISPs will only provide one public IP address to a modem. Whichever device requests first gets it. Tho rest don't get an IP.
 
If I read it right, you are trying to get both routers to have the external IP address and all incoming traffic should go to both.
Problem 1 ... 2 devices with the same IP address ... you just broke the internet (ok, not really, but all kinds of weird stuff is going to happen).
Problem 2 ... a modem with multiple LAN ports is really a modem/router and they generally connect the LAN ports to switch hardware, so you are not going to be sending all traffic to both routers. If the modem was using hub hardware then, yes, all data goes out on all ports, but you are back to problem 1.
Problem 3 ... let's say it did somehow work ... a client on the internet sends a request to your server(s). The request goes to both routers and both routers forward it to the specified server. Now both servers respond (maybe with different information). The client receives 2 responses ... which should it use? Are you writing the client software yourself so it will understand how to use 2 responses?
 
Solution