Linux nfs port command

Source: Internet
Author: User

In Linux, we often encounter NFS settings. In this regard, we will mainly introduce the port configuration of Linux NFS. See how to configure the firewall and port settings.

# Linux NFS service fixed port and firewall configuration #

1. Install NFS on LINUX

2. Modify/etc/service and add the following content. The port number must be less than 1024 and is not in use)

 
 
  1. # Local services  
  2. mountd 1011/tcp #rpc.mountd  
  3. mountd 1011/udp #rpc.mountd  
  4. rquotad 1012/tcp #rpc.rquotad  
  5. rquotad 1012/udp #rpc.rquotad 

3. Restart the Linux NFS service

 
 
  1. service nfs restart  
  2. chkconfig nfs on 

4. Now the rpc-related port has been fixed. You can add firewall rules for Linux NFS.

 
 
  1. #portmap  
  2. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 111 -j ACCEPT  
  3. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 111 -j ACCEPT  
  4. #nfsd  
  5. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 2049 -j ACCEPT  
  6. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 2049 -j ACCEPT  
  7. #mountd  
  8. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 1011 -j ACCEPT  
  9. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 1011 -j ACCEPT  
  10. #rquotad  
  11. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 1012 -j ACCEPT  
  12. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 1012 -j ACCEPT  
  13. #rpc.statd  
  14. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 32768 -j ACCEPT  
  15. /sbin/iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 32768 -j ACCEPT 

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.