NFSv4 - restrict access to exports by IP
by supermario18b from LinuxQuestions.org on (#589TT)
Hi everyone,
since NFSv4 needs a root share folder, I set /media/nfs_root accessible from everyone and two child folders accessible from specific IPs.
Here is my /etc/exports file:
Code:/media/nfs_root *(fsid=0,sync,no_subtree_check)
/media/nfs_root/nfs_child10 192.168.1.10(rw,sync,no_subtree_check)
/media/nfs_root/nfs_child20 192.168.1.20(rw,sync,no_subtree_check)The unexpected result (for me) is that everyone can mount the root and the child directories.
I'd like that the machine with IP 192.168.1.10 can only access the nfs_child10 folder and the machine with IP 192.168.1.20 can only access the nfs_child20 folder.
How do I have to modify the configuration file to achieve that?
Thanks in advance,
supermario18b


since NFSv4 needs a root share folder, I set /media/nfs_root accessible from everyone and two child folders accessible from specific IPs.
Here is my /etc/exports file:
Code:/media/nfs_root *(fsid=0,sync,no_subtree_check)
/media/nfs_root/nfs_child10 192.168.1.10(rw,sync,no_subtree_check)
/media/nfs_root/nfs_child20 192.168.1.20(rw,sync,no_subtree_check)The unexpected result (for me) is that everyone can mount the root and the child directories.
I'd like that the machine with IP 192.168.1.10 can only access the nfs_child10 folder and the machine with IP 192.168.1.20 can only access the nfs_child20 folder.
How do I have to modify the configuration file to achieve that?
Thanks in advance,
supermario18b