Skip to main content

Modify ports used for NFSv3 services

Contributors netapp-thomi

The NFS server on the storage system uses services such as mount daemon and Network Lock Manager to communicate with NFS clients over specific default network ports. In most NFS environments the default ports work correctly and do not require modification, but if you want to use different NFS network ports in your NFSv3 environment, you can do so.

What you'll need

Changing NFS ports on the storage system requires that all NFS clients reconnect to the system, so you should communicate this information to your users in advance of making the change.

About this task

You can set the ports used by the NFS mount daemon, Network Lock Manager, Network Status Monitor, and NFS quota daemon services for each storage virtual machine (SVM). The port number change affects NFS clients accessing data over both TCP and UDP.

Ports for NFSv4 and NFSv4.1 cannot be changed.

Steps
  1. Set the privilege level to advanced:

    set -privilege advanced

  2. Disable access to NFS:

    vserver nfs modify -vserver vserver_name -access false

  3. Set the NFS port for the specific NFS service:

    vserver nfs modify -vserver vserver_namenfs_port_parameterport_number

    NFS port parameter Description Default port

    -mountd-port

    NFS mount daemon

    635

    -nlm-port

    Network Lock Manager

    4045

    -nsm-port

    Network Status Monitor

    4046

    -rquotad-port

    NFS quota daemon

    4049

    Besides the default port, the allowed range of port numbers is 1024 through 65535. Each NFS service must use a unique port.

  4. Enable access to NFS:

    vserver nfs modify -vserver vserver_name -access true

  5. Use the network connections listening show command to verify the port number changes.

  6. Return to the admin privilege level:

    set -privilege admin

Example

The following commands set the NFS Mount Daemon port to 1113 on the SVM named vs1:

vs1::> set -privilege advanced
Warning: These advanced commands are potentially dangerous; use
         them only when directed to do so by NetApp personnel.
Do you want to continue? {y|n}: y

vs1::*> vserver nfs modify -vserver vs1 -access false

vs1::*> vserver nfs modify -vserver vs1 -mountd-port 1113

vs1::*> vserver nfs modify -vserver vs1 -access true

vs1::*> network connections listening show
Vserver Name     Interface Name:Local Port        Protocol/Service
---------------- -------------------------------  ----------------
Node: cluster1-01
Cluster          cluster1-01_clus_1:7700          TCP/ctlopcp
vs1              data1:4046                       TCP/sm
vs1              data1:4046                       UDP/sm
vs1              data1:4045                       TCP/nlm-v4
vs1              data1:4045                       UDP/nlm-v4
vs1              data1:1113                       TCP/mount
vs1              data1:1113                       UDP/mount
...
vs1::*> set -privilege admin