Advertisement
shokti

centos 6.5 - nfs server

Jun 27th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. SERVER(192.168.1.200):
  2.  
  3. Install NFS in Server system
  4. yum install nfs* -y or yum install nfs-utils nfs-utils-lib
  5.  
  6.  
  7. Start NFS service
  8. service rpcbind start
  9. chkconfig rpcbind on
  10. service nfs start
  11. chkconfig nfs on
  12.  
  13. Create shared directories
  14. mkdir /srv/nfs_share
  15. chmod 755 /srv/nfs_share/
  16.  
  17. Export shared directories
  18. vi /etc/exports
  19. ----------------------------------------------------------------------------
  20. /srv/nfs_share/ 192.168.1.0/24(rw,sync,no_root_squash,no_all_squash)
  21. /srv/shared/ 192.168.1.250/255.255.255.0(rw,sync)
  22. ----------------------------------------------------------------------------
  23.  
  24. note:
  25. /srv/nfs_share – shared directory
  26. 192.168.1.0/24 – IP address range of clients
  27. rw – Writable permission to shared folder
  28. sync – Synchronize shared directory
  29. no_root_squash – Enable root privilege
  30. no_all_squash – Enable user’s authority
  31.  
  32.  
  33. enter command to export
  34. exportfs -a
  35.  
  36. Restart the NFS service
  37. service nfs restart
  38.  
  39. allow nfs in iptables
  40. iptables -A INPUT -p tcp --dport 2049 -j ACCEPT
  41. iptables -A INPUT -p tcp --dport 111 -j ACCEPT
  42. iptables -A INPUT -p tcp --dport 32803 -j ACCEPT
  43. iptables -A INPUT -p tcp --dport 892 -j ACCEPT
  44. iptables -A INPUT -p tcp --dport 875 -j ACCEPT
  45. iptables -A INPUT -p tcp --dport 662 -j ACCEPT
  46.  
  47. service iptables save
  48. service iptables restart
  49.  
  50.  
  51.  
  52. =================================================
  53. CLIENT(192.168.1.250):
  54.  
  55.  
  56.  
  57. Install NFS in Client System
  58. yum install nfs* -y or yum install nfs-utils nfs-utils-lib
  59.  
  60.  
  61. Start NFS service
  62. service rpcbind start
  63. chkconfig rpcbind on
  64. service nfs start
  65. chkconfig nfs on
  66.  
  67. Mount the share directory
  68. mkdir /mnt/nfsshare
  69. mount -t nfs 192.168.1.250:/srv/nfs_share/ /mnt/nfsshare/
  70.  
  71. automount nfs share
  72. vi /etc/fstab
  73. ----------------------------------------------------------------------------
  74. 192.168.1.200:/srv/nfs_share/ /mnt/nfsshare/ nfs rw,sync,hard,intr 0 0
  75. ----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement