Subject: Redirecting a connection to an internal machine
To: None <tech-net@netbsd.org>
From: Thomas M Clarke <bsd@tmcgames.com>
List: tech-net
Date: 05/11/2003 23:04:06
Hello,

I'm trying to redirect the connection of HLSW Halflife server query tool
http://www.hlsw.de/ Specifically the function that registers an ip address
with the halflife server to initiate sending of data to the registered ip
address (Receiving the server logs in real time). I'm running IP Filter and
IP NAT on NetBSD. I couldnt find much documentation on doing this elsewhere
so I'm assuming the protocol is UDP, the FAQ on the HLSW site does mention
ports 7130-7139 being used.

The gateway box is connected to the internet via a dynamicly assigned ip
address ADSL connection. Its internal ip address is 10.0.0.1, the computer
thats running HLSW is on 10.0.0.9.

This is what I've got in my ipf.conf:

block in on tun0 all
pass in on rtk0 proto tcp from any to any keep state
pass in on rtk0 proto udp from any to any keep state
pass in on rtk0 proto icmp from any to any keep state
pass out on tun0 proto tcp from any to any keep state
pass out on tun0 proto udp from any to any keep state
pass out on tun0 proto icmp from any to any keep state
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7130
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7131
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7132
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7133
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7134
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7135
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7136
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7137
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7138
pass in quick on tun0 proto udp from 195.22.129.41/32 to 10.0.0.9/32 port =
7139

And this is my ipnat.conf:

map tun0 10.0.0.0/24 -> 0/32 proxy port ftp ftp/tcp
map tun0 10.0.0.0/24 -> 0/32 portmap tcp/udp 40000:60000
map tun0 10.0.0.0/24 -> 0/32
rdr tun0 0/32 port 7130 -> 10.0.0.9 port 7130 udp
rdr tun0 0/32 port 7131 -> 10.0.0.9 port 7131 udp
rdr tun0 0/32 port 7132 -> 10.0.0.9 port 7132 udp
rdr tun0 0/32 port 7133 -> 10.0.0.9 port 7133 udp
rdr tun0 0/32 port 7134 -> 10.0.0.9 port 7134 udp
rdr tun0 0/32 port 7135 -> 10.0.0.9 port 7135 udp
rdr tun0 0/32 port 7136 -> 10.0.0.9 port 7136 udp
rdr tun0 0/32 port 7137 -> 10.0.0.9 port 7137 udp
rdr tun0 0/32 port 7138 -> 10.0.0.9 port 7138 udp
rdr tun0 0/32 port 7139 -> 10.0.0.9 port 7139 udp

With the above HLSW times-out and fails to receive the log from the server.

Has anyone else redirected HLSW or similar?

Thanks

TMC
http://www.tmcgames.com/