NFS: Provide Network
shares to specific Clients
(I am using
NFS server and NFS clients for this context, but actually no NFS server exists,
the server which is sharing NFS files assumed as NFS server and the clients or
servers which are accessing those NFS files are assumed as NFS clients)
On the NFS server Side (server IP 192.168.2.250)
Install necessary
packages,
#yum install
nfs-utils rpcbind
#/etc/init.d/nfs
start
#/etc/init.d/rpcbind
start
Create NFS
shares:
Edit file
/etc/exportfs
Inside
/etc/exportfs add the mount point and share permissions,
#nano
/etc/exportfs
#add the
shares
Ex.
/test 192.168.0.0/24(rw,sync)
#this create
share with Read Write permission and this can be accessible by all clients in
192.168.0.0/24 subnet.
/test 192.168.0.217(rw,sync)
# NFS share only to client 192.168.0.217
/test 192.168.0.0/24(ro) #Read only across
the subnet
Save and
close the file.
Restart NFS
services on the server side.
On the client end:
Install
packages to access NFS shares (Install client for NFS)
#yum install
portmap nfs-common
#add NFS
server to /etc/hosts
Mount NFS
shares as,
#mount 192.168.2.250:/test /mnt/test
For permanent
mount edit fstab,
#nano
/etc/fstab
Add these
lines,
192.168.0.2.250:/test /mnt/test nfs
defaults 0 0
No comments:
Post a Comment