Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2001 15:39:59 +1000
From:      Peter MacGee <peter@ideal.net.au>
To:        Adam LaBarge <phinger@best.com>
Cc:        freebsd-newbies@FreeBSD.ORG
Subject:   Re: port forwarding with natd
Message-ID:  <5.1.0.14.2.20010815153024.0224fcc0@mail.ideal.net.au>
In-Reply-To: <Pine.BSF.4.21.0108142206460.1190-100000@shell18.ba.best.co m>

next in thread | previous in thread | raw e-mail | index | archive | help
--=====================_513315078==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi Adam,

At 10:14 PM 14/08/2001 -0700, you wrote:
>Hi, I am trying to forward port 25 from a FreeBSD router, running natd
>with an open firewall to an internal machine running FreeBSD set up as a
>sendmail server.  So, I have tried two ways to forward this port, but can
>not get it to work.  Way 1)  in /etc/natd.conf I added the line
>permanent_link tcp internalmachineaddress:25 0:0 25
>way 2) was from the command line, and that just hung, this is what I could
>figure best.
>natd -redirect_port internalmachne:25 myIP:25 25
>That would hang, not even a sintax error.  I know that natd runs great, i
>have been using this router for about 8 month now, works great.  The only
>open connection port to the router is 22.  all other tcp is passed to the
>machines inside.  I know that sendmail is working ok on the internal
>sendmail server, i telnet to port 25 and it give me the sendmail info.  I
>just used the defualt sendmail set up.  I also know that the domain
>information is set up coorectly.  So, i figure it is just the forwarding
>of the port that is messing things up.  If anyones has done this, or knows
>any way to get it working.  please help, it is driving me mad.  thanks

I use a program called netcat (/usr/ports/net/netcat). It does exactly what 
you want to do if you want to use it as a temporary fix until you find the 
correct way to do things using natd.

Netcat is very simple to get going as well... Install and then add/alter 
the relevant line in your inetd.conf file  eg.

smtp    stream  tcp     nowait  nobody  /usr/sbin/nc            nc 
xxx.xxx.xxx.xxx 25

where xxx.xxx.xxx.xxx is your internal machine. After this has been done, 
give (as root):
killall -HUP inetd
and everything should be happening happily.

I use this particular set up for "forwarding" port 80 requests made to my 
FreeBSD "router" to a machine on my internal network.

Hope this helps,

Pete.

>-adam
>
>
>Software is just frozen thought.  Nothing more, nothing less.
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-newbies" in the body of the message

--
Computers are just like air conditioners; They don't work properly if you 
open Windows.
--=====================_513315078==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
Hi Adam,<br><br>
At 10:14 PM 14/08/2001 -0700, you wrote:<br>
<blockquote type=cite class=cite cite>Hi, I am trying to forward port 25
from a FreeBSD router, running natd<br>
with an open firewall to an internal machine running FreeBSD set up as
a<br>
sendmail server.&nbsp; So, I have tried two ways to forward this port,
but can<br>
not get it to work.&nbsp; Way 1)&nbsp; in /etc/natd.conf I added the line
<br>
permanent_link tcp internalmachineaddress:25 0:0 25<br>
way 2) was from the command line, and that just hung, this is what I
could<br>
figure best.<br>
natd -redirect_port internalmachne:25 myIP:25 25<br>
That would hang, not even a sintax error.&nbsp; I know that natd runs
great, i<br>
have been using this router for about 8 month now, works great.&nbsp; The
only<br>
open connection port to the router is 22.&nbsp; all other tcp is passed
to the<br>
machines inside.&nbsp; I know that sendmail is working ok on the
internal<br>
sendmail server, i telnet to port 25 and it give me the sendmail
info.&nbsp; I<br>
just used the defualt sendmail set up.&nbsp; I also know that the
domain<br>
information is set up coorectly.&nbsp; So, i figure it is just the
forwarding<br>
of the port that is messing things up.&nbsp; If anyones has done this, or
knows<br>
any way to get it working.&nbsp; please help, it is driving me mad.&nbsp;
thanks<br>
</blockquote><font size=4><br>
I use a program called netcat (/usr/ports/net/netcat). It does exactly
what you want to do if you want to use it as a temporary fix until you
find the correct way to do things using natd.<br><br>
Netcat is very simple to get going as well... Install and then add/alter
the relevant line in your inetd.conf file&nbsp; eg.<br><br>
smtp&nbsp;&nbsp;&nbsp; stream&nbsp; tcp&nbsp;&nbsp;&nbsp;&nbsp;
nowait&nbsp; nobody&nbsp;
/usr/sbin/nc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
nc xxx.xxx.xxx.xxx 25<br><br>
where xxx.xxx.xxx.xxx is your internal machine. After this has been done,
give (as root):<br>
killall -HUP inetd<br>
and everything should be happening happily.<br><br>
I use this particular set up for &quot;forwarding&quot; port 80 requests
made to my FreeBSD &quot;router&quot; to a machine on my internal
network.<br><br>
Hope this helps,<br><br>
Pete.<br><br>
</font><blockquote type=cite class=cite cite>-adam<br><br>
<br>
Software is just frozen thought.&nbsp; Nothing more, nothing
less.<br><br>
<br>
To Unsubscribe: send mail to majordomo@FreeBSD.org<br>
with &quot;unsubscribe freebsd-newbies&quot; in the body of the
message</blockquote>
<x-sigsep><p></x-sigsep>
--<br>
Computers are just like air conditioners; They don't work properly if you
open Windows.</html>

--=====================_513315078==_.ALT--


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




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