[Bug 1971096] Re: Cannot Specify Fixed Ports for mountd and statd

Granville Xiong 1971096 at bugs.launchpad.net
Tue May 3 18:28:02 UTC 2022


Thanks a lot for the updates! With the information provided, I updated
the configuration settings in /etc/nfs.conf and /etc/nfs.conf.d and then
NFS server works as expected. And yes it's a good idea to put some notes
in the obsolete configuration files, so that users can be instructed for
the changes in the new release.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to nfs-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1971096

Title:
  Cannot Specify Fixed Ports for mountd and statd

Status in nfs-utils package in Ubuntu:
  Invalid

Bug description:
  === Release Version ===

  Ubuntu 22.04

  
  === Package Version ===

  nfs-utils 1:2.6.1-1ubuntu1

  
  === Custom Settings ===

  In order to use NFSv3 client (e.g. on Windows 10) to mount the
  directories exported by the NFS server behind a firewall, I need to
  specify fixed ports to be used by /usr/sbin/rpc.mountd and
  /usr/sbin/rpc.statd. This was done by the following steps:

  In /etc/default/nfs-kernel-server:
  RPCMOUNTDOPTS="--manage-gids --port 32767"
  RPCNFSDOPTS="--nfs-version 3,4"

  In /etc/default/nfs-common:
  STATDOPTS="--port 32766 --outgoing-port 32765"

  Then I restarted NFS server:
  systemctl restart nfs-kernel-server

  
  === Expected Results ===

  The output of "rpcinfo -p" should show something similar to the
  following messages:

     program vers proto   port  service
      100000    4   tcp    111  portmapper
      100000    3   tcp    111  portmapper
      100000    2   tcp    111  portmapper
      100000    4   udp    111  portmapper
      100000    3   udp    111  portmapper
      100000    2   udp    111  portmapper
      100005    1   udp  32767  mountd
      100005    1   tcp  32767  mountd
      100005    2   udp  32767  mountd
      100005    2   tcp  32767  mountd
      100005    3   udp  32767  mountd
      100005    3   tcp  32767  mountd
      100024    1   udp  32766  status
      100024    1   tcp  32766  status
      100003    3   tcp   2049  nfs
      100003    4   tcp   2049  nfs
      100227    3   tcp   2049
      100003    3   udp   2049  nfs
      100227    3   udp   2049
      100021    1   udp  32768  nlockmgr
      100021    3   udp  32768  nlockmgr
      100021    4   udp  32768  nlockmgr
      100021    1   tcp  32768  nlockmgr
      100021    3   tcp  32768  nlockmgr
      100021    4   tcp  32768  nlockmgr
      150001    1   udp    835  pcnfsd
      150001    2   udp    835  pcnfsd
      150001    1   tcp    836  pcnfsd
      150001    2   tcp    836  pcnfsd

  Above messages are the output of the NFS server on Ubuntu 20.04 which
  shows the desired ports are used to mountd and statd daemons.

  
  Actual results:

  However, the actual output of "rpcinfo -p" on Ubuntu 22.04 shows the
  following:

     program vers proto   port  service
      100000    4   tcp    111  portmapper
      100000    3   tcp    111  portmapper
      100000    2   tcp    111  portmapper
      100000    4   udp    111  portmapper
      100000    3   udp    111  portmapper
      100000    2   udp    111  portmapper
      100024    1   udp  33937  status
      100024    1   tcp  60673  status
      100005    1   udp  43042  mountd
      100005    1   tcp  60125  mountd
      100005    2   udp  48157  mountd
      100005    2   tcp  39195  mountd
      100005    3   udp  50182  mountd
      100005    3   tcp  57251  mountd
      100003    3   tcp   2049  nfs
      100003    4   tcp   2049  nfs
      100227    3   tcp   2049
      100021    1   udp  32768  nlockmgr
      100021    3   udp  32768  nlockmgr
      100021    4   udp  32768  nlockmgr
      100021    1   tcp  32768  nlockmgr
      100021    3   tcp  32768  nlockmgr
      100021    4   tcp  32768  nlockmgr

  Obvisouly, the ports used by mountd and statd are different from the
  specified values. Moreover, after each restart, the ports numbers also
  change. This means that random ports are assigned.

  
  === Possible Causes ===

  I checked out the systemd configuration files in use and found the
  following clues:

  /lib/systemd/system/nfs-kernel-server.service:
  In 20.04: ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
  In 22.04: ExecStart=/usr/sbin/rpc.nfsd

  /lib/systemd/system/nfs-mountd.service:
  In 20.04: ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
  In 22.04: ExecStart=/usr/sbin/rpc.mountd

  /lib/systemd/system/nfs-kernel-server.service:
  In 20.04: ExecStart=/sbin/rpc.statd --no-notify $STATDARGS
  In 22.04: ExecStart=/sbin/rpc.statd

  So, I think above differences could possibly explain why fixed ports
  can be specified for the NFS server in 20.04 but not in 22.04.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971096/+subscriptions




More information about the foundations-bugs mailing list