STLLUG - St. Louis Linux User Group
11/16/1995 : Sample Network Configuration Files
Presenter: Matthew Feldt

Sample Network Configuration Files

These configuration files are well documented in the Linux NET-2/NET-3 HOWTO.
I strongly recommend reading the HOWTO, it is excellent.


host.conf

order hosts bind
multi on

hosts

#
# hosts		This file describes a number of hostname-to-address
#		mappings for the TCP/IP subsystem.  It is mostly
#		used at boot time, when no name servers are running.
#		On small systems, this file can be used instead of a
#		"named" name server.  Just add the names, addresses
#		and any aliases to this file...
#

127.0.0.1	localhost
128.252.130.10	michelob.wustl.edu              michelob
128.252.130.12  dark.wustl.edu                  dark

inetd.conf

#
# kill -HUP <pid of inetd> - reread the inetd.conf file
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
echo	stream	tcp	nowait	root	internal
echo	dgram	udp	wait	root	internal
discard	stream	tcp	nowait	root	internal
discard	dgram	udp	wait	root	internal
daytime	stream	tcp	nowait	root	internal
daytime	dgram	udp	wait	root	internal
chargen	stream	tcp	nowait	root	internal
chargen	dgram	udp	wait	root	internal
time  	dgram 	udp 	wait 	root 	internal

#
# Standard services.
#
ftp	stream	tcp	nowait	root	/usr/sbin/tcpd	/usr/sbin/in.ftpd
telnet	stream  tcp     nowait  root    /usr/sbin/tcpd	/usr/sbin/in.telnetd

#
# BSD protocols.
#
shell	stream	tcp	nowait	root	/usr/sbin/tcpd	/usr/sbin/in.rshd
login	stream	tcp	nowait	root	/usr/sbin/tcpd	/usr/sbin/in.rlogind

printcap

# /etc/printcap
#
# Matthew Feldt
# 31 October 1995

# lf = error logging file
# lp = output device
# lo = lock file
# sd = spool directory
# sh = suppress printing of burst page header
hp:\
        :lf=/var/spool/lpd/hp/errs: \
        :lo=/var/lock/hp.lock \
        :lp=/dev/lp2: \
        :sd=/var/spool/lpd/hp: \
        :sh:

protocols

#
# protocols	This file describes the various protocols that are
#		available from the TCP/IP subsystem.  It should be
#		consulted instead of using the numbers in the ARPA
#		include files, or, worse, just guessing them.
#

ip	0	IP	# internet protocol, pseudo protocol number
icmp	1	ICMP	# internet control message protocol
igmp	2	IGMP	# internet group multicast protocol
ggp	3	GGP	# gateway-gateway protocol
tcp	6	TCP	# transmission control protocol
pup	12	PUP	# PARC universal packet protocol
udp	17	UDP	# user datagram protocol
idp	22	IDP	# WhatsThis?
raw	255	RAW	# RAW IP interface

rc.inet1

#! /bin/sh
#
# Matthew Feldt	
# 12 November 1995

IFCONFIG="/sbin/ifconfig"
ROUTE="/sbin/route"
IPADDR="192.0.2.2"
NETMASK="255.255.255.0"
NETWORK="192.0.2.0"
BROADCAST="192.0.2.255"
GATEWAY="192.0.2.2"

# Configure network interfaces
if [ -x ${IFCONFIG} ]; then
  ${IFCONFIG} lo 127.0.0.1
  ${IFCONFIG} eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
fi

if [ -x ${ROUTE} ]; then
  ${ROUTE} add -net 127.0.0.0
  ${ROUTE} add -net ${NETWORK} netmask ${NETMASK}
  ${ROUTE} add default gw ${GATEWAY}
fi

rc.inet2

#! /bin/sh
#
# Matthew Feldt
# 12 November 1995

SBIN="/sbin"
USBIN="/usr/sbin"
ECHO="/bin/echo"
IN_SERV="lpd"

${ECHO} -n "Starting daemons:"
if [ -x ${SBIN}/syslogd ]; then
  ${ECHO} -n " syslogd"
  ${SBIN}/syslogd
fi

if [ -x ${SBIN}/klogd ]; then
  ${ECHO} -n " klogd"
  ${SBIN}/klogd
fi

# Start the inetd 'super server'
if [ -x ${USBIN}/inetd ]; then
  ${ECHO} -n " inetd"
  ${USBIN}/inetd
fi

# Start the various inet servers
for SERVER in ${IN_SERV}
do
  if [ -f ${USBIN}/${SERVER} ]; then
    ${ECHO} -n " ${SERVER}"
    ${USBIN}/${SERVER}
  fi
done

# Guarantee a new line
${ECHO}

resolv.conf

domain local-linux.net
nameserver 134.124.40.5

services

#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
# Updated from RFC 1340, ``Assigned Numbers'' (July 1992).  Not all ports
# are included, only the more common ones.
#
#	from: @(#)services	5.8 (Berkeley) 5/9/91
#	$Id: services,v 1.9 1993/11/08 19:49:15 cgd Exp $
#
tcpmux		1/tcp		# TCP port service multiplexer
echo		7/tcp
echo		7/udp
discard		9/tcp		sink null
discard		9/udp		sink null
systat		11/tcp		users
daytime		13/tcp
daytime		13/udp
netstat		15/tcp
qotd		17/tcp		quote
msp		18/tcp		# message send protocol
msp		18/udp		# message send protocol
chargen		19/tcp		ttytst source
chargen		19/udp		ttytst source
ftp		21/tcp
# 22 - unassigned
telnet		23/tcp
# 24 - private
smtp		25/tcp		mail
# 26 - unassigned
time		37/tcp		timserver
time		37/udp		timserver
rlp		39/udp		resource	# resource location
nameserver	42/tcp		name		# IEN 116
whois		43/tcp		nicname
domain		53/tcp		nameserver	# name-domain server
domain		53/udp		nameserver
mtp		57/tcp				# deprecated
bootps		67/tcp		# BOOTP server
bootps		67/udp
bootpc		68/tcp		# BOOTP client
bootpc		68/udp
tftp		69/udp
gopher		70/tcp		# Internet Gopher
gopher		70/udp
rje		77/tcp		netrjs
finger		79/tcp
www		80/tcp		http	# WorldWideWeb HTTP
www		80/udp			# HyperText Transfer Protocol
link		87/tcp		ttylink
kerberos	88/tcp		krb5	# Kerberos v5
kerberos	88/udp
supdup		95/tcp
# 100 - reserved
hostnames	101/tcp		hostname	# usually from sri-nic
iso-tsap	102/tcp		tsap		# part of ISODE.
csnet-ns	105/tcp		cso-ns	# also used by CSO name server
csnet-ns	105/udp		cso-ns
rtelnet		107/tcp		# Remote Telnet
rtelnet		107/udp
pop2		109/tcp		postoffice	# POP version 2
pop2		109/udp
pop3		110/tcp		# POP version 3
pop3		110/udp
sunrpc		111/tcp
sunrpc		111/udp
auth		113/tcp		tap ident authentication
sftp		115/tcp
uucp-path	117/tcp
nntp		119/tcp		readnews untp	# USENET News Transfer Protocol
ntp		123/tcp
ntp		123/udp				# Network Time Protocol
netbios-ns	137/tcp				# NETBIOS Name Service
netbios-ns	137/udp
netbios-dgm	138/tcp				# NETBIOS Datagram Service
netbios-dgm	138/udp
netbios-ssn	139/tcp				# NETBIOS session service
netbios-ssn	139/udp
imap2		143/tcp				# Interim Mail Access Proto v2
imap2		143/udp
snmp		161/udp				# Simple Net Mgmt Proto
snmp-trap	162/udp		snmptrap	# Traps for SNMP
cmip-man	163/tcp				# ISO mgmt over IP (CMOT)
cmip-man	163/udp
cmip-agent	164/tcp
cmip-agent	164/udp
xdmcp		177/tcp				# X Display Mgr. Control Proto
xdmcp		177/udp
nextstep	178/tcp		NeXTStep NextStep	# NeXTStep window
nextstep	178/udp		NeXTStep NextStep	# server
bgp		179/tcp				# Border Gateway Proto.
bgp		179/udp
prospero	191/tcp				# Cliff Neuman's Prospero
prospero	191/udp
irc		194/tcp				# Internet Relay Chat
irc		194/udp
smux		199/tcp				# SNMP Unix Multiplexer
smux		199/udp
at-rtmp		201/tcp				# AppleTalk routing
at-rtmp		201/udp
at-nbp		202/tcp				# AppleTalk name binding
at-nbp		202/udp
at-echo		204/tcp				# AppleTalk echo
at-echo		204/udp
at-zis		206/tcp				# AppleTalk zone information
at-zis		206/udp
z3950		210/tcp		wais		# NISO Z39.50 database
z3950		210/udp		wais
ipx		213/tcp				# IPX
ipx		213/udp
imap3		220/tcp				# Interactive Mail Access
imap3		220/udp				# Protocol v3
ulistserv	372/tcp				# UNIX Listserv
ulistserv	372/udp
#
# UNIX specific services
#
exec		512/tcp
biff		512/udp		comsat
login		513/tcp
who		513/udp		whod
shell		514/tcp		cmd		# no passwords used
syslog		514/udp
printer		515/tcp		spooler		# line printer spooler
talk		517/udp
ntalk		518/udp
route		520/udp		router routed	# RIP
timed		525/udp		timeserver
tempo		526/tcp		newdate
courier		530/tcp		rpc
conference	531/tcp		chat
netnews		532/tcp		readnews
netwall		533/udp				# -for emergency broadcasts
uucp		540/tcp		uucpd		# uucp daemon
remotefs	556/tcp		rfs_server rfs	# Brunhoff remote filesystem
klogin		543/tcp				# Kerberized `rlogin' (v5)
kshell		544/tcp				# Kerberized `rsh' (v5)
kerberos-adm	749/tcp				# Kerberos `kadmin' (v5)
#
webster		765/tcp				# Network dictionary
webster		765/udp
#
# From ``Assigned Numbers'':
#
#> The Registered Ports are not controlled by the IANA and on most systems
#> can be used by ordinary user processes or programs executed by ordinary
#> users.
#
#> Ports are used in the TCP [45,106] to name the ends of logical
#> connections which carry long term conversations.  For the purpose of
#> providing services to unknown callers, a service contact port is
#> defined.  This list specifies the port used by the server process as its
#> contact port.  While the IANA can not control uses of these ports it
#> does register or list uses of these ports as a convienence to the
#> community.
#
ingreslock	1524/tcp
ingreslock	1524/udp
prospero-np	1525/tcp		# Prospero non-privileged
prospero-np	1525/udp
rfe		5002/tcp		# Radio Free Ethernet
rfe		5002/udp		# Actually uses UDP only
#
#
# Kerberos (Project Athena/MIT) services
# Note that these are for Kerberos v4, and are unofficial.  Sites running
# v4 should uncomment these and comment out the v5 entries above.
#
#kerberos	750/udp		kdc	# Kerberos (server) udp
#kerberos	750/tcp		kdc	# Kerberos (server) tcp
krbupdate	760/tcp		kreg	# Kerberos registration
kpasswd		761/tcp		kpwd	# Kerberos "passwd"
#klogin		543/tcp			# Kerberos rlogin
eklogin		2105/tcp		# Kerberos encrypted rlogin
#kshell		544/tcp		krcmd	# Kerberos remote shell
#
# Unofficial but necessary (for NetBSD) services
#
supfilesrv	871/tcp			# SUP server
supfiledbg	1127/tcp		# SUP debugging

Last Modified: 11 December 1995
St. Louis Unix Users Group - Linux SIG