Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 2000 21:39:59 -0400
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        Jason Miller <jmille34@tampabay.rr.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: natd won't redirect a port
Message-ID:  <20000409213959.D25406@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <38F12B81.72EAB1D0@tampabay.rr.com>; from jmille34@tampabay.rr.com on Sun, Apr 09, 2000 at 09:16:49PM -0400
References:  <38F12B81.72EAB1D0@tampabay.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Apr 09, 2000 at 09:16:49PM -0400, Jason Miller wrote:
> I'm having a hard time getting natd to redirect_port. I've got freebsd
> hooked to the internet via ed0 (cable, 24.92.x.x) and to my lan via ed1
> (10.1.1.1). Natd is running mostly okay.. Inside computers have complete
> access to the internet. I don't want to disturb any of freebsd's ports,
> but I want to direct a random incoming port (8902) to point to
> 10.1.1.10:80 (the webcam server on my windows machine). I've tried
> everything I can think of.
> 
> in rc.conf I have:
> natd_enable="yes"
> natd_progra="/sbin/natd"
> natd_interface="ed0"
> natd_flags="-f /usr/local/etc/natd.conf" (what I wrote)
> 
> in /usr/local/etc/natd.conf I have:
> dynamic yes
> same_ports yes
> use_sockets yes
> unregistered_only yes
> redirect_port tcp bunk:80 8902
> interface ed0

You do not need the last line. The 'natd_interface' line in rc.conf
takes care of that for you.

> It's the last two lines I've been changing. The two shown are just the
> latest ones I've tried. "bunk" is the hostname of the machine running
> the server on port 80. I've also tried referencing by IP address. The
> interface I've tried as ed0 and ed1 and not at all.

The natd_interface should be ed0 from your description. It needs to be
the external, public interface.

> I'm not sure what else to check. From reading the man pages for natd, it
> seems to me like I've got it right, but apparently I've got something
> wrong. Can anyone help? This seems basic enough, but I'm getting really
> frustrated after several days of failure. I can do lynx 10.1.1.10 from
> bsd, and it connects, but when i try lynx 24.92.x.x:8902, it fails.
> Could my test method be the problem? I don't have a readily available
> outside connection to try from.

Yes. It is your problem if I am to understand that 'bsd' is the box
doing NAT for you. If you are on the NAT machine and do,

  % lynx 24.92.215.96:8902

It will not get redirected. The packet is not entering from ed0 so
it never gets diverted to natd.

It probably does work from the outside. You could check if you had
access to a machine out there... Which leads to the inevitable
question, if you or know one else is outside to check this, why are
you trying to do it?
-- 
Crist J. Clark                           cjclark@home.com


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?20000409213959.D25406>