NFS port configuration

Source: Internet
Author: User

We have discussed a lot about NFS. I wonder if you have any questions. Today, we will mainly explain how to set NFS ports. In many network environments, different port settings may cause different functions. To use NFS in a firewall environment, open the following ports on the firewall:

 
 
  1. 1. portmap port 111 udp/tcp;
  2. 2. nfsd port 2049 udp/tcp;
  3. 3. mountd port "xxx" udp/tcp

When the system RPC service starts the nfs service, a random port 32768--65535 is dynamically selected for mountd by default. You can specify a fixed port for mountd by editing the/etc/services file:

 
 
  1. # vi /etc/services 

Add at the end

 
 
  1. mountd 1011/udp  
  2. mountd 1011/tcp 

Save this file

 
 
  1. # stopsrc -s rpc.mountd  
  2. # startsrc -s rpc.mountd  
  3. # exportfs -a  
  4. # rpcinfo -p Hostname 

Now we will find that mountd has been bound to port 1011.

In addition, the services that need to be communicated in nfs include rpc. lockd and rpc. statd. For lockd, we can use a similar method to specify a fixed port,

 
 
  1. # vi /etc/services 

Add

 
 
  1. lockd 35000/ucp  
  2. lockd 35000/tdp  
  3. # stopsrc -s rpc.lockd  
  4. # startsrc -s rpc.lockd  
  5. # exportfs -a 

Nfs client mount file system

 
 
  1. # rpcinfo -p Hostname 

However, rpc. statd cannot be used to specify a port. It can only use a random port. If necessary, open the random port based on the display of the following command on the firewall:

 
 
  1. # no -a |grep ephemeral  
  2. tcp_ephemeral_high = 65535 
  3. tcpp_ephemeral_low = 32768 
  4. udp_ephemeral_high = 65535 
  5. udp_ephemeral_low = 32768 

You can also disable rpc. the random port required by statd is affected by the failure of nfs connections, such as server or client). The system cannot restore the status before the disconnection through statd, the nfs file system must be mounted again.

For more information about statd functionality, see http://publib.boulder.ibm.com/infocenter/

Pseries/v5r3/topic/com. ibm. aix. cmds/doc/aixcmds5/statd.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.