Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2002 12:43:08 -0500
From:      bob@sfcei.com
To:        freebsd-questions@FreeBSD.ORG
Subject:   natd not working
Message-ID:  <B9FB8C769C17D411892D00B0D02165320F1378@sf_pdc>

next in thread | raw e-mail | index | archive | help
I am trying to get natd to port redirect an external requests to port 80
to an intenal machine(192.168.70.15) also port 80. However it is not
working. Can somebody help me as to why this is not working?

I am running natd from 
/sbin/natd -f /etc/natd.conf:

# natd config
interface fxp0
redirect_port tcp 192.168.70.15:80 80
redirect_port tcp 192.168.70.12:1723 1723
log             yes
use_sockets     yes
same_ports      yes

The port redirection is not working. If I ssh into the system and then
use lynx to view the 192.168.70.15 machine, it works. When I try using a
web browser to the external IP, it does not forward/redirect. 

Some of my ipfw rules are as follows:

# Outside interface network and netmask and ip
oif="fxp0"
onet="216.227.86.0"
omask="255.255.255.252"
oip="216.227.86.197"

# Inside interface network and netmask and ip
iif="sis0"
inet="192.168.70.0"
imask="255.255.255.0"
iip="192.168.70.13"

# Network Address Translation.
${fwcmd} add divert natd all from any to any via ${oif}
${fwcmd} add pass tcp from any 1723 to any setup

# HTTP - Allow access to the web server
${fwcmd} add pass tcp from any to any 80 setup

Interestingly, my sendmail works, although this is on the FBSD machine.
The 192.168.70.15 machine is a Sun box running Solaris and Apache.

My /etc/rc.conf includes:

sendmail_enable="YES"
sendmail_flags="-bd -q15m"
sshd_enable="YES"
ifconfig_fxp0="DHCP"
ifconfig_sis0="inet 192.168.70.13"
gateway_enable="YES"
defaultrouter="216.227.86.197"
firewall_enable="YES"
firewall_type="simple"
firewall_script="/etc/rc.ipfw"
natd_enable="YES"
natd_interface="fxp0"
natd_flags="-f /etc/natd.conf"
natd_flags="-redirect_port tcp 192.168.70.15:80 80"
portmap_enable="YES"
enable_rfc1323="YES"
tcp_extensions="YES"

Please reply to this address, as I cannot join the list at my office
email. Thanks. bob@sfcei.com

Thanks
Bob

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B9FB8C769C17D411892D00B0D02165320F1378>