Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:provide_network_shares_to_specific_clients [2016/09/01 23:56] 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/ | Configuring a NFS Server/ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== 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: | ||
\\ | \\ | ||
- | Find SELinux boolean nfs export | + | Enable and start services |
<code bash> | <code bash> | ||
- | getsebool | + | systemctl enable nfs-server |
+ | systemctl start nfs-server | ||
</ | </ | ||
\\ | \\ | ||
- | Set SELinux booleans to on if they are not | + | Allow through the firewall |
<code bash> | <code bash> | ||
- | setsebool | + | # nfs -> allow mounting |
+ | firewall-cmd --permanent --add-service=nfs | ||
+ | firewall-cmd --reload | ||
+ | |||
+ | # allow showmount -e < | ||
+ | firewall-cmd --permanent --add-service=rpc-bind | ||
+ | firewall-cmd --permanent --add-service=mountd | ||
+ | firewall-cmd --reload | ||
</ | </ | ||
\\ | \\ | ||
- | Allow through the firewall | + | Find SELinux boolean nfs export |
<code bash> | <code bash> | ||
- | firewall-cmd --permanent --add-service=nfs | + | getsebool |
- | firewall-cmd --reload | + | |
</ | </ | ||
\\ | \\ | ||
- | Enable and start services | + | Set SELinux booleans to on if they are not |
<code bash> | <code bash> | ||
- | systemctl enable nfs-server | + | setsebool |
- | systemctl start nfs-server | + | |
</ | </ | ||
\\ | \\ | ||
- | Create the NFS common file and require IDMAPD for file sharing | + | Create the NFS common file and require IDMAPD for file sharing. |
<code bash> | <code bash> | ||
vim / | vim / | ||
Line 47: | Line 61: | ||
NEED_IDMAPD=YES | NEED_IDMAPD=YES | ||
</ | </ | ||
+ | * **NOT REQUIRED on 7.4**: No longer required in RHEL 7.4 (not sure what version this changed in) | ||
\\ | \\ | ||
Line 56: | Line 71: | ||
</ | </ | ||
* Edit domain as required for system | * 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. | ||
\\ | \\ | ||
Line 61: | Line 77: | ||
<code bash> | <code bash> | ||
mkdir /test1 /test2 | mkdir /test1 /test2 | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Give them the proper SELinux contexts | ||
+ | <code bash> | ||
+ | semanage fcontext -at nfs_t "/ | ||
+ | semanage fcontext -at nfs_t "/ | ||
+ | restorecon -Rv /test1 | ||
+ | restorecon -Rv /test2 | ||
</ | </ | ||
Line 79: | Line 104: | ||
* -v -> verbose | * -v -> verbose | ||
* -a -> all directories | * -a -> all directories | ||
- | * -r -> | + | * -r -> Re-export all directories. (remove no longer valid entries) |
\\ | \\ |