Hi Group.

I am having problems getting port forwarding to a Windows machine from
a FreeBSD gateway. The aim of the exercise is to be able to allow users
on my network to rdesktop or use Terminal Services to connect to our
clients SQL server. Our client is running FreeBSD 4.9 stable.

Currently their firewall looks like this :-
-bash-2.05b# ipfw show
00010 545965 700793273 allow tcp from to any 25
00011 0 0 allow tcp from any to
00012 0 0 allow tcp from to any 25
00013 504763 622733408 allow tcp from any to 25
00014 15 720 deny tcp from any to any 25 out xmit rl0
00015 405 19496 deny tcp from any to any 25 in recv rl0
00030 10913 484744 deny tcp from any to any 1214
00050 5164541 1613272038 divert 8668 ip from any to any via ip>
00100 4044722 517888092 allow ip from any to any via lo0
00200 1848 143672 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
65000 17107751 5434529724 allow ip from any to any
65535 0 0 deny ip from any to any

They are starting natd from rc.conf with lines like this :-
natd_program="/sbin/natd" # path to natd, if you want a different
one.
natd_enable="YES" # Enable natd (if firewall_enable ==
YES).
natd_interface="" # Public interface or IPaddress
to use.
natd_flags="-u -s -redirect_port tcp :80 ip>:81"


Trying to allow my users access I created a natd.conf with the
following lines :-
#use the external interface
interface rl0

#use sockets
use_sockets yes
unregistered_only yes
#log yes

#existing stuff
redirect_port tcp :80 :81

#allow access for Linc
redirect_port tcp :3389 :3389

Then added the following to ipfw :-
ipfw add 00007 divert natd tcp from 3389 to ip>
ipfw add 00008 divert natd tcp from to
3389

Once I have restarted natd with a :-
kill `cat /var/run/natd.pid` && /sbin/natd -f /etc/natd.conf

I am disconnected from the remote terminal (i guess from because of the
divert) but the connection to the sql server box does not work.

Any ideas ?
TIA.
Ryan.