Enable NFS4 share to multiple subnets

  • Per the title - I have seen a couple of quite old threads here on this topic. My question though comes from a usability standpoint. NFS exports allow for multiple network identifications (machine names, IPs, ranges, etc.) to be specified on a single export by repeating the mount options with each range/IP/etc.


    Logically then, specifying a white-space separated list of IPs/ranges/etc. in the "Client" input of the NFS share creation screen should then achieve this. On testing this I can provide multiple subnets for example, however when trying to mount from the client I get an error "mounting ... failed, reason given by server: No such file or directory" and it looks like the NFS exports fail. I haven't got quite enough knowledge to diagnose this much further, still learning.


    All said, I know you can create a share twice, each one with different client restrictions - however this isn't a good UX, especially if one is a newbie, or if one has lots of shares to manage.


    So I am not sure if this is a bug report, a feature request, or an open-ended discussion :D


    Any advice/input welcome. :?:

  • Run the below command on the client machine and let us know what the output is:

    showmount -e <omv_server_hostname_or_ip>


    PS. Remember that for NFS4 you skip "export" bit when mounting, so something which looked like this in NFS3: "/export/my_disk" will become "/my_disk" in NFS4.

    OMV7 on RPi4B, WD elements 4TB

  • So I am not sure if this is a bug report, a feature request, or an open-ended discussion :D

    You say you read some old threads on this subject. What did the developer have to say about this?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Run the below command on the client machine and let us know what the output is:

    showmount -e <omv_server_hostname_or_ip>


    PS. Remember that for NFS4 you skip "export" bit when mounting, so something which looked like this in NFS3: "/export/my_disk" will become "/my_disk" in NFS4.

    I have since reverted back to my original config to get things working, and created a second share with a second subnet to test that out. I'll see if I can configure a single share with the dual subnets and post.


    Interestingly when I went to undo the changes I had originally made (adding two subnets to all shares) the config update error'd out if I made changes to one share at a time. It only succeeded when I removed all dual subnet entries from all shares...


    As we can see from below, the problem is now obvious - the multiple subnet entry is composed incorrectly on the server-side export. I believe it should look like this if well formed:

    Code
    /export/Data 192.168.1.0/24 (fsid=a60cc014-9d8a-43ec-8a86-3012bd263d93,rw,subtree_check,insecure) 192.168.4.0/24 (fsid=a60cc014-9d8a-43ec-8a86-3012bd263d93,rw,subtree_check,insecure)


    Client-side

    Code
    showmount -e 192.168.1.2
    
    Export list for 192.168.1.2:
    /export               192.168.4.0/24,192.168.1.0/24
    /export/Music         192.168.4.0/24,192.168.1.0/24
    /export/Data          192.168.4.0/24,192.168.1.0/24


    Server-side exports

    Code
    /export/Data 192.168.1.0/24 192.168.4.0/24(fsid=a60cc014-9d8a-43ec-8a86-3012bd263d93,rw,subtree_check,insecure)

    [Edit] Updated with output from request.

  • You say you read some old threads on this subject. What did the developer have to say about this?

    Not sure if the developer made any comments - will have to take another look. The summary of those threads was per OP which is "create multiple shares for multiple client address requirements"

  • I am fairly certain he said something like that.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!