Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - uga

Pages: [1]
1
I had the linkdead problem the first time i tried to connect, so i started to play with my firewall. I have a DSL connection with a linux box doing all the firewall/connection tracking/NAT stuff. It is running a 2.4 kernel and i use iptables to configure the rules of the fw. My computer has an \"internal ip\" and also i have the \"public ip\", provided by the ISP.

Simply i redirected all the UDP 13331 code form/to my computer through the router.

This is the script i use to configure the firewall for planeshift and it works for me, hope it helps:
Code: [Select]

#!/bin/sh
# The iptables program!
IPTABLES=iptables
# The internal IP of the game machine
gamer=
# The external IP of the fw machine
EXT_IF_ADDR=

open_planeshift_server() {
   echo \"Planeshift Server $1 ($2:$3)\"

   # TCP - ALLOW - Is tcp really used?
   $IPTABLES -I FORWARD -p tcp -s $gamer -d $2 --dport $3 -j ACCEPT
   # TCP - NAT
   $IPTABLES -t nat -I POSTROUTING -p tcp -s $gamer -d $2 --dport $3 \\
               -j SNAT --to-source $EXT_IF_ADDR

   # UDP - ALLOW
   $IPTABLES -I FORWARD -p udp -s $gamer -d $2 --dport $3 -j ACCEPT
   $IPTABLES -I FORWARD -p udp -s $gamer -d $2 --sport $3 -j ACCEPT
   $IPTABLES -I FORWARD -p udp -d $gamer -s $2 --dport $3 -j ACCEPT
   $IPTABLES -I FORWARD -p udp -d $gamer -s $2 --sport $3 -j ACCEPT
   # UDP - NAT
   $IPTABLES -t nat -I POSTROUTING -p udp -s $gamer -d $2 --dport $3 \\
               -j SNAT --to-source $EXT_IF_ADDR
   $IPTABLES -t nat -I POSTROUTING -p udp -s $gamer -d $2 --sport $3 \\
               -j SNAT --to-source $EXT_IF_ADDR
   $IPTABLES -t nat -I PREROUTING -p udp -d $EXT_IF_ADDR -s $2 --dport $3 \\
               -j DNAT --to-destination $gamer
   $IPTABLES -t nat -I PREROUTING -p udp -d $EXT_IF_ADDR -s $2 --sport $3 \\
               -j DNAT --to-destination $gamer
}

open_planeshift_server \"Laanx\" \"203.81.47.27\" \"13331\"


I don\'t know if posting code in this forum is allowed. If not, please tell me!

And congratulations, this is a very promising game!

Pages: [1]