5

I am trying to forward a series of ports to my computer. I have several computers in my network, and believe my router randomly assigns a port to each computer that connects to it. As I don't have a static IP for my computer, I was wondering if it is possible to forward the ports to all the IPs?

5
  • 1
    You are confusing the terms "IP address" and "port". The answer is "no". You forward a port, or a range of ports, to a single IP address. You want to set your router to statically assign an IP to you to have permanent working port forward rules. May 14, 2012 at 16:45
  • @DanielAndersson your comment should be an answer, also configure the router to a smaller range of dhcp addresses, then assign PC's that need ports opened static ip's outside of that range to avoid dhcp collisions with other devices on the network.
    – Moab
    May 14, 2012 at 17:18
  • You need to rewrite the question for it to make sense, but seems you already got an answer from Daniel - flagging to close.
    – Alok
    May 14, 2012 at 17:38
  • The only sensible way I could think of of redirecting one port to many IPs is a round-robin scenario where servers can't serve user connections alone.
    – sinni800
    May 14, 2012 at 18:02
  • @Moab: Yeah, it turned it to be somewhat of an answer. I originally thought that since the question mostly concerned a confusion of terms, it was more of a comment than an answer. When I read it again, and it seems that it was a sufficient answer to the poster, it probably should have been an answer, though. May 15, 2012 at 6:18

1 Answer 1

5

Technically what you state is possible. A host can accept incoming traffic on a given IP address+TCP/UDP port, and be programmed with forwarding that same traffic to mutliple IP addresses.

With TCP this would not do anything useful. TCP is a connection-oriented service depending on sequence numbers and state maintained between two, and only two hosts - it is really meant for only two hosts to communicate. Exception: if you wanted a second host to record traffic but not participate, then this would be useful.

It's possible to design something using UDP in this method but the aboveboard protocol would have to support that. HTTP, for example, depends on the connection-oriented properties of TCP. Some peer to peer protocols may operate this way, but not all protocols that use UDP do.

Multicasting supports this but only "one-way" - multiple hosts can "sign up" to a multicase IP and receive traffic, but sending is not covered.

So, to summarize, port forwarding is a 1-to-1 affair. You need to have a static IP or use UPnP if your router supports it. @Moab provides a good solution - on most home routers you can limit the range of IP addresses DHCP hands out (e.g. 192.168.0.2 through 192.168.0.126), and then manually set your system to something outside of that (manually set your system to 192.168.0.129).

Not the answer you're looking for? Browse other questions tagged .