Can't forward the same port to muliple IPs?

Locked
Grandpa Stu
Posts: 2362
Joined: Wed Nov 01, 2000 8:00 am

Can't forward the same port to muliple IPs?

Post by Grandpa Stu »

i'm trying to forward specific ports with a Linksys WRT54GS to open up the NAT on a couple PS3s connected to the router. I can setup the first one no problem, but as soon as i try to forward the same ports but on a different IP it gives me a warning saying those ports are already being forwarded.

is there a legit reason for this like an actual limitation with the router, or some sort of quirky bug? i tried upgrading the firmware but all it did was change the way it warned me about forwarding the same port.

anyone with experience on this?
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Can't forward the same port to muliple IPs?

Post by Foo »

You only have one port with that number coming into your connection, so it's only possible to forward that port to a single internal piece of hardware.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Can't forward the same port to muliple IPs?

Post by Foo »

Image

God my diagrams fucking rule.

Anyway, as shown above, you have your ports on the router... there's only 1 set starting at 1 and going up to 65 thousand or something like that.

Then you have the same set of ports on the PS3. And again on the other one.

You can't forward traffic coming in on a particular router port to both PS3s at the same time because each PS3 would receive a copy of the same information.

The way around this is where my networking knowledge lacks. Some applications allow you to specify an alternative port (q3 - net_port I think) but there are some cases where it's not possible to run several devices doing the same thing...
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Can't forward the same port to muliple IPs?

Post by ^misantropia^ »

Foo wrote:You only have one port with that number coming into your connection, so it's only possible to forward that port to a single internal piece of hardware.
For UDP, yes (in almost every case). For TCP, no - where the exact value of 'no' is defined by your router's capabilities.
creep
Posts: 1007
Joined: Tue Dec 30, 2003 8:00 am

Re: Can't forward the same port to muliple IPs?

Post by creep »

^misantropia^ wrote:For UDP, yes (in almost every case). For TCP, no - where the exact value of 'no' is defined by your router's capabilities.
Please explain how a router (or any device) can take 2 incoming packets on, say, port 3111 and decide which goes to each of 2 different internal IPs. Or link a document explaining it :p

This is of course assuming the internal IPs have no requested these packets... because in that case it's not a 'port forwarding' issue at all.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Can't forward the same port to muliple IPs?

Post by Foo »

I guess the extra variable with TCP is state
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Can't forward the same port to muliple IPs?

Post by ^misantropia^ »

Foo wrote:I guess the extra variable with TCP is state
100% correct.
creep
Posts: 1007
Joined: Tue Dec 30, 2003 8:00 am

Re: Can't forward the same port to muliple IPs?

Post by creep »

Seriously... could you explain or offer a link to an explanation? I'm googling but mostly getting linux/bsd firewall table instructions, which isn't really explaining the process to me.
Grandpa Stu
Posts: 2362
Joined: Wed Nov 01, 2000 8:00 am

Re: Can't forward the same port to muliple IPs?

Post by Grandpa Stu »

oooo you learn something new every day :D

so then...what's port triggering? in my googling to figure this out i stumbled upon a post on the linksys forum and a guy said to use port triggering to forward packets over the same port but to different IPs. does that work or is he an r-tard?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Can't forward the same port to muliple IPs?

Post by ^misantropia^ »

creep wrote:Seriously... could you explain or offer a link to an explanation? I'm googling but mostly getting linux/bsd firewall table instructions, which isn't really explaining the process to me.
The truth is that both UDP and TCP are perfectly routable, but that lots of consumer market routers screw up UDP when two or more clients from the local network connect to the same external service. Such routers tend to track UDP traffic by the local port number. Works great when each client picks a random port number, not so great when the port number is static.

TCP is much easier to track because of the Sequence Number in the TCP header. It's a 32 bit random number that gets incremented with each packet. The chance of both clients generating the same sequence number is infinitesimally small.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Can't forward the same port to muliple IPs?

Post by obsidian »

misantropia, you wouldn't happen to be one of the people pictured below, would you? ;)

Image
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Can't forward the same port to muliple IPs?

Post by ^misantropia^ »

Not nearly old or hairy enough. :)

That's an awfully young Bill Gates in the left corner.
Locked