Introduction to Linux Networking:
---------------------------------

In my opinion, almost anyone with more than one PC in a household could 
benefit from a home local area network.  Using inexpensive LAN cards, people 
can connect two PC's together on a network for less that $40-$50, and connect
4 to 5 PC's together for less than $150.


Required for a 10baseT network.
  1)  Inexpensive network cards for each PC.  $20-$30 each new, less used.
  2)  A HUB.  I paid about $40 for a 5 port hub. *
  3)  10BT cables from HUB to each PC.  Less than $5 each.
      * A cross-over cable can connect 2 PC's together without a hub.


Required for a 10base2 network.
  1)  Inexpensive network cards for each PC.  $20-$30 each new, less used.
  2)  Coax cable between each PC.
  3)  "T" connections for each PC.
  4)  Two terminators.  One at the each end of the cable.


This allows you to:

	Share printer(s) to all PC's.
	Copy files between PC's QUICKLY without messing with diskettes.
		Copy important files to another PC for safe keeping.
	Share files and programs.
		Install programs on one PC, and run it from all PC's.
		Share data without keeping multiple copies synchronized..
	Share tape drives.
		Backup all PC's to a single tape drive.
	Share your Internet connection between all PC's.
		Allow all your PC's to access the Internet at the same time
		with one phone line and one modem using Linux and 
		IP masquerading.  (covered at a previous presentation)
	Set up your own firewall to protect your network using Linux.
	And many other possibilities.


Disclaimer:  Some of the following configuration files have fancy GUI
		programs to modify them.  Since these GUI programs tend
		to differ between different Linux distributions, I only
		mention the filename and format of the file because they
		can all be modified using a text editor.  See the instructions
		for your particular Linux distribution to see if a GUI exists.


Telnet.  Connect to another computer over a network, usually as a terminal.

  Default is connect to port 23 (telnetd) to get a login: prompt.
  Can specify the port number and connect to any service (sendmail, httpd, etc.)

  Example:
	telnet fred	# telnet to computer named:  "fred"  on port 23 (login).
	telnet fred 25	# forge an email and send it from "fred".


"R" commands:  rlogin/rsh/rcp.

  rlogin = Remote Login.  Similar to telnet, except:
		Defaults to your userid on remote machine.
		Cannot specify port.  (can only be used to remote login)
		Can allow trusted hosts to connect without a password.

  rcp = Remote Copy.  Copy files to and from a remote computer over a network.

  rsh = Remote Shell.  Run command on remote computer without logging in.
	A.K.A. "remsh" on some Unix systems (i.e. HP-UX).

  File:  /etc/hosts.equiv (global)  or  $HOME/.rhosts (for individual users)
	 Lists hosts that are allowed to connect without specifying a password.

  Examples:
	rlogin fred		# Remote login to computer named "fred".
	rcp file1 fred:/tmp	# Copy "file1" to "fred" in /tmp directory.
	rcp file2 fred:		# Copy "file2" to your home dir on "fred".
	rcp fred:/tmp/file1 .	# Example #2 in opposite direction.
	rcp fred:file2 .	# Example #3 in opposite direction.
	rsh fred ls /tmp	# run "ls /tmp" on "fred".


NFS - Network File System

  Client program:  "mount".  Allows mounting other server's NFS directories.
  Server programs:  "nfsd" and "mountd".  Shares directories to other clients.

  (client) To mount a remote directory on server named "fred":
    mount fred:/opt/abc /opt/abc -t nfs -o rsize=8192,wsize=8192
    "rsize" & "wsize" is recommended for performance.
    See exports(5) for all available options.

  (server) Make sure NFS server software is loaded and running.
    Create file:  /etc/exports to list directories to be shared.
    Send a SIGHUP to nfsd and mountd to reread /etc/export changes.
      KILL -SIGHUP 265 279 # Use the correct process numbers!
    # sample /etc/exports file.  (starts in column one)  
       /               master(rw) trusty(rw,no_root_squash)
       /projects       proj*.local.domain(rw)
       /usr            *.local.domain(ro) @trusted(rw)
       /home/joe       pc001(rw,all_squash,anonuid=150,anongid=100)
       /pub            (ro,insecure,all_squash)
       /pub/private    (noaccess)

  NFS mounts can be kept in the /etc/fstab file to allow mounting upon boot,
    and setting different default options for directories.
  Example line:  (starts in column one)
	fred:/opt/app   /opt/app   nfs  rsize=8192,wsize=8192,ro  0 0


Connecting to Micro$oft (Windoze) computers.

  Client program:  "smbmount" can mount shared directories from a windows PC
			similar to mounting a NFS directory.

	smbmount //fred/windows/abc /mnt/abc
	  mount the /windows/abc directory on /mnt/abc from the PC named "fred"
	smbumount /mnt/abc # to un-mount it.
	umount /mnt/abc # also works, if you have permissions to run umount.

	You can specify the directory password as an option on smbmount, 
	otherwise you will be prompted.  See the manpage for smbmount.

  Server program:  "samba"

    Samba is a very powerful program, that could be a presentation by itself.
    Samba has a very robust configuration file required for it's operation.
    Named "Samba" because it uses the "SMB" network protocol.

	Briefly, Samba allows a Unix computer to:
		Share directory's to windows PC's so they can 
			"connect network drive" to your Linux box just as 
			another windows PC with a shared drive.
		Shared printers to window's PC's.
	Samba also more advanced options, such as becoming a WINS server,
		or a NT domain server on a network, thus becoming a no-cost
		replacement for Windows NT.


FTP server.

  Install it, and it works.  Nothing else is required.  (at least on Redhat)


Anonymous FTP server.

  Install it, and it works.  Nothing else is required.  (at least on Redhat)

  It creates a user named:  "ftp", and the anonymous directory structure
    starts at that point.  The system does a "chroot" to the ftp home
    directory for anonymous users who log on.  That way anon ftp users
    see, what they think is the root directory, as the ftp user home dir
    and keeps anon ftp users out of the rest of the system.  It also 
    creates a minimal system directory structure at that point, required
    by the "chroot" environment.  (/etc, /bin, /lib)


Apache Web server.

  Install it, and it works.  Nothing else is required.  (at least on Redhat)

  It also creates a directory structure (but not a userid), and the web page 
    root starts at that point.  It creates a small, simple web page that
    shows the web server works.

  The configuration file can be customized to include many other features,
    and this could be a entire presentation all by itself at a future date.


NIS - Network Information Services.  Formally "yellow pages".

  This also could be a whole presentation by itself, and not as much use for
    a home network as a business (larger) network, so I'll keep it brief.

  NIS allows sharing of certain Unix system files across Unix systems,
    to allow keeping only one master copy of the file.

  Most common use is to share /etc/passwd and /etc/group, to keep a master
    database of user/password/groups instead of possibly having different
    passwords and/or userid's on different Unix servers.

  Other files can be shared, such as /etc/hosts, services, protocols, netgroups.
  It also allows for custom files to be added and shared.

  There is one master NIS server, per NIS domain.
	(not the same as Internet domain name)
  Clients connect and use the database on the NIS server.
  Backup NIS server(s) are optional, and can be used in the case the 
    Master NIS server is down for some reason.

  Some files (i.e. passwd and group) require modification on the client to work.
    This also allows for locally kept users, and users from the NIS passwd file.

  There are some custom NIS commands to access and use the NIS files.
    i.e.  "ypcat passwd"  will display the NIS password file.


Sendmail.

  The Sendmail program will allow you to become your a mail server.
    This may not be practical with a small home network, but possible.

  It also allows you to send internet mail without using your ISP's
    mail server.  With Redhat, just install it and set your outgoing
    mail server to "localhost" in your mail program.

  It also can let you receive mail direct to your PC through the internet
    but requires a little customization in the sendmail configuration files.
    This is really not practical unless you have a dedicated IP address,
    your own domain name, and a 24/7 connection to the internet.