1
Technical Help: Problems BEFORE entering the game / Linkdead & NAT: problem and a solution
« on: June 24, 2003, 05:22:08 pm »
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:
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!
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!