06 December 2010

FreeBSD Issue with Solaris NFS Shares

In a past NAS migration attempt, it was discovered that FreeBSD boxes
don't necessarily play well with NFS mounts shared from Solaris boxes
when the mount IP is on a virtual interface.  The reason behind this
issue is that Solaris, in dealing with virtual interfaces, responds
to incoming requests using one configured IP address on the particular
physical interface.  FreeBSD, however, expects a response identified as
from the IP address to which the request was sent.  After looking through
the potential solutions to this issue, it was determined that a fix on the
Solaris side was not optimal because Solaris can only be set to respond
from the first (base) interface address configured or the last logical
interface address configured.  Given that this was a clustered solution
that was be going into place, this would not work as there would be no
guarantee of a particular logical interface on a box.  Also, this wouldn't
address FreeBSD's requirements for response.  To resolve the situation,
one must specify option 'noconn' to the NFS mount on the FreeBSD side,
which may be specified via the fstab as well as on the command line:
    /etc/fstab:
        7.7.6.50:/share/path /mount/path     nfs     rw,noconn       0 0

    cli:
        /sbin/mount -t nfs -o rw,noconn 7.7.6.50:/share/path /mount/path
In the above, 7.7.6.50 represents an IP address of a virtual interface
configured on the serving Solaris host.  The mount of the NFS share is
being initiated by a FreeBSD host.  For those curious, further details
dealing with (no)conn may be found in the man page for mount_nfs(8)
on a FreeBSD host.  As of yet, I've only found this to be relevant to
FreeBSD hosts.  Solaris and Linux hosts work fine, accepting Solaris'
IP response handling without issue.  Without the modifications, FreeBSD
attempts to mount NFS shares from a Solaris host will hang with RPC
timeouts.  Finally, FreeBSD boxes prior to 4.8 are incapable of this
work around though the man page alludes to otherwise.