0

NFS locking down ports for SLES

When you run NFS server it will pick random ports for mountd and nlockmgr which can change upon reboot causing nightmares when the nfs is going through a firewall.

You can lock these ports down so that its not random anymore

edit /etc/sysconfig/nfs and put in the following

STATD_PORT=4001
LOCKD_TCPPORT=4002
LOCKD_UDPPORT=4002
MOUNTD_PORT=4003

and restart the nfs services

now if you look at the port assignments via rpcinfo you will see that mountd and nlockmgr is locked into a specific port

# rpcinfo -p
program vers proto   port
100000    2   tcp    111  portmapper
100000    2   udp    111  portmapper
100003    2   udp   2049  nfs
100003    3   udp   2049  nfs
100003    4   udp   2049  nfs
100003    2   tcp   2049  nfs
100003    3   tcp   2049  nfs
100003    4   tcp   2049  nfs
100021    1   udp   4001  nlockmgr
100021    3   udp   4001  nlockmgr
100021    4   udp   4001  nlockmgr
100021    1   tcp   4002  nlockmgr
100021    3   tcp   4002  nlockmgr
100021    4   tcp   4002  nlockmgr
100005    1   udp   4003  mountd
100005    1   tcp   4003  mountd
100005    2   udp   4003  mountd
100005    2   tcp   4003  mountd
100005    3   udp   4003  mountd
100005    3   tcp   4003  mountd

jlim0930

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.