7

When specifying an NFS mountpoint in /etc/fstab, what's the purpose of the addr option? For example:

192.168.1.5:/home         /home                   nfs     rw,addr=192.168.1.5 0 0
Lorin Hochstein
  • 5,028
  • 15
  • 56
  • 72

4 Answers4

4

It can specify the client address to use when the client has multiple subnet IPs on an interface and traversing the same routes (think aliased eth0:1, bond0:2, etc.). Typically in this situation you'd put the NFS server on another interface/subnet to avoid the whole problem but in large network installations things can get messy.

2

addr is not the same as clientaddr. The addr option is what the NFS server /etc/exports explicitly specifies, e.g.

 /home 192.168.1.5 (rw)

instead of simply

 /home * (rw)

If the NFS server has multiple interfaces, you can designate a specific interface for the NFS traffic. Of course if you do leave it to the server to choose an interface (i.e. specify *), the server chooses one out of the available IPs and you see it in the client side `mount' command output.

(in response to troyengel's answer) The clientaddr mount option is for the server to callback the client for certain metadata, not data. I think this includes verifying whether the client is allowed to mount, etc.

addr is a server IP. clientaddr is a client IP.

473183469
  • 1,360
  • 1
  • 12
  • 23
yong321
  • 125
  • 3
0

Looking at the man page for mount (http://linux.die.net/man/8/mount). It appears as though that option is accepted but ignored. I could not find any other information on it.

einstiien
  • 2,568
  • 18
  • 18
  • I suspect it is to be used for multi-homed installations; so that you can specify which IP address local to the server to use as a source. E.g. run the NFS traffic over an internal network, rather than a public interface. – dezwart Apr 09 '10 at 03:40
0

I believe NFS uses it internally, you see it in /proc/mounts even when not specified.

LapTop006
  • 6,496
  • 20
  • 26