I need to use port 2049/tcp for another purpose. Is there a way to change which port NFSD binds to? I don't need NFSv3 or NFSv2 so I am not using rpcbind service. I cannot find that config option...
Asked
Active
Viewed 2,647 times
1 Answers
1
If you are using just NFSv4 (no RPCBIND) you can change the port by adding -p [port number]
to /etc/sysconfig/nfs RPCNFSDARGS and make sure it is uncommented.
I found this out by looking at /etc/init.d/nfs
, I found this line:
echo -n $"Starting NFS daemon: "
daemon rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT
I traced the definition of $RPCNFSDARGS
back up to the top of the file, and saw /etc/sysconfig/nfs was loaded in. man rpc.nfsd
revealed the -p option to specify the port.
My /etc/sysconfig/nfs now has the line:
RPCNFSDARGS="-p 2050 -N 2 -N 3"

four43
- 2,765
- 2
- 16
- 17