Setting NFS Ports

If the applications you plan to use with the mounted Cloud Filestore fileshare require NFS file locking, and your Cloud Filestore instances are using something other than the default VPC network with unchanged settings, you might need to set the ports for the statd and nlockmgr daemons on your client VM instances in order to make firewall configuration easier. For more information on determining if you need to configure a firewall rule for the VPC network, see Configuring Firewall Rules.

If you do need to configure firewall rules, or think you might need to at any point, we strongly recommend setting the statd and nlockmgr ports so that they are consistent on all client VM instances.

Checking port settings

Run the following commands on the client VM instance to see how the statd and nlockmgr ports are currently set. If the files don't exist, or if the options don't have values, then the ports aren't set. In that case, the daemons are dynamically assigned arbitrary available ports.

Debian/Ubuntu

  1. Run the following command and look at the STATDOPTS value to determine the statd port:

    cat /etc/default/nfs-common
  2. Run the following command and look at the nlm_tcpport and nlm_udpport values to determine the nlockmgr port:

    cat /etc/modprobe.d/lock.conf

RHEL/CentOS

  1. Run the following command and look at the STATD_PORT value to determine the statd port:

    cat /etc/sysconfig/nfs
  2. Run the following command and look at the nlm_tcpport and nlm_udpport values to determine the nlockmgr port:

    cat /etc/modprobe.d/lock.conf

SUSE

Run the following command and look at the STATD_PORT value to determine the statd port and the LOCKD_TCPPORT and LOCKD_UDPPORT values to determine the nlockmgr port:

cat /etc/sysconfig/nfs

Setting ports

Run the following commands on the client VM instance to set the statd and nlockmgr ports. These examples use the vim text editor, but you can use any text editor. These examples also use 2046 as the port for statd and 4045 as the port for nlockmgr because these are common choices, but you can use different ports if they are appropriate for your network configuration.

Debian/Ubuntu

  • Set the statd port:

    1. Open the /etc/default/nfs-common file for editing:

      sudo vim /etc/default/nfs-common
    2. Set the STATDOPTS option:

      STATDOPTS="-p 2046"
    3. Save the file and exit.
  • Set the nlockmgr port:

    1. Create the /etc/modprobe.d/lock.conf file:

      sudo vim /etc/modprobe.d/lock.conf
    2. Set the nlm_tcpport and nlm_udpport options:

      options lockd nlm_tcpport=4045
      options lockd nlm_udpport=4045
    3. Save the file and exit.

RHEL/CentOS

  • Set the statd port:

    1. Open the /etc/sysconfig/nfs file for editing:

      sudo vim /etc/sysconfig/nfs
    2. Set the STATD_PORT option:

      STATD_PORT=2046
    3. Save the file and exit.
  • Set the nlockmgr port:

    1. Create the /etc/modprobe.d/lock.conf file:

      sudo vim /etc/modprobe.d/lock.conf
    2. Set the nlm_tcpport and nlm_udpport options:

      options lockd nlm_tcpport=4045
      options lockd nlm_udpport=4045
    3. Save the file and exit.

SUSE

Set the statd and nlockmgr ports:

  1. Open the /etc/sysconfig/nfs file for editing:

    sudo vim /etc/sysconfig/nfs
  2. Set the STATD_PORT, LOCKD_TCPPORT, and LOCKD_UDPPORT options:

    STATD_PORT=2046
    LOCKD_TCPPORT=4045
    LOCKD_UDPPORT=4045
  3. Save the file and exit.
Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Filestore Documentation