View Single Post
  #1   (View Single Post)  
Old 20th May 2009
map7 map7 is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 75
Default natd redirect_port problems

I have a gateway which is running FreeBSD 5.1 and I would like to redirect an incoming/outgoing port to a computer on the lan.

I've been dong some reading and it looks like I need natd.

I've compiled my divert options into the kernel and get the following line in my dmesg on boot:
ipfw2 initialized, divert enabled, rule-based forwarding enabled, default to deny, logging limited to 100 packets/entry by default

My internet connection uses the tun0 device and my network is on interface rl0.

The natd command I've been trying is
# natd -interface tun0 -redirect_port tcp 192.168.1.2:80 80

192.168.1.2 is my webserver which runs apache and I can access this internally.

I cannot access it from the outside world, even after I disable any firewall settings.

I've tried with the commands
# sh /etc/rc.firewall simple
# ipfw add divert natd all from any to any via tun0
# natd -interface tun0 -redirect_port tcp 192.168.1.2:80 80

and that doesn't work either. Should I be putting that ipfw in my firewall or will it do the same thing manually? Is this the correct natd call? Do I have to setup a natd.conf file as I don't have one at the moment?
Reply With Quote