Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to force NFS to use a specific port I've opened on my firewall. It seems to randomly pick the UDP port, the TCP port is static. How do I lock in the UDP port so i'm not opening a range of ports?

mount /mnt/backup
mount: trying prog 100003 vers 3 prot tcp port 2049
mount: trying prog 100005 vers 3 prot udp port 57917

I see a lot of info on setting up NFS but cant seem to narrow in on how to force a specific port.

share|improve this question
up vote 1 down vote accepted

I found out where it was after some more digging. On ubuntu as the server (which is what I was using) it's in /etc/default/nfs-kernel-server and you have to set the RPCMOUNTDOPTS to include the port.

Ultimately I found it here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.