Linux serverNETWORK ADMINISTRATIONS

Configure – Network File System (NFS) on CentOS 8

Configure – Network File System (NFS) on CentOS 8

Configuring The NFS Server
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/nfs-serverconfig

How to Install and Configure an NFS Server on CentOS 8
https://linuxize.com/post/how-to-install-and-configure-an-nfs-server-on-centos-8/

Server: 10.0.0.3
——

### Instalar el servidor NFS
# yum update
# dnf install nfs-utils
# systemctl enable –now nfs-server
# cat /proc/fs/nfsd/versions

### Crear los sistemas de archivos
# mkdir -p /srv/nfs4/{backups,downloads}
# mkdir /opt/backups
# chown anvalenciao:anvalencio /opt/backups
# chmod 775 /opt/backups

# sudo mount –bind /opt/backups /srv/nfs4/backups
# sudo mount –bind /home/anvalenciao/Downloads /srv/nfs4/downloads

# nano /etc/fstab
/opt/backups /srv/nfs4/backups none bind 0 0
/home/anvalenciao/Downloads /srv/nfs4/downloads none bind 0 0

### Exportando los sistemas de archivos
# nano /etc/exports
/srv/nfs4 10.0.0.2(rw,sync,no_subtree_check,crossmnt,fsid=0)
/srv/nfs4/backups 10.0.0.2(rw,sync,no_subtree_check)
/srv/nfs4/downloads 10.0.0.2(rw,sync,no_subtree_check)

# exportfs -ra
# exportfs -v

### Configuración de firewall
# firewall-cmd –new-zone=nfs –permanent
# firewall-cmd –zone=nfs –add-service=nfs –permanent
# firewall-cmd –zone=nfs –add-source=10.0.0.2 –permanent
# firewall-cmd –reload

Client: 10.0.0.2
——

### Montaje de sistemas de archivos
# mkdir -p /backups
# mount -t nfs -o vers=4 10.0.0.3:/backups /backups

# mkdir -p /downloads
# mount -t nfs -o vers=4 10.0.0.3:/downloads /downloads

# df -h

# nano /etc/fstab
10.0.0.3:/backups /backups nfs defaults,timeo=900,retrans=5,_netdev 0 0
10.0.0.3:/downloads /downloads nfs defaults,timeo=900,retrans=5,_netdev 0 0

### Prueba de acceso NFS
$ touch /backups/test.txt
$ touch /downloads/test.txt

source

centos 8

Leave a Reply

Your email address will not be published. Required fields are marked *