NFS Services Administrator's Guide (5900-1632, August 2011)
For example, to determine the port numbers, enter the following command:
rpcinfo -p
An output similar to the following output is displayed:
program vers proto port service
100024 1 udp 49157 status
100024 1 tcp 49152 status
100021 2 tcp 4045 nlockmgr
100021 3 udp 4045 nlockmgr
100005 3 udp 49417 mountd
100005 3 tcp 49259 mountd
100003 2 udp 2049 nfs
100003 3 tcp 2049 nfs
Each time the rpc.statd and rpc.mountd daemons are stopped and restarted they may be
assigned a different port from the anonymous port range. The firewall must be reconfigured each
time the NFS service is restarted.
For example, if the NFS service or the rpc.statd and rpc.mountd daemons are restarted, run
the rpcinfo -p command to view the new port numbers.
An output similar to the following output is displayed:
program vers proto port service
100024 1 tcp 49154 status
100024 1 udp 49161 status
100021 3 tcp 49156 nlockmgr
100021 3 udp 49163 nlockmgr
100005 3 udp 49181 mountd
100005 3 tcp 49181 mountd
100003 3 udp 2049 nfs
100003 3 tcp 2049 nfs
Configure the firewall based on the new port numbers.
Sharing directories across a firewall using fixed port numbers in the nfs file
Using the /etc/default/nfs file enables you to specify fixed port numbers for the rpc.statd
and rpc.mountd daemons. The rpc.lockd daemon runs at port 4045 and is not configurable.
To set the port numbers using the /etc/default/nfs file, follow these steps:
1. Assign values to the variables, STATD_PORT and MOUNT_PORT, as follows:
STATD_PORT = port_number
MOUNTD_PORT = port_number
Where:
port_number The port number on which the daemon runs. It can be set to any unique
value between 1024 and 65536.
STATD_PORT The port on which the rpc.statd daemon runs.
MOUNTD_PORT The port on which the rpc.mountd daemon runs.
2. Activate the changes made to the/etc/default/nfs file by restarting the lock manager
and NFS server daemons as follows:
/sbin/init.d/nfs.server stop
/sbin/init.d/lockmgr stop
/sbin/init.d/lockmgr start
/sbin/init.d/nfs.server start
3. Configure the firewall based on the port numbers configured.
Configuring and Administering an NFS Server 29