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 ...
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)