Error: mount.nfs: Operation not permitted (rc=32) when mounting NFS v3 storage in VKS/TKG environments using NSX VPC NAT
search cancel

Error: mount.nfs: Operation not permitted (rc=32) when mounting NFS v3 storage in VKS/TKG environments using NSX VPC NAT

book

Article ID: 330397

calendar_today

Updated On:

Products

VMware NSX VMware vSphere ESXi

Issue/Introduction

When attempting to mount a Persistent Volume (PV) or Virtual Machine (VM) backed by an NSX VPC or L2 Segment to an NFS v3 shared storage solution (e.g., HP Alletra), the mount fails. The following error is observed in Kubernetes events or system logs: 
 
mount failed with rc=32 err=mount.nfs: Operation not permitted mount.nfs: access denied by server while mounting :/file-path-of-share

Environment

  • VMware Cloud Foundation (VCF) 9.x
  • VMware vSphere Kubernetes Service (VKS)
  • NSX

Cause

NFS v3 requires a TCP source port in the privileged range (1-1024) for the initial mount request. By default, NSX Gateways (Tier-0 or Tier-1) performing Source NAT (SNAT) create stateful sessions that translate the source port to an unprivileged range (20,000–65,000). The storage array identifies these unprivileged ports as "insecure" and rejects the connection.

Resolution

Choose one of the following methods to resolve the mount failure:

  1. Configure Reflexive NAT: Replace the stateful SNAT rule with a Reflexive NAT (stateless) rule on the NSX VPC or Tier-1 Gateway. Reflexive NAT preserves the original privileged source port during address translation.
      1. Log in to the NSX Manager UI as an administrator. Navigate to Networking > Network Services > NAT.
      2. Locate the existing SNAT rule being used for the Kubernetes worker nodes/egress traffic.
      3. Edit the rule or create a new one.
      4. In the rule configuration, change the Action (or NAT Type) from SNAT to Reflexive NAT.
      5. Save and apply the rule.

Reference: https://knowledge.broadcom.com/external/article/373284

  1. Modify Storage Permissions: Configure the NFS export on the storage array (e.g., HP Alletra) to permit "insecure" ports (source ports > 1024). This is typically done by adding the insecure flag to the export options for the specific NAT IP addresses.
      1. Access the management interface of your NFS storage array.
      2. Navigate to the configuration/settings for the specific NFS Export/Share.
      3. Locate the export options (sometimes called export policies or security settings).
      4. Add the insecure flag to the export options for the specific NAT IP address or subnet used by the Kubernetes cluster.
        • Example export option string: rw,sync,no_root_squash,insecure

Additional Information

If the above troubleshooting doesn't resolve the issue, perform the below troubleshooting steps in order to understand where the issue is happening from:

1. Test Network Reachability (Port Check) Confirm if the NFS server is reachable on the required ports (2049 for NFS, 111 for rpcbind/mountd). Test TCP connectivity:

nc -vz <NFS_SERVER_IP> 2049
nc -vz <NFS_SERVER_IP> 111
  • Failure: Indicates a network/firewall issue blocking basic communication.

  • Success: The network path is open, but the application/protocol layer may still be failing due to port translation or export permissions.

2. Verify NFS Exports Use the showmount command to verify if the NFS server recognizes the worker node and is exporting the intended path.

showmount -e <NFS_SERVER_IP>
  • Expected output: A list of available exports.

  • Failure (Timeout or "Access Denied"): The NFS server is likely configured to reject the worker node's IP or the NAT-translated IP.

3. Perform a Manual Mount (Capture Detailed Error) Attempt to mount the share manually using the same options the Kubernetes node uses to surface specific error messages.

mount -t nfs -o vers=3,hard <NFS_SERVER_IP>:/<EXPORT_PATH> /mnt

(Replace vers=3 with vers=4 if using NFS v4).

Monitor System Logs: Run tail -f /var/log/messages (or journalctl -f) on the worker node while running the mount command above.

  • mount.nfs: Operation not permitted (rc=32): Confirms the "insecure port" translation issue.

  • Access Denied: Confirms the server is rejecting the specific IP address.

4. Check for NAT Interference (Diagnostic) If NAT/port translation is suspected, execute a packet capture from the underlying node to observe traffic leaving the node.

tcpdump -i any host <NFS_SERVER_IP> and port 2049
  • If outgoing traffic is present but receives no response, or if the NFS server logs indicate the connection originates from an unexpected random high port, this confirms that SNAT/Port Address Translation is altering the traffic.