Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Forwarding ports to multiple machines
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mehmet.scholl
n00b
n00b


Joined: 11 Mar 2005
Posts: 17

PostPosted: Sun Oct 16, 2005 11:59 pm    Post subject: Forwarding ports to multiple machines Reply with quote

Could anyone tell me how i´m able to do that? I want to play starcraft over hamachi. we tried to play 2vs2. both teams behind a router. 2vs1 or 1vs2 is no problem but when we try to play a 4 player game the lag will appear about 10 min from the start. searching now about 3 months without a proper hint until today. found an article which suggests forwarding some starcraft ports to both machines behind the router since the game is not really able to work with NAT.

thx
Back to top
View user's profile Send private message
libero
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2004
Posts: 87
Location: Tokyo

PostPosted: Mon Oct 17, 2005 2:18 am    Post subject: port forwarding basics Reply with quote

hi

your description is not clear enough to me to give you exact instructions. But here are some basics of port forwarding.
It uses SSH. You can set up a single port forward like this:

Code:
ssh -L 8080:example.com:80  example.com


After authentication you get a shell on example.com. This is an example of forwarding web traffic. Then, on your local computer open up a browser, and enter the URL http://localhost:8080/
Your browser sends its request to the local port 8080, which gets passed over to port 80 at example.com, which processes the request and sends the answer back over the same channel to be displayed in your browser.

You forward other ports, including those for your game, the same way.

If you want to forward a single port to multiple destinations simultaneously, that might be difficult. Reading "man ssh" will help a bit.

Hope this helps

L
Back to top
View user's profile Send private message
Sourcecode
Guru
Guru


Joined: 25 Apr 2005
Posts: 392
Location: Germany, Kerpen in sew of Cologne

PostPosted: Mon Oct 17, 2005 2:30 am    Post subject: Reply with quote

If you want to Forward some Ports use IPTABLES or a Port Forward Daemon like :

* net-misc/portfwd
Latest version available: 0.26_rc6
Latest version installed: 0.26_rc6
Size of downloaded files: 132 kB
Homepage: http://portfwd.sourceforge.net
Description: Port Forwarding Daemon
License: GPL-2


create a config file in /etc called : portfwd.cfg with this in there :

Code:
protocol { port2 { => ip:port2  } }


Example :

Code:
tcp { 23 { => 192.168.1.2:55 } }


or

Code:
udp { 23 { => 192.168.1.2:55 } }


All peoples wo connect to my maschine on port 23 will be forwarded to the Maschine with the ip 192.168.1.2 on Port 55

wehn you edited your config file start the daemon @boot and on the running system :

rc-update add portfwd default

/etc/init.d/portfwd start
_________________
Es gibt bloss eins, was wichtig ist: dass man sterben muss.

Suicide is man's way of telling God, "You can't fire me - I quit."

no one gets out here alive....
Back to top
View user's profile Send private message
mehmet.scholl
n00b
n00b


Joined: 11 Mar 2005
Posts: 17

PostPosted: Mon Oct 17, 2005 11:46 am    Post subject: Reply with quote

Thank you for your help. I think my description was a bit unclear. The forwarding of a special port to a single machine is not my problem. As an example i´m forwarding port 23 on my router to a special machine in my lan on port 50.

The problem is I want to forward port 23 to all of my machines.
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Mon Oct 17, 2005 12:11 pm    Post subject: Reply with quote

mehmet.scholl wrote:
The problem is I want to forward port 23 to all of my machines.


Quite simply, not possible.
Back to top
View user's profile Send private message
saturas
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 104
Location: romania

PostPosted: Mon Oct 17, 2005 12:30 pm    Post subject: Reply with quote

Monkeh wrote:

Quite simply, not possible.


it is a posibility:
-start a telnet server on each station you want to use telnet service but on diferent ports let's say port1, port2, etc
-use this firewall rule (on the firewall machine) for each station

iptables -t nat -A PREROUTING -d $PUBLIC_IP -p tcp -m tcp --dport $PORT_nr -j DNAT --to-destination $IP_nr:PORT_nr

* replace PORT_nr with the port on witch you set telnet for the IP_nr machine

** take care when decideing witch ports you want to use(do not use 22 for example because it is reserved for ssh)

REVIEW :)
my example was refering to a server if you manage to make the starcraft client working on a single port every time , you could use the above rule but not with tcp but with UDP (i remember that starcraft uses UDP packages)
_________________
"I can't go on. I'll go on."
S.B


Last edited by saturas on Mon Oct 17, 2005 9:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
bigfunkymo
Apprentice
Apprentice


Joined: 23 Jan 2004
Posts: 237

PostPosted: Mon Oct 17, 2005 4:31 pm    Post subject: Reply with quote

Quote:
Quite simply, not possible.

If you're going to be this ignorant on the subject matter, please quit giving advice.
_________________
[No package... Grabbing a set.]
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Mon Oct 17, 2005 6:13 pm    Post subject: Reply with quote

bigfunkymo wrote:
Quote:
Quite simply, not possible.

If you're going to be this ignorant on the subject matter, please quit giving advice.


If you're going to be this much of an arsehole, please quit talking.

Anyway: With most normal routers it isn't possible, at least through the web control panel. It IS I admit possible (though the results might not be what you expect) by manually setting iptables rules, but I prefer to assume people don't have that sort of knowledge (and infact I'm not much for doing stuff that way myself), nor a linux box set up as a router (however, many routers are linux, including my own, so you could telnet in, not a permanent solution however).
Back to top
View user's profile Send private message
tutaepaki
Apprentice
Apprentice


Joined: 11 Nov 2003
Posts: 279
Location: New Zealand

PostPosted: Mon Oct 17, 2005 8:17 pm    Post subject: Reply with quote

Sounds like your game is getting confused about seeing >1 gamers from the same IP. You will either need 2 registered IPs at each end, or better, set up a VPN link between the 2 routers so that you can pass the REAL, non-registered IP addresses through the tunnel.
Back to top
View user's profile Send private message
mehmet.scholl
n00b
n00b


Joined: 11 Mar 2005
Posts: 17

PostPosted: Wed Oct 19, 2005 12:11 pm    Post subject: Reply with quote

Hey guys calm down. Tutaepaki you are right. The game has problems with NAT and more than one PC behind the router. I think the VPN scenario is the only clean solution i have. I´m configuring OpenVPN at the moment and it looks promising... i will tell you.

thx
Back to top
View user's profile Send private message
mehmet.scholl
n00b
n00b


Joined: 11 Mar 2005
Posts: 17

PostPosted: Fri Oct 21, 2005 11:29 pm    Post subject: Reply with quote

Open VPN is working like a charm. Network is set up. I can see every pc in the new VPN-Network. But....

The f.... damn game lags and lags and lags after 15min of playing ...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum