1

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,

  1. I am happy with, random port to nfs port

  2. Also, happy with that, reply from nfs to established random port

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

0

Sorry I misunderstood. Think I got it now

Port 111 (tcp/udp) is the portmapper

Port 2049 (tcp/udp) is the nfs-server

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.

If you would like to assign client ports you can do so in

 /etc/sysconfig/nfs

As an example:

 LOCKD_TCPPORT=32803 
 LOCKD_UDPPORT=32769                  
 MOUNTD_PORT=892 
 RQUOTAD_PORT=875 
 STATD_PORT=662
 STATD_OUTGOING_PORT=2020

Is this what your looking for?

  • I'm using ubuntu 14.04 which doesn't have the /etc/sysconfig/ directory. I think that is how to configure it on a Red Hat nfs server. But, unfortunately it still doesn't answer the original question as to how the client knows which ports to use described in the log output number 3. – Just Lucky Really Jan 28 '15 at 18:20
  • At this point I will bail out. I had it setup on Raspbian, but I had to do a reinstall, so I don't have access to see the setup configs. Sorry to waste your time. – geoffmcc Jan 28 '15 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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