NAS NFS mount for particular host

Kernels & Hardware, configuring network, installing services

NAS NFS mount for particular host

Postby trefin56 » 2021-01-01 13:52

Hi there,

I am trying to mount my synology NAS with NFS on my debian 10 buster newly installed computer.
I managed to do so BUT only if I allow any host in Synology i.e. use wildcard '*' as hostname in synology DSM file access permission instead of "MyDESKTOP" as I would like to.

The synology and debian destop computers are on the local area network with router and gateway in between.

I use the following command from shell on MyDESKTOP computer:

Code: Select all
 sudo mount MyNAS.local:/volume1/homes /mnt/MyNAS


or following line in /etc/fstab of MyDESKTOP:

Code: Select all
 MyNAS.local:/volume1/homes /mnt/MyNAS/   nfs      defaults    0       0


When host name is "MyDESKTOP" I get the following error message

Code: Select all
mount.nfs: access denied by server while mounting MyNAS.local:/volume1/homes


When hostname is "*" it works.

As a consequence I also tried the verbose option of mount on MyDESKTOP computer:
Code: Select all
 sudo mount -v MyNAS.local:/volume1/homes /mnt/MyNAS


The feedback is :

Code: Select all
mount.nfs: timeout set for Fri Jan  1 14:20:53 2021
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.0.66,clientaddr=192.168.0.71'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.1,addr=192.168.0.66,clientaddr=192.168.0.71'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'addr=192.168.0.66'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.0.66 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.0.66 prog 100005 vers 3 prot UDP port 892
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting MyNAS.local:/volume1/homes


Consequently I tried defining the hostname with IP adress on the synology NAS and it works. Therefore it seems that the issue is name resolving on the synology.
I have the same behaviour on an ubuntu 20.04 LTS computer.

The question is:
- did any body managed to mount on linux debian or ubuntu Synology NAS by NFS using something else than wildcard '*' as hostname?
- does any body knows ways to achieve this?
My goal is to :
- allow only some hosts not any hosts to access the synology
- use names and not static or dynamic IP adresses.

I am aware that it is more a synology than debian issue but I am sure there are plenty of knowledeable people here and I could not find an answer on the WWW!
trefin56
 
Posts: 4
Joined: 2021-01-01 11:12

Re: NAS NFS mount for particular host

Postby sgosnell » 2021-01-01 14:28

You allow or deny clients in /etc/hosts on the server. You can specify specific clients, or you can allow any clients on the network.
Take my advice, I'm not using it.
sgosnell
 
Posts: 974
Joined: 2011-03-14 01:49

Re: NAS NFS mount for particular host

Postby trefin56 » 2021-01-01 16:16

Hi there,

Synology server configuration is from DSM gui.
Nevertheless, I connected with ssh to synology and checked the nfs configuration files

/etc/hosts.deny is empty
/etc/hosts looks like correct
/etc/exports looks like correct (i.e. consistent with the configuration done in the GUI)

I really think that the server is not able to resolve the numeric IP address corresponding to the host name and I don't know how to configure it to be able to do it.

Ping is not installed on synology but when I do:
Code: Select all
 traceroute 192.168.0.15
if works
Code: Select all
 traceroute MyLAPTOP
it fails whereas 192.168.0.15 is the IP adress of MyLAPTOP on my network.
trefin56
 
Posts: 4
Joined: 2021-01-01 11:12

Re: NAS NFS mount for particular host

Postby sgosnell » 2021-01-02 04:15

Sorry, I had a brain glitch. The correct file is /etc/exports, not hosts. If you use something like 192.168.1.0/24 you will allow everybody on the network to connect. If you just specify individual IP addresses, like 192.168.1.100, only those will be allowed to connect. Something like this:
Code: Select all
/volume1/homes   192.168.1.100(rw,sync,no_subtree_check)
It's also possible to do it through kerberos. Examples are in the template exports file. You would need to do some reading in that, I don't use kerberos.
I do the mounting in fstab on all my clients, so I don't have to bother with manually mounting.
Take my advice, I'm not using it.
sgosnell
 
Posts: 974
Joined: 2011-03-14 01:49

Re: NAS NFS mount for particular host

Postby trefin56 » 2021-01-04 21:16

Oui, cela fonctionne parfaitement avec l’adresse IP de la machine client :D
c’est avec le nom de la machine que cela ne fonctionne pas. :(
Je n’arrive pas a faire résoudre le nom de la machine client automatiquement par le NAS pourtant le serveur DNS local est bien déclaré comme étant le freebox server et fonctionne pour les autres machines linux installees sur le reseau. :oops:

Glurps, i realise that i have written in French.

yes’ it works perfectly fine with the IP adress of the client machine.
Its with the name of the client machine that it does not work.
I do not manage to resolve the client machine name automatically on the NAS although the NAS is correctly configued to point to the local network DNS server, the freebox server.This is working well on the otherblinux machines installed on the local network.
trefin56
 
Posts: 4
Joined: 2021-01-01 11:12

Re: NAS NFS mount for particular host

Postby sgosnell » 2021-01-05 21:27

The client is the computer which is trying to mount the NAS, just to be clear. If I understand correctly, other computers on the network can mount the NAS machine using the hostname, but you have one computer which will not? That seems strange to me. I would suspect it has something to do with the network configuration on that computer, but I know nothing about what is on it. I really don't know much about NAS machines, I just use my desktop as the NFS server, with attached USB drives.
Take my advice, I'm not using it.
sgosnell
 
Posts: 974
Joined: 2011-03-14 01:49

Re: NAS NFS mount for particular host

Postby trefin56 » 2021-01-05 21:52

No all computers on the network can mount the NAS shared if and only if:
- all hosts are allowed on the server using wildcard ’*’ has allowed host name
OR
- A particular IP adress is entered on the server as allowed name
BUT i would like to allow hostname to avoid having to configure the DHCP server with static IP adress loan.

Other linux computers on the network can resolve name, the NAS who is linux also cannot.
trefin56
 
Posts: 4
Joined: 2021-01-01 11:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 16 guests

fashionable