how to specify ipv6-address to use while mounting nfs
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:
- Create a namespace:
ip netns add NASNamespace
. - Link it to the interface:
ip link set eth0 netns NASNamespace
- Configure an IP for it:
ip netns exec NASNamespace ifconfig eth0 fd80:c0f::fee/64 up
- Force mount to run inside the namespace:
ip netns exec NASNamespace mount