Networking

Restarting network services

/sbin/service network restart

NFS

  • Network File System
  • Package needed: nfs-utils
  • Create the local directories that will serve as mount points for the nfs partitions of the other computers.

Config files

  • /etc/hosts
  • /etc/fstab
  • /etc/exports
  • /etc/hosts.allow
  • /etc/hosts.deny

Services

  • nfs
  • portmap

Daemons

  • rpc.portmap   (or portmap)
  • rpc.lockd
  • rpc.mountd
  • rpc.statd
  • rpc.rquotad
  • rpc.nfsd

Usage

  • To find out which runlevels the services are enabled in:
/sbin/chkconfig --list
  • To find out how many of the daemons are running:
/usr/sbin/rpcinfo -p
ps -x | grep rpc
  • Mounting the nfs partitions
  • If the "noauto" option is used in fstab, the nfs partition has to be mounted manually when needed:
mount <local-mount-point>
  • The nfs partion can be manually unmounted with the following command:
umount <local-mount-point>
  • Synchronizing the computers
  • To prevent problems with access and ownership rights, /etc/passwd and /etc/group must be synchronized on all computers.
  • On all computers, the same UID and GID numbers must apply.
  • In large networks, this can be achieved through NIS or rpc.ugidd.
  • Locking problems can be avoided by using the "nolock" option in fstab.

Installation

  • Installing the nfs-utils package (if not already installed)
  • Enabling the services in the appropriate runlevels: 
/sbin/chkconfig --level 345 nfs     on
/sbin/chkconfig --level 345 portmap on
  • Loading the daemons (if not already loaded) (requires root or sudo):
/sbin/portmap
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/sbin/rpc.statd
/sbin/rpc.lockd
/usr/sbin/rpc.rquotad
  • Sample lines added to config files:
  • /etc/hosts
192.168.1.100    jupiter.planets.network  jupiter
192.168.1.101    saturn.planets.network    saturn
  • /etc/fstab
saturn:/mnt/saturn/public  /mnt/saturn  nfs  noauto,user,ro,hard,intr  0 0
  • /etc/exports
/mnt/jupiter/public  saturn(ro)
  • /etc/hosts.allow
portmap: saturn 
lockd:   saturn 
mountd:  saturn 
rquotad: saturn
statd:   saturn
  • /etc/hosts.deny
portmap: ALL 
lockd:   ALL 
mountd:  ALL 
rquotad: ALL 
statd:   ALL
  • Description of the sample installation:
  • jupiter and saturn are two computers in the domain planets.network.
  • The changes shown are for jupiter.
  • jupiter will access files on saturn located at /mnt/saturn/public, using /mnt/saturn as the local mount point.
  • The directory /mnt/saturn must be created on jupiter.
  • jupiter will allow saturn access to files located at /mnt/jupiter/public.

NIS

  • Network Information Service
  • NIS provides information that has to be known throughout the network, to all machines on the network.
  • If a users password entry is recorded in the NIS passwd database, they can login on all machines on the network which have the NIS client programs running.
  • Information commonly distributed by NIS
  • login names/passwords/home directories (/etc/passwd)
  • group information (/etc/group)
  • Roles for computers in the NIS domain:
  • Server (master server)
  • Slave (nonmaster server) (automatically receives updated NIS databases from the master NIS server, via the yppush program)
  • Client

Client software

  • ypbind, ypwhich, ypcat, yppoll, ypmatch
  • As soon as ypbind is running the computer is an NIS client.

Server software

  • ypserv

Misc

  • Manually set the nisdomain in /etc/sysconfig/network 
NISDOMAIN=mydomain.network

 

Resources URL: 
notes/linux/resources
Sources URL: 
notes/linux/sources

See Also