Hi !
I'm behind a proxy (squid) and a firewall (iptables) but it's impossible to me launch a wan server sucessfully,otherwise i can play on lan with the server (srcds) .
These are my iptables rules:
$IPTABLES -A PREROUTING -t nat -p udp -i $INET_IFACE --dport $HL2_PORT -j DNAT --to $HL2_SERVER:$HL2_PORT
$IPTABLES -A FORWARD -i $INET_IFACE --out-interface $LAN_IFACE -d $HL2_SERVER -p udp --dport $HL2_PORT -j tcp_allowed
$IPTABLES -A PREROUTING -t nat -p udp -i $INET_IFACE --dport 27020 -j DNAT --to $HL2_SERVER:27020
$IPTABLES -A FORWARD -i $INET_IFACE --out-interface $LAN_IFACE -d $HL2_SERVER -p udp --dport 27020 -j tcp_allowed
$IPTABLES -A PREROUTING -t nat -p tcp -i $INET_IFACE --dport $HL2_PORT -j DNAT --to $HL2_SERVER:$HL2_PORT
$IPTABLES -A FORWARD -i $INET_IFACE --out-interface $LAN_IFACE -d $HL2_SERVER -p tcp --dport $HL2_PORT -j tcp_allowed
Where HL2_SERVER is the internal ip 192.168.x.x and HL2_PORT is 27015,the default port.
I launch the server with the next params:
./srcds_run -console -game cstrike +ip 192.68.x.x -p 27015 +map de_aztec +maxplayers 16 -debug
It seems the problem comes from proxy,but not sure xD
The operative system is Debian sarge
Thx very much
---- Update 12/12/04 -----
I've resolved the problem
The complete iptables rules are:
HL2_SERVER="192.68.x.x"
HL2_PORT="27015"
GAMESPORTS="27000:27030"
INET_IFACE="EXTERNAL IP"
LAN_IFACE="INTERNAL IP"
$IPTABLES -A INPUT -i $INET_IFACE -p tcp -d $HL2_SERVER --dport $HL2_PORT -s $ANYWHERE --sport $GAMESPORTS -j ACCEPT
$IPTABLES -A INPUT -i $INET_IFACE -p tcp -d $HL2_SERVER --dport $HL2_PORT -s $ANYWHERE --sport $GAMESPORTS -j ACCEPT
$IPTABLES -A FORWARD -i $INET_IFACE -p udp -d $LAN_IP_RANGE --dport $HL2_PORT -s $ANYWHERE --sport $GAMESPORTS -j ACCEPT
$IPTABLES -A PREROUTING -t nat -p udp -i $INET_IFACE --dport $HL2_PORT -j DNAT --to $HL2_SERVER:$HL2_PORT
$IPTABLES -A FORWARD -i $INET_IFACE -o $LAN_IFACE -d $HL2_SERVER -p udp --dport $HL2_PORT -j tcp_allowed
I hope this help someone too
See u
I'm behind a proxy (squid) and a firewall (iptables) but it's impossible to me launch a wan server sucessfully,otherwise i can play on lan with the server (srcds) .
These are my iptables rules:
$IPTABLES -A PREROUTING -t nat -p udp -i $INET_IFACE --dport $HL2_PORT -j DNAT --to $HL2_SERVER:$HL2_PORT
$IPTABLES -A FORWARD -i $INET_IFACE --out-interface $LAN_IFACE -d $HL2_SERVER -p udp --dport $HL2_PORT -j tcp_allowed
$IPTABLES -A PREROUTING -t nat -p udp -i $INET_IFACE --dport 27020 -j DNAT --to $HL2_SERVER:27020
$IPTABLES -A FORWARD -i $INET_IFACE --out-interface $LAN_IFACE -d $HL2_SERVER -p udp --dport 27020 -j tcp_allowed
$IPTABLES -A PREROUTING -t nat -p tcp -i $INET_IFACE --dport $HL2_PORT -j DNAT --to $HL2_SERVER:$HL2_PORT
$IPTABLES -A FORWARD -i $INET_IFACE --out-interface $LAN_IFACE -d $HL2_SERVER -p tcp --dport $HL2_PORT -j tcp_allowed
Where HL2_SERVER is the internal ip 192.168.x.x and HL2_PORT is 27015,the default port.
I launch the server with the next params:
./srcds_run -console -game cstrike +ip 192.68.x.x -p 27015 +map de_aztec +maxplayers 16 -debug
It seems the problem comes from proxy,but not sure xD
The operative system is Debian sarge
Thx very much
---- Update 12/12/04 -----
I've resolved the problem
The complete iptables rules are:
HL2_SERVER="192.68.x.x"
HL2_PORT="27015"
GAMESPORTS="27000:27030"
INET_IFACE="EXTERNAL IP"
LAN_IFACE="INTERNAL IP"
$IPTABLES -A INPUT -i $INET_IFACE -p tcp -d $HL2_SERVER --dport $HL2_PORT -s $ANYWHERE --sport $GAMESPORTS -j ACCEPT
$IPTABLES -A INPUT -i $INET_IFACE -p tcp -d $HL2_SERVER --dport $HL2_PORT -s $ANYWHERE --sport $GAMESPORTS -j ACCEPT
$IPTABLES -A FORWARD -i $INET_IFACE -p udp -d $LAN_IP_RANGE --dport $HL2_PORT -s $ANYWHERE --sport $GAMESPORTS -j ACCEPT
$IPTABLES -A PREROUTING -t nat -p udp -i $INET_IFACE --dport $HL2_PORT -j DNAT --to $HL2_SERVER:$HL2_PORT
$IPTABLES -A FORWARD -i $INET_IFACE -o $LAN_IFACE -d $HL2_SERVER -p udp --dport $HL2_PORT -j tcp_allowed
I hope this help someone too
See u