Chapter 9.Network File System (NFS)A Network File System (NFS) allows remote hosts to mount file systems over a network and interactwith those file systems as though they are mounted locally. This enables system administrators toconsolidate resources onto centralized servers on the network.This chapter focuses on fundamental NFS concepts and supplemental information. For specific in-structions regarding the configuration and operation of NFS server and client software, refer to thechapter titled Network File System (NFS) in the Red Hat Enterprise Linux System AdministrationGuide.9.1. How It WorksCurrently, there are two versions of NFS. NFS version 2 (NFSv2) is older and is widely supported.NFS version 3 (NFSv3) has more features, including variable size file handling and better error re-porting, but is not fully compatible with NFSv2 clients. Red Hat Enterprise Linux serves both NFSv2and NFSv3 clients, and when mounting a file system via NFS, Red Hat Enterprise Linux uses NFSv3by default, if server the supports it.NFSv2 uses the User Datagram Protocol (UDP) to provide a stateless network connection betweenthe client and server. NFSv3 can use either UDP or Transmission Control Protocol (TCP) runningover an IP network.The stateless UDP connection under normal conditions minimizes network traffic, as the NFS serversends the client a cookie after the client is authorized to access the shared volume. This cookie isa random value stored on the server’s side and is passed along with RPC requests from the client.The NFS server can be restarted without affecting the clients and the cookie remains intact. However,because UDP is stateless, if the server goes down unexpectedly, UDP clients continue to saturate thenetwork with requests for the server. For this reason, TCP is the preferred protocol when connectingto an NFSv3 server.NoteFor compatibility purposes, UDP is the default transport protocol for NFS under Red Hat EnterpriseLinux. Refer to the chapter titled Network File System (NFS) in the Red Hat Enterprise Linux SystemAdministration Guide for more information about connecting to NFS servers using TCP.The only time NFS performs authentication is when a client system attempts to mount the sharedNFS resource. To limit access to the NFS service, TCP wrappers are used. TCP wrappers read the/etc/hosts.allow and /etc/hosts.deny files to determine if a particular client or network ispermitted or denied access to the NFS service. For more information on configuring access controlswith TCP wrappers, refer to Chapter 16 TCP Wrappers and xinetd.After the client is granted access by TCP wrappers, the NFS server refers to its configuration file,/etc/exports, to determine whether the client is allowed to access any of the exported file systems.Once access is granted, all file and directory operations are available to the user.