Subject: Re: Mapping ports ?
To: Rakhesh Sasidharan <rakhesh@cse.iitd.ernet.in>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-users
Date: 03/11/2001 00:05:28
On Sat, Mar 10, 2001 at 11:44:02PM +0530, Rakhesh Sasidharan wrote:
> 
> Hi,
> 
> I have a NetBSD-1.5/i386 which has "ftpd" running as a standalone daemon
> on port 21, and also "wu-ftpd" running out of inetd on port 821. I'm not
> connected to the net, and so I have configured lo0 (loopback) as
> 10.20.3.5, and lo1 as 10.20.3.6.  The machine itself has the IP of
> 10.20.3.5.
> 
> As of now, ftp-ing to 10.20.3.6 or 10.20.3.5 invokes the ftpd of port 21.
> What I am trying to do is that when I type "ftp 10.20.3.6", it
> automatically connects to port 821 (wu-ftpd) instead of port 21.  I could
> do this explicitly with "ftp ftp://10.20.3.6:821", but is it possible to
> do it automatically ?  Is that possible ? Do things like NAT etc do
> something along these lines ?

You can do it another way; just bind ftpd to 10.20.3.5 port21, and
wu-ftp to 10.20.3.6 port 21.

in /etc/inetd.conf something liek this should do it:
10.20.3.6:ftp stream  tcp     nowait  root    /path/to/wu-ftpd     wu-ftpd

For the "standalone ftpd", it seems you're not using the stock NetBSD ftpd
(as this one has to be started from inetd) so I can't tell you how to bind it
to 10.20.3.5.

> 
> Regards.
> Rakhesh
> 
> PS: Quite often I have seen notations like this: 10.0.0.0/24 or
> 209.1.2.3/32 etc.  What do they mean (the / part) ?

It's the netmask. /24 means 24 bits (i.e. 255.255.255.0). 

--
Manuel Bouyer <bouyer@antioche.eu.org>
--