Sample Header Ad - 728x90

Unable to mount nfs share when dns returns ipv6 link-local address?

2 votes
0 answers
534 views
On my Debian box I am unable to mount an nfs share on my NAS. The local DNS server returns a link-local address for the NAS (because I have set it that way to prevent doing any configuration changes later when for instance my IPv6 prefix changes.)
# mount -t nfs -v nas:/volume2/nfs-share /mnt/nfs-share
mount.nfs: trying text-based options 'vers=4.2,addr=fe80::211:32ff:fec9:627a,clientaddr=::'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=fe80::211:32ff:fec9:627a,clientaddr=::'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'vers=4,addr=fe80::211:32ff:fec9:627a,clientaddr=::'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'addr=fe80::211:32ff:fec9:627a'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Remote system error - Invalid argument
mount.nfs: an incorrect mount option was specified
ping -6 works:
#ping -6 nas
PING nas(nas.localdomain.net (fe80::211:32ff:fec9:627a)) 56 data bytes
64 bytes from nas.localdomain.net (fe80::211:32ff:fec9:627a%ens3): icmp_seq=1 ttl=64 time=0.157 ms
So: DNS returns fe80::211:32ff:fec9:627a for host 'nas'. mount fails because the link-local address inputted in mount needs an interface identifier. This works:
# mount -t nfs -v [fe80::211:32ff:fec9:627a%ens3]:/volume2/nfs-share /mnt/nfs-share
mount.nfs: timeout set for Fri Jul  1 11:38:47 2022
mount.nfs: trying text-based options 'vers=4.2,addr=fe80::211:32ff:fec9:627a%ens3,clientaddr=fe80::1337'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=fe80::211:32ff:fec9:627a%ens3,clientaddr=fe80::1337'
When I let DNS return the global IPv6 address for the nfs-share, it also mounts uneventfully. But I don't want to have any global IPv6 addresses in configuration files that might all be changed later when my ISP changes my IPv6 prefix. Same for rpcinfo:
# rpcinfo -p nas
nas: RPC: Remote system error - Invalid argument
# rpcinfo -p fe80::211:32ff:fec9:627a
fe80::211:32ff:fec9:627a: RPC: Remote system error - Invalid argument
# rpcinfo -p fe80::211:32ff:fec9:627a%ens3
   program vers proto   port  service
[...]
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
[...]
Obviously, I cannot set an interface identifier in DNS for the link-local address. -> Question: how can I make mount add the interface identifier ('%ens3') to the address for the nfs-share host?? [edit] Thank you A.B.! - The answer is to let the dhcp server give out ULA addresses to the hosts. In addition to any GUA addresses and link-local addresses. It's all very clear to me now and mount (a.o.) works fine also.
Asked by AlteKiet (21 rep)
Jul 1, 2022, 10:30 AM
Last activity: Jul 2, 2022, 08:08 PM