2

my Laptop has several IPv6-Addresses. My NAS accepts only one specific of these to mount a NAS-folder with NFS.

I mount the NAS share with

sudo mount [fd80:foo::bar]:/Media /mnt/NASshare

But with that, chance is high that my Laptop uses one of its IPv6-addresses, which is not allowed by NAS.

My question is: How can I specify an IPv6-adress while mounting my NAS share?

0

1 Answer 1

6

From NFS(5) nfs - fstab format and options for the nfs file systems:

   clientaddr=n.n.n.n

   clientaddr=n:n:...:n
                  Specifies a single IPv4 address (in  dotted-quad  form),
                  or  a  non-link-local  IPv6 address, that the NFS client
                  advertises to allow servers to  perform  NFS  version  4
                  callback  requests against files on this mount point. If
                  the  server is unable to establish callback  connections
                  to  clients,  performance  may  degrade,  or accesses to
                  files may temporarily hang.

                  If this option is not specified,  the  mount(8)  command
                  attempts  to  discover  an  appropriate callback address
                  automatically.  The automatic discovery process  is  not
                  perfect,  however.   In  the presence of multiple client
                  network interfaces, special routing policies, or  atypi-
                  cal  network  topologies,  the  exact address to use for
                  callbacks may be nontrivial to determine.

Which would suggest adding this to /etc/fstab (with fd80:c0f::fee as the IP address desired):

fd80:foo::bar:/Media    /mnt/NASshare    nfs    rw,clientaddr=fd80:c0f::fee 0 0

But as mentioned, this automatic discovery process is not perfect.

It might be that you need to add specific route to your NAS.

Or if it is possible to use ip netns namespaces, then you could:

  1. Create a namespace: ip netns add NASNamespace.
  2. Link it to the interface: ip link set eth0 netns NASNamespace
  3. Configure an IP for it: ip netns exec NASNamespace ifconfig eth0 fd80:c0f::fee/64 up
  4. Force mount to run inside the namespace: ip netns exec NASNamespace mount
1
  • how to make this work on boot and a fstab mounted nfs?
    – brauliobo
    Aug 28, 2021 at 3:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .