Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables local forwarding game server
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
aequitas
Apprentice
Apprentice


Joined: 28 Aug 2002
Posts: 190
Location: Ooy bij arnhem

PostPosted: Tue Feb 15, 2005 4:52 pm    Post subject: iptables local forwarding game server Reply with quote

I got myself a openttd gameserver running at a spare powermac at home. My server routes it nicely to the internet so people can join. Only i can't join from the inside with the external ip adres. So i have to add the local ip adres manually every time.

I tried using the following iptables rule:

# forwaring openttd
iptables -A PREROUTING -t nat --protocol tcp -i eth0 --destination-port 3979 -j DNAT --to 192.168.0.5
iptables -A PREROUTING -t nat --protocol udp -i eth0 --destination-port 3979 -j DNAT --to 192.168.0.5

eth0 is the local networking interface. 192.168.0.5 is the game server.

The game uses port 3979 for connections and uses udp and tcp.

When i check the server logs my desktop from which i try to connect doesn't show up.

Am i doing something wrong here with the iptables? Or could it be that the game switches to a different port after connecting a client?
_________________
I am not superstitious, that brings bad luck.
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