linux_wiki:provide_network_shares_to_specific_clients

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:provide_network_shares_to_specific_clients [2016/08/31 23:06]
billdozor [NFS Server: Install and Configure]
linux_wiki:provide_network_shares_to_specific_clients [2019/05/25 23:50] (current)
Line 4: Line 4:
  
 Configuring a NFS Server/Client. Configuring a NFS Server/Client.
 +
 +----
 +
 +====== Lab Setup ======
 +
 +The following virtual machines will be used:
 +  * server1.example.com (192.168.1.150) -> Perform all NFS client tests from here
 +  * server2.example.com (192.168.1.151) -> Install the NFS server here
  
 ---- ----
Line 15: Line 23:
  
 \\ \\
-Create directories for exports+Enable and start services
 <code bash> <code bash>
-mkdir /test1 /test2+systemctl enable nfs-server 
 +systemctl start nfs-server 
 +</code> 
 + 
 +\\ 
 +Allow through the firewall 
 +<code bash> 
 +# nfs -> allow mounting 
 +firewall-cmd --permanent --add-service=nfs 
 +firewall-cmd --reload 
 + 
 +# allow showmount -e <servername> 
 +firewall-cmd --permanent --add-service=rpc-bind 
 +firewall-cmd --permanent --add-service=mountd 
 +firewall-cmd --reload
 </code> </code>
  
Line 33: Line 55:
  
 \\ \\
-Allow through the firewall+Create the NFS common file and require IDMAPD for file sharing.
 <code bash> <code bash>
-firewall-cmd --permanent --add-service=nfs +vim /etc/default/nfs-common 
-firewall-cmd --reload+ 
 +NEED_IDMAPD=YES
 </code> </code>
 +  * **NOT REQUIRED on 7.4**: No longer required in RHEL 7.4 (not sure what version this changed in)
  
 \\ \\
-Enable and start services+Edit the domain in the idmapd.conf file
 <code bash> <code bash>
-systemctl enable rpcbind +vim /etc/idmapd.conf
-systemctl enable nfs-server+
  
-systemctl start rpcbind +DOMAIN = server1.example.com 
-systemctl start nfs-server+</code> 
 +  * Edit domain as required for system 
 +  * **NOT REQUIRED on 7.4**: No longer required in RHEL 7.4 (not sure what version this changed in) due to the default using the domain of the system exporting. 
 + 
 +\\ 
 +Create directories for exports 
 +<code bash> 
 +mkdir /test1 /test2 
 +</code> 
 + 
 +\\ 
 +Give them the proper SELinux contexts 
 +<code bash> 
 +semanage fcontext -at nfs_t "/test1(/.*)?" 
 +semanage fcontext -at nfs_t "/test2(/.*)?" 
 +restorecon -Rv /test1 
 +restorecon -Rv /test2
 </code> </code>
  
Line 65: Line 104:
   * -v  -> verbose   * -v  -> verbose
   * -a  -> all directories   * -a  -> all directories
-  * -r  -> +  * -r  -> Re-export all directories. (remove no longer valid entries)
  
 \\ \\
 Restart services Restart services
 <code bash> <code bash>
-systemctl restart rpcbind 
 systemctl restart nfs-server systemctl restart nfs-server
 </code> </code>
Line 88: Line 126:
 systemctl enable rpcbind systemctl enable rpcbind
 systemctl start rpcbind systemctl start rpcbind
 +</code>
 +
 +\\
 +**Optional**: Display the remove NFS server's available mounts
 +<code bash>
 +showmount -e 192.168.1.200
 </code> </code>
  
  • linux_wiki/provide_network_shares_to_specific_clients.1472699174.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)