¿QUE ES NFS?
He Network File System (Network File System), o NFS, it's a protocol application level, depending on the OSI model. It is used for distributed file systems in a local area computer network environment. Enables different systems connected to the same network to access remote files as if they were local files
We install the necessary packages.
aptitude install nfs-kernel-server portmap nfs-common nfswatchWe verify that portmap is running.
ps aux | grep portmap
daemon 1166 0.0 0.0 1808 448 ? Ss Dec26 0:00 /sbin/portmapTo know if NFS is running, we will query the portmap to tell us what services it has running.
rpcinfo -p
programa vers proto puerto
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 53104 status
100024 1 tcp 40155 status
100021 1 udp 42941 nlockmgr
100021 3 udp 42941 nlockmgr
100021 4 udp 42941 nlockmgr
100021 1 tcp 48742 nlockmgr
100021 3 tcp 48742 nlockmgr
100021 4 tcp 48742 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100005 1 udp 49454 mountd
100005 1 tcp 45660 mountd
100005 2 udp 49454 mountd
100005 2 tcp 45660 mountd
100005 3 udp 49454 mountd
100005 3 tcp 45660 mountdOnce the verification is done we are going to mount the disk, FS or folder that we want. The configuration is done in the file: /etc/exports
vi /etc/exportsSyntax:
We insert the route, IP, subnet mask and permissions
Example:
/media/DATOS 192.168.1.0/255.255.255.0(rw)Basic configuration /etc/hosts.allow and /etc/hosts.deny
/etc/hosts.deny
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
/etc/hosts.allow
portmap:192.168.0.0/255.255.255.0
lockd:192.168.0.0/255.255.255.0
mountd:192.168.0.0/255.255.255.0
rquotad:192.168.0.0/255.255.255.0
statd:192.168.0.0/255.255.255.0We start the daemon
/etc/init.d/nfs-kernel-server restartWe check that you have shared it correctly.
exportfs
/media/DATOS 192.168.1.0/255.255.255.0Client settings
We install the necessary packages.
apt-get install rpcbind nfs-commonWe must allow the server's rpcbind.
vi /etc/hosts.allow
and we add:
rpcbind: 192.168.1.101/255.255.255.255
Command syntax:
We insert ip or name, shared directory and mount point
mount -nfs <IP O NOMBREEA>:/<DIRECTORIO> <PUNTO DE MONTAJE>Example:
mount -nfs 192.168.1.101:/media/DATOS /DATOS -o nolockIf we want the NFS file system to be mounted at boot, we must add an entry in the file /etc/fstab. In our example we would add
192.168.1.101:/DATOS /DATOS nfs rw,hard,intr 0 0Greetings, rokitoh!
Comments