SlideShare a Scribd company logo
Basic NFS Configuration
In this config will guide you trough a quick and basic configuration of NFS server on RHEL7
Linux system. We do not take any security concerns into the consideration, nor we will be
concerned with fine tuning and access control. In our scenario we define two hosts:
 NFS Server, IP 10.1.1.100
 NFS Client, IP 10.1.1.18
Assuming your already have a running Redhat 7 Linux system in order to setup NFS server you
will need to install few additional packages:
NFS Server configuration
Run the below commands to begin the NFS Server installation:
[nfs-server ]# yum install nfs-utils rpcbind
Next we export some arbitrary directory called /opt/nfs. Create /opt/nfs directory:
[nfs-server ]# mkdir -p /opt/nfs
and edit /etc/exports NFS exports file to add the below line while replacing the IP address
10.1.1.18 with the IP address of your client:
/opt/nfs 10.1.1.18(no_root_squash,rw,sync)
Next make sure to enable 2049 port on your firewall to allow clients requests:
[nfs-server ]# firewall-cmd --zone=public --add-port=2049/tcp --permanent
[nfs-server ]# firewall-cmd --reload
Start rpcbind daemon and NFS server in this order:
[nfs-server ]# service rpcbind start; service nfs start
Check the NFS server status:
[nfs-server ]# service nfs status
nfs-server.service - NFS Server
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled)
Active: active (exited) since Thu 2014-12-11 08:12:46 EST; 23s ago
Process: 2780 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT
(code=exited, status=0/SUCCESS)
Process: 2775 ExecStartPre=/usr/sbin/exportfs -r (code=exited,
status=0/SUCCESS)
Process: 2773 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-
server.preconfig (code=exited, status=0/SUCCESS)
Main PID: 2780 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service
NFS Client configuration
To be able to mount NFS exported directories on your client the following packages needs to be
installed. Depending on your client's Linux distribution the installation procedure may be
different. On Redhat 7 Linux the installation steps are as follows:
[nfs-client ]# yum install nfs-utils rpcbind
[nfs-client ]# service rpcbind start
What remains is to create a mount point directory eg. /mnt/nfs and mount previously NFS
exported /opt/nfs directory:
[nfs-client ]# mkdir -p /mnt/nfs
[nfs-client ]# mount 10.1.1.110:/opt/nfs /mnt/nfs/
Test correctness of our setup between NFS Server and NFS client. Create an arbitrary file within
NFS mounted directory on the client side:
[nfs-client ]# cd /mnt/nfs/
[nfs-client ]# touch NFS.test
[nfs-client ]# ls -l
total 0
-rw-r--r--. 1 root root 0 Dec 11 08:13 NFS.test
Move the the server side and check whether our newly NFS.test file exists:
[nfs-server ]# cd /opt/nfs/
[nfs-server ]# ls -l
total 0
-rw-r--r--. 1 root root 0 Dec 11 08:13 NFS.test
Configuring permanent NFS mount
Now that we have a basic NFS configuration on RHEL7 Linux system done, next we can add
additional settings such as server persistence and permanent client mount using /etc/fstab. In
order to have our NFS exports permanently available after the NFS server system reboot we need
to make sure that nfs service starts after reboot:
[nfs-server ]# systemctl enable nfs-server
ln -s '/usr/lib/systemd/system/nfs-server.service'
'/etc/systemd/system/nfs.target.wants/nfs-server.service'
To allow client to mount NFS exported directory permanently after reboot we need to define a
mount procedure within /etc/fstab config file. Open /etc/fstab file and add the following
line:
10.1.1.110:/opt/nfs /mnt/nfs nfs defaults 0 0
Mount User Home Directory
In the following steps we will export a user home directory /home/rhel7. Since NFS needs full
access privileges to access /home/rhel7:
[nfs-server ]# ls -ld /home/rhel7/
drwx------. 2 rhel7 rhel7 59 Jul 17 14:22 /home/rhel7/
we will bind it to a new directory:
[nfs-server ]# mkdir -p /exports/rhel7
[nfs-server ]# mount --bind /home/rhel7/ /exports/rhel7/
To make the above permanent add the following line into your /etc/fstab file:
/home/rhel7 /exports/rhel7 none bind 0 0
Next, add another export line into /etc/exports file:
/exports/rhel7 10.1.1.18(no_root_squash,rw,sync)
Re-export all NFS directories:
[nfs-server ]# exportfs -ra
What has left is to mount the above user directory using our client host:
[nfs-client ]# mount 10.1.1.110:/exports/rhel7 /mnt/rhel7/
[nfs-client ]# cd /mnt/rhel7/
[nfs-client ]# ls
[nfs-client ]# touch RHEL7-test-nfs
[nfs-client ]# ls
RHEL7-test-nfs
Confirm that the file RHEL7-test-nfs exists on NFS server:
# ls -l /home/rhel7/
total 0
-rw-r--r--. 1 root root 0 Dec 11 09:13 RHEL7-test-nfs

More Related Content

DOCX
Kickstart server
PDF
Ftp configuration in rhel7
DOC
Modul quick debserver
PPT
Slim Server Practical
DOCX
ESXi PXE Server-Instructions/Documentation
PDF
Configuration of Smtp Server On CentOS 8
DOCX
Installing lemp with ssl and varnish on Debian 9
DOCX
Kickstart server
Ftp configuration in rhel7
Modul quick debserver
Slim Server Practical
ESXi PXE Server-Instructions/Documentation
Configuration of Smtp Server On CentOS 8
Installing lemp with ssl and varnish on Debian 9

What's hot (20)

PPTX
Linux one sles12sp3 installation lpar
PDF
Firewalld LAB
PPTX
Presentation Linux Server setup Advance Networking
PPT
Its3 Drupal
PDF
Modul server debian 5
TXT
Ftp configuration
PDF
บล๊อกเวปไซท์ บน Open WRT หรือ บน Ubiquiti NanoStation M5 หรือ บน airOS
PDF
Step by-step installation of a secure linux web dns- and mail server
PPT
Apache1.ppt
PDF
2 how to-build_document_management_system
DOC
gcis-zenworks7.2
PDF
Install BIND9 on Ubuntu Server 12.04 LTS
PPTX
SquirrelMail for webmail
PDF
Configuration of NTP Server on CentOS 8
PDF
Snort296x centos6x 2
PPT
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
PDF
Tutorial CentOS 5 untuk Webhosting
PDF
Building a moat bastion server
PPT
PPT
Anthony McKeown Drupal Presentation
Linux one sles12sp3 installation lpar
Firewalld LAB
Presentation Linux Server setup Advance Networking
Its3 Drupal
Modul server debian 5
Ftp configuration
บล๊อกเวปไซท์ บน Open WRT หรือ บน Ubiquiti NanoStation M5 หรือ บน airOS
Step by-step installation of a secure linux web dns- and mail server
Apache1.ppt
2 how to-build_document_management_system
gcis-zenworks7.2
Install BIND9 on Ubuntu Server 12.04 LTS
SquirrelMail for webmail
Configuration of NTP Server on CentOS 8
Snort296x centos6x 2
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
Tutorial CentOS 5 untuk Webhosting
Building a moat bastion server
Anthony McKeown Drupal Presentation
Ad

Similar to Nfs (20)

PPT
Server configuration
PDF
Free ipa installation and cluster configuration, freeipa client connection
PPTX
NFS is an excellent way of sharing files between linux and other unix systems
PPTX
Linux network file system (nfs)
PDF
How to Install NFS Server and Client on Ubuntu 2404.pdf
PDF
Network File System (NFS)
PDF
sharing-filesystems-using-nfs-slides.pdf
ODP
LinuxKit Swarm Nodes
PPT
PDF
Membangun web server,_e-mail_server_dan_ftp_server
PPTX
Network file system (nfs)
ODP
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
PDF
Free radius billing server with practical vpn exmaple
PDF
Relax and Recover on POWER (Updated 05-2017)
PDF
Graphing Nagios services with pnp4nagios
PDF
Samba
PPTX
HP-UX 11iv3 Ignite-UX with NFSv4 and SSH Tunnel by Dusan Baljevic
PDF
Lamp Server With Drupal Installation
PDF
Rac on NFS
PDF
NGiNX, VHOSTS & SSL (let's encrypt)
Server configuration
Free ipa installation and cluster configuration, freeipa client connection
NFS is an excellent way of sharing files between linux and other unix systems
Linux network file system (nfs)
How to Install NFS Server and Client on Ubuntu 2404.pdf
Network File System (NFS)
sharing-filesystems-using-nfs-slides.pdf
LinuxKit Swarm Nodes
Membangun web server,_e-mail_server_dan_ftp_server
Network file system (nfs)
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Free radius billing server with practical vpn exmaple
Relax and Recover on POWER (Updated 05-2017)
Graphing Nagios services with pnp4nagios
Samba
HP-UX 11iv3 Ignite-UX with NFSv4 and SSH Tunnel by Dusan Baljevic
Lamp Server With Drupal Installation
Rac on NFS
NGiNX, VHOSTS & SSL (let's encrypt)
Ad

More from Md Shihab (12)

PDF
Maria db
PDF
Mail
PDF
Iscsi
PDF
PDF
Dhcp
PDF
Boot
DOCX
Rhel 7 root password reset
DOCX
Easy vlsm
DOCX
RedHat/CentOs Commands for administrative works
PPTX
How to transfer core mode into gui in RedHat/centOs
PPTX
Assignment on windows firewall
PPTX
Assignment on high availability(clustering)
Maria db
Mail
Iscsi
Dhcp
Boot
Rhel 7 root password reset
Easy vlsm
RedHat/CentOs Commands for administrative works
How to transfer core mode into gui in RedHat/centOs
Assignment on windows firewall
Assignment on high availability(clustering)

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation theory and applications.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation theory and applications.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Nfs

  • 1. Basic NFS Configuration In this config will guide you trough a quick and basic configuration of NFS server on RHEL7 Linux system. We do not take any security concerns into the consideration, nor we will be concerned with fine tuning and access control. In our scenario we define two hosts:  NFS Server, IP 10.1.1.100  NFS Client, IP 10.1.1.18 Assuming your already have a running Redhat 7 Linux system in order to setup NFS server you will need to install few additional packages: NFS Server configuration Run the below commands to begin the NFS Server installation: [nfs-server ]# yum install nfs-utils rpcbind Next we export some arbitrary directory called /opt/nfs. Create /opt/nfs directory: [nfs-server ]# mkdir -p /opt/nfs and edit /etc/exports NFS exports file to add the below line while replacing the IP address 10.1.1.18 with the IP address of your client: /opt/nfs 10.1.1.18(no_root_squash,rw,sync) Next make sure to enable 2049 port on your firewall to allow clients requests: [nfs-server ]# firewall-cmd --zone=public --add-port=2049/tcp --permanent [nfs-server ]# firewall-cmd --reload Start rpcbind daemon and NFS server in this order: [nfs-server ]# service rpcbind start; service nfs start Check the NFS server status: [nfs-server ]# service nfs status nfs-server.service - NFS Server Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) Active: active (exited) since Thu 2014-12-11 08:12:46 EST; 23s ago Process: 2780 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS) Process: 2775 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS) Process: 2773 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs- server.preconfig (code=exited, status=0/SUCCESS) Main PID: 2780 (code=exited, status=0/SUCCESS) CGroup: /system.slice/nfs-server.service NFS Client configuration To be able to mount NFS exported directories on your client the following packages needs to be installed. Depending on your client's Linux distribution the installation procedure may be different. On Redhat 7 Linux the installation steps are as follows: [nfs-client ]# yum install nfs-utils rpcbind [nfs-client ]# service rpcbind start What remains is to create a mount point directory eg. /mnt/nfs and mount previously NFS exported /opt/nfs directory:
  • 2. [nfs-client ]# mkdir -p /mnt/nfs [nfs-client ]# mount 10.1.1.110:/opt/nfs /mnt/nfs/ Test correctness of our setup between NFS Server and NFS client. Create an arbitrary file within NFS mounted directory on the client side: [nfs-client ]# cd /mnt/nfs/ [nfs-client ]# touch NFS.test [nfs-client ]# ls -l total 0 -rw-r--r--. 1 root root 0 Dec 11 08:13 NFS.test Move the the server side and check whether our newly NFS.test file exists: [nfs-server ]# cd /opt/nfs/ [nfs-server ]# ls -l total 0 -rw-r--r--. 1 root root 0 Dec 11 08:13 NFS.test Configuring permanent NFS mount Now that we have a basic NFS configuration on RHEL7 Linux system done, next we can add additional settings such as server persistence and permanent client mount using /etc/fstab. In order to have our NFS exports permanently available after the NFS server system reboot we need to make sure that nfs service starts after reboot: [nfs-server ]# systemctl enable nfs-server ln -s '/usr/lib/systemd/system/nfs-server.service' '/etc/systemd/system/nfs.target.wants/nfs-server.service' To allow client to mount NFS exported directory permanently after reboot we need to define a mount procedure within /etc/fstab config file. Open /etc/fstab file and add the following line: 10.1.1.110:/opt/nfs /mnt/nfs nfs defaults 0 0 Mount User Home Directory In the following steps we will export a user home directory /home/rhel7. Since NFS needs full access privileges to access /home/rhel7: [nfs-server ]# ls -ld /home/rhel7/ drwx------. 2 rhel7 rhel7 59 Jul 17 14:22 /home/rhel7/ we will bind it to a new directory: [nfs-server ]# mkdir -p /exports/rhel7 [nfs-server ]# mount --bind /home/rhel7/ /exports/rhel7/ To make the above permanent add the following line into your /etc/fstab file: /home/rhel7 /exports/rhel7 none bind 0 0 Next, add another export line into /etc/exports file: /exports/rhel7 10.1.1.18(no_root_squash,rw,sync) Re-export all NFS directories: [nfs-server ]# exportfs -ra What has left is to mount the above user directory using our client host: [nfs-client ]# mount 10.1.1.110:/exports/rhel7 /mnt/rhel7/ [nfs-client ]# cd /mnt/rhel7/ [nfs-client ]# ls [nfs-client ]# touch RHEL7-test-nfs [nfs-client ]# ls
  • 3. RHEL7-test-nfs Confirm that the file RHEL7-test-nfs exists on NFS server: # ls -l /home/rhel7/ total 0 -rw-r--r--. 1 root root 0 Dec 11 09:13 RHEL7-test-nfs