WhileNetworking

  • Home
  • CCNA
  • Cisco Packet Tracer Download
    • Cisco packet tracer 6.3
    • cisco packet tracer 6.2
    • Cisco Packet Tracer 7
  • Linux Server Management
  • About Us
  • Privacy Policy
  • Contact Us

Network file system (NFS) set up in Linux (CentOS/Red Hat)

You are most welcome to this post.
network connection manager edit
Really thanks to you for your interest in this topics. :)

Now in this post, we’ll discuss and enjoy the NFS. NFS stands for Network File System. It is a server client protocol and it is used for sharing files between UNIX/LINUX to UNIX/LINUM system. Also you can mount a remote share locally through the NFS. After doing so, you can be able to access files which is located in the remote.

Network file system (NFS) set up in Linux (CentOS/Red Hat)

 

At first just have a look at the Reference Table:

We’ll use this Packages: nfs-utils, nfs-utils-lib

Daemon: nfs-server, rpcbind,

 

IP of NFS Server: 172.25.11.200+X (Virtual Machine)

IP of NFS Client: 172.25.11.100+X (Desktop Machine)

 

Step 01: Query and Package Install

[root@serverX ~]# rpm -qa | grep nfs-utils

[root@serverX ~]# yum install nfs-utils nfs-utils-lib -y

 

Step 02: Service Restart and enable

[root@serverX ~]# systemctl enable rpcbind.service

[root@serverX ~]# systemctl enable nfs-server.service

 

(Optional) systemctl enable nfs-idmap.service

 

[root@serverX ~]# systemctl start rpcbind.service

[root@serverX ~]# systemctl start nfs-server.service

 

(Optional)systemctl start nfs-idmap.service

 

SELinux Disable:

[root@serverX ~]# setenforce 0

 

Allow NFS Service in Firewall:

 

[root@serverX ~]# systemctl restart firewalld.service

[root@serverX ~]# systemctl enable firewalld.service

[root@serverX ~]# firewall-cmd –permanent –add-service=nfs

[root@serverX ~]# firewall-cmd –reload

 

Step 03: Create a shared directory

[root@serverX ~]# mkdir /nfsshare -p

[root@serverX ~]# cd /nfsshare

[root@serverX nfsshare]# ls

[root@serverX nfsshare]# mkdir download documents software project office

[root@serverX nfsshare]# ls

documents download office project software

[root@serverX nfsshare]# cd documents/

[root@serverX documents]# ls

[root@serverX documents]# touch doc{1..10}

[root@serverX documents]# cd ..

[root@serverX nfsshare]# cd download/

[root@serverX download]# touch file1 file2 file3

[root@serverX download]# cd ..

[root@serverX nfsshare]# cd office

[root@serverX office]# touch job cv profile

[root@serverX office]# cd ..

[root@serverX nfsshare]# cd project/

[root@serverX project]# touch project{1..5}

[root@serverX project]# cd ..

[root@serverX nfsshare]# cd software/

[root@serverX software]# touch office.exe vlc.exe skype.exe

[root@serverX software]# cd ..

[root@serverX nfsshare]#

 

Step 04: Export shared directory on NFS Server:

[root@serverX ~]# vim /etc/exports

 

/nfsshare/software     172.25.11.0/24(rw,sync,no_root_squash)

/nfsshare/project       172.25.11.0/24(ro,sync,no_root_squash)

/nfsshare/download     *(ro,sync,no_root_squash)

/nfsshare/documents     172.25.11.100+X(rw,sync,no_root_squash)

/nfsshare/office       *.example.com(rw,sync,no_root_squash)

 

Note:

=> /var/nfshare – shared directory

=> 172.25.11.0/24 – IP address range of clients

=> rw – Writable permission to shared folder

=> sync – Synchronize shared directory

=> no_root_squash – Enable root privilege

=> no_all_squash – Enable user’s authority

 

Step 05: Restart the NFS service and verify:

[root@serverX ~]# systemctl restart nfs-server

[root@serverX ~]# exportfs -ra

[root@serverX ~]# showmount -e localhost

 

Client Side Confiugration:

Step 06: Install NFS packages in your client system

[root@desktopX ~]# yum install nfs-utils nfs-utils-lib

 

Step 07: Service Restart and enable

[root@desktopX ~]# systemctl enable rpcbind.service

[root@desktopX ~]# systemctl enable nfs-server.service

 

(Optional)

systemctl enable nfs-idmap.service

 

[root@desktopX ~]# systemctl start rpcbind.service

[root@desktopX ~]# systemctl start nfs-server.service

 

(Optional) systemctl start nfs-idmap.service

 

Step 08: View NFS Share on NFS Server

[root@desktopX ~]# showmount -e 172.25.11.200+X     ; X is your NFS Server IP

 

Export list for 172.25.11.X:

/nfsshare/download *

/nfsshare/office   *.example.com

/nfsshare/project   172.25.11.0/24

/nfsshare/software 172.25.11.0/24

/nfsshare/documents 172.25.11.100+X       ; X = Specific an IP address

 

Step 09: Mount NFS shares On clients

[root@desktopX ~]# mkdir /nfsdataY       ; Y is your batch no

[root@desktopX ~]# mount -t nfs 172.25.11.200+X:/nfsshare/project /nfsdataY

[root@desktopX ~]# cd /nfsdataY

[root@desktopX nfsdataY]# ls

[root@desktopX nfsdataY]# df -HT

[root@desktopX nfsdataY]# touch newproject

[root@desktopX nfsdataY]# cd

[root@desktopX ~]# umount /nfsdataY

 

[root@desktopX ~]# mount -t nfs 172.25.11.200+X:/nfsshare/software /nfsdataY

[root@desktopX ~]# cd /nfsdataY

[root@desktopX nfsdataY]# ls

[root@desktopX nfsdataY]# df -HT

[root@desktopX nfsdataY]# touch newsoft

[root@desktopX nfsdataY]# cd

[root@desktopX ~]# umount /nfsdata

 

Step 10: Mount NFS shares On clients

[root@desktopX ~]# vim /etc/fstab

 

172.25.11.200+X:/nfsshare/project /nfsdata nfs defaults 0 0

 

[root@desktopX ~]# mount -a

[root@desktopX ~]# mount

NFS configuration in Linux, NFS configuration in CentOS, NFS configuration in Red Hat

NFS configuration

Jun 16, 2016Himadri
 

Share with friends :

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to email a link to a friend (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to print (Opens in new window)

Related

Firewall configuration in Linux (CentOS/Red Hat)Configuring Linux Samba Server

Leave a Reply Cancel reply

ten + twenty =

Himadri

Hi, I'm Himadri. I love blogging with tech topics, specially computer networking. We'll have more fun in the upcoming day. Stay with me. :)

June 16, 2016 8 Comments Linux installation and server managementNetwork file system, NFS Linux, NFS Management321
Feel Free to Share :)
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Find Us on Facebook
Choose a category !!
  • CCNA
  • Cisco Certification Exam
  • cisco packet tracer 6.2
  • Cisco packet tracer 6.3
  • Cisco Packet Tracer 7
  • Cisco Packet Tracer 7.1
  • Cisco Packet Tracer 7.2.1
  • Cisco Packet Tracer 7.3
  • Cyber Security
  • Engineering Ebooks
  • Excel
  • IELTS Ebook
  • Internet
  • Know computer
  • Know your computer
  • Laser Processing of Material
  • Linux installation and server management
  • PDF
  • Technology
  • Uncategorized
Top posts
  • Free download Principles of Electronics by VK Mehta
  • Packet tracer 6.2 student version for Linux - Free download
Archieves
Get latest updates by Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 19 other subscribers
W
SC
wordpress counter
Analytics
Recent Comments
    Browse by categories
    Cyber SecurityLinux installation and server managementCCNAKnow your computerKnow computerCisco Packet Tracer 7UncategorizedCisco Certification ExamInternetPDFCisco Packet Tracer 7.3Engineering EbooksCisco packet tracer 6.3cisco packet tracer 6.2Cisco Packet Tracer 7.1TechnologyExcelLaser Processing of MaterialCisco Packet Tracer 7.2.1IELTS Ebook
    Feel free to contact with us

    Hi, any kind of comment or suggestion is valuable to us. So feel free to contact with us.

    Email: himadri.shekhar.bd@gmail.com

    Name: WhileNetworking.com

    2021 © WhileNetworking
     

    Loading Comments...