So I've been trying to get my head around how an NFS client figures out which ports to use, or how to set them.
I enabled logging (In iptables on the nfs client) for traffic between the nfs client and server, and found this (I've numbered them so I can reference them for you):
1. [iptables nfs-tcp-out] ... SPT=949 DPT=2049 ...
2. [iptables nfs-tcp-in ] ... SPT=2049 DPT=949 ...
3. [iptables nfs-tcp-out] ... SPT=35501 DPT=877 ...
So,
I am happy with, random port to nfs port
Also, happy with that, reply from nfs to established random port
This is where I get confused. They seem to be 2 random ports. Are both of these set on the nfs-server? If so, how does the client know which ports to use? Is this negotiated with the first 2 packets?
Also, I have set the rpc.statd ports as --port 32765 --outgoing-port 32766
, yet see no traffic on those ports.
Lastly, I see no traffic on port 111, which apparently needs to be open (According to almost every nfs firewall guide)
Sorry I misunderstood. Think I got it nowPort 111 (tcp/udp) is the portmapper
Port 2049 (tcp/udp) is the nfs-server
If you would like to assign client ports you can do so in
As an example:
Is this what your looking for?