NFS Server / Client
This is the notes from my setup.
Server
Export
I am setting up server for NFSv4 without Security IP based access list.
NOTE : Match your uid with anonuid
- | /etc/exports
/home 192.168.1.0/24(rw,sync,insecure,root_squash,no_subtree_check,fsid=0) /home/download 192.168.1.4(rw,nohide,sync,insecure,no_root_squash,no_subtree_check,anonuid=1000,anongid=100) /home/movies 192.168.1.4(rw,nohide,sync,insecure,no_root_squash,no_subtree_check,anonuid=1000,anongid=100) /home/net/Pictures 192.168.1.4(rw,nohide,sync,insecure,no_root_squash,no_subtree_check,anonuid=1000,anongid=100)
NFS Ports
Now change following settings.
If any of the variable not exists please add as new line.
These disables legacy version and NFS v3 Support.
As keeping NFSv3 Support lead you to open many port in firewall and might cause issue on permission.
- | /etc/sysconfig/nfs
MOUNTD_NFS_V1="no" MOUNTD_NFS_V2="no" RPCNFSDARGS="-N 2 -N 3 -U"
Firewall
Add Following lines to your firewall rules.
- | /etc/sysconfig/iptables
-A INPUT -s 192.168.1.4 -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
Services
Now restart / start all modified services.
In new Fedora it is some thing like as follow
Some server require to be started in specific order.
- systemctl restart rpcbind.service
- systemctl restart iptables.service
- systemctl restart nfs-idmap.service
- systemctl restart nfs-server.service
Client
To setup client to mount exported FS use following.
- | /etc/fstab
192.168.1.5:download /opt/download nfs4 proto=tcp,intr,rw 0 0 192.168.1.5:movies /opt/movies nfs4 proto=tcp,intr,rw 0 0 192.168.1.5:net/Pictures /opt/Picture nfs4 proto=tcp,intr,rw 0 0 192.168.1.5:net/Music /opt/Music nfs4 proto=tcp,intr,rw 0 0
You can refer following manual for further information.
Since all these is some how i gathered from these documentation.