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

Possible Duplicate:
Running NFS with iptables, change firewall?

I need to allow a client to connect to a nfs server. If I disable iptables then NFS works great.

I understand that when NFS starts it'll fire up RPCNFSDCOUNT (/etc/default/nfs-kernel-server) processes that all are running on a different port.

How do I specify what ports those are so that they always fire up on the same port?

Presumably I need to open up 111 for UDP and TCP traffic. What about the NFS ports? 2049? UDP/TCP? The other ports?

Ubuntu-specific answers would be appreciated.

share|improve this question

marked as duplicate by mailq, Iain, MadHatter, MDMarra, voretaq7 Nov 21 '11 at 16:02

This question was marked as an exact duplicate of an existing question.

If you using just TCP with NFS4, ports 111 and 2049 will do. If you are planning to have NFS3 and below for compatibility reasons, you need to open ports for within the following:


However, you will need to explicitly set static ports for those domains, otherwise they will use random ports by default, which will cause issues for NFSv2/3 clients. Here is a link for specifying the ports on Ubuntu:

(For some reason, it is harder to do on Ubuntu than on Red Hat, as most of the links I found are for Red Hat. If I find something better, I'll post an update)

EDIT: Here is a better one - this is from Debian, which Ubuntu is based on:

Also, in that article, go to this link:

share|improve this answer
I would use NFS4, but I'm on the latest ubuntu server and $ nfsstat is showing v3. – crankharder Sep 19 '11 at 23:27
Then you definitely need to explicitly set ports for the above daemons. – Rilindo Sep 19 '11 at 23:35

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