Wow ok this is different but cool none the less and this might even be a little mini howto for people with the same issue that are seeking an answer!
Basically, although NFS v.3 has been used by default Solaris 11 and 11+ uses NFS v.4 so lets stick with that since in our KUbuntu Linux server is native to NFS v.4 to as part of the kernel support, although backwards compatible with NFS v.3 somehow there seems to be a conflict somewhere!
Well we will start up by creating /etc/exports on the Linux server:
we can use any mount point we desire so lets just for a moment assume that we will export a dir called /export/users.
Create the dir like so mkdir -p /export/users
then we will add this to the /etc/exports file.
Code:
/export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async)
/export/users 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
Although I haven't tested the syntax for the subnet in NFS v.4 certainly one can either put the subnet mask or CIDR notation for NFS v.3 (tested on KUbuntu 9.04 system based around Ubuntu Jaunty)
Once that is done we can proceed to tweaking our NFS v.4 security measures to off since we will not be using Kerberos.
This is done by editing the /etc/default/nfs-kernel-server and /etc/default/nfs-common files.
GSSD needs to be turned off in both and just to give an example of edits here are mine:
nfs-kernel-server
Code:
RPCNFSDCOUNT=8
# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0
# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS
RPCMOUNTDOPTS=--manage-gids
# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=no
# Options for rpc.svcgssd.
RPCSVCGSSDOPTS
nfs-common:
Code:
# If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are "yes" and "no".
# Do you want to start the statd daemon? It is not needed for NFSv4.
NEED_STATD=yes
# Options for rpc.statd.
# Should rpc.statd listen on a specific port? This is especially useful
# when you have a port-based firewall. To use a fixed port, set this
# this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
# For more information, see rpc.statd(8) or http://wiki.debian.org/?SecuringNFS
STATDOPTS=
# Do you want to start the idmapd daemon? It is only needed for NFSv4.
NEED_IDMAPD=no
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=no
We can now proceed onto setting up layer 3 security restrictions by editing /etc/hosts.allow and /etc/hosts.deny
In /etc/hosts.deny we want to use the syntax:
Code:
portmap mountd nfsd statd lockd rquotad : ALL
I usually put these in separately so that it creates a vertical line rather then horizontal each with an instance of ALL. But that's just a personal preference!
For hosts.allow we will add our local subnet or list of accessible IP addresses:
Code:
portmap mountd nfsd statd lockd rquotad : list of IP addresses
Again one is better off putting these in separately as each entity then can be tuned and tweaked as desired.
Once that is done we can proceed to exporting the filesystems with exportfs command: using exportfs -fs
then restart the portmap and kernel-server daemons:
Code:
#/etc/init.d/portmap restart
#/etc/init.d/nfs-kernel-server restart
Finally we can mount the NFS v.4 server in our Solaris client like so:
Code:
mount -F nfs -o rw ip_addr_of_server:/ /mount_point
Or add a static entry into /etc/vfstab then use only the: mount /mount_point command
and finally either cd or ls the mounted directory to check that all is well and mounted properly and that's it!
I hope this helps someone with the same or similar issue as I had!!
[edit]
P.s. if anyone wants any further reading on NFS for Ubuntu these are the sites I used:
https://help.ubuntu.com/community/SettingUpNFSHowTo
https://help.ubuntu.com/community/NFSv4Howto
Be warned though that these are for NFS v.4 and not v.3. With v.3 the syntax of /etc/exports and mounting procedure is slightly different!
Above in my previous post is a good example of v.3 for /etc/exports and bare in mind that you will need the vers=3 option either in mount command or /etc/vfstab entry when using Solaris!!