[NTLUG:Discuss] services

Christopher Browne cbbrowne at hex.net
Sat Dec 11 16:47:03 CST 1999


On Sat, 11 Dec 1999 16:14:59 CST, the world broke into rejoicing as
Rusty Haddock <rusty at fe2o3.lonestar.org>  said:
> Scott Walters wrote:
>     >
>     >
>     >How do I specify a range of ports in the /etc/services file.
> 
> You can't and really don't want to do that.

Indeed.

>     >I want all udp and tcp ports between 2300 and 2400 open.
> 
> They already are unless you've got some daemon/server program already
> using them.

It is reasonably likely that what is *really* wanted here is to do
some configuration of inetd, the portmapper, configured (commonly) in
/etc/inetd.conf, which is used to admit/deny connections to ports.
But I suspect that the purpose needs to be far better laid out in
order to provide good answers...

>     >will something like:
>     >
>     >test	2300-2400/udp
>     >test	2300-2400/tcp
>     >
>     >work?
> 
> Nope.
> 
> Basically, the file /etc/services simply provides a name to port number
> association, not really anything else.  Each port would have to be named
> differently else there would be confusion at to what port someone meant
> when they typed "telnet yourmachine test". 

Indeed.

A "for instance" is that if I type:

% telnet news.hex.net nntp

The /etc/services entry:
   nntp               119/tcp
is what allows the system call getservbyname() to translate "nntp" to
"119" and thereby do exactly the same thing as if I had used the
command:
% telnet news.hex.net 119

> Also, /etc/services does not determine which services are actually
> provided, simply the numbers of the "well-known" services and maybe
> services local to that machine.  Daemons not necessarily included and can
> be available separately, either by themselves or with inetd.  :-)

Indeed.  It is quite possible that the local host may not supply a
given service; I have some entries for "sapdp00" thru "sapdp09"
on my system at home that allow me to get at R/3 servers at ports
3200-3209 at the office.
--
Smith's Test for Artificial Life:
When animal-rights activists and right-to-life protesters are marching
outside your laboratory, then you know you've definitely made progress
in your artificial life research.  -- Donald A. Smith
cbbrowne at hex.net - <http://www.ntlug.org/~cbbrowne/lsf.html>




More information about the Discuss mailing list