NFS Service Configuration Fixed port

Source: Internet
Author: User

#Linux NFS Service Fixed port and firewall configuration #

1. Install the NFS service normally on Linux

2. Modify the/etc/service to add the following (the port number must be below 1024 and is not occupied)
# Local Services
Mountd 1011/tcp #rpc. Mountd
Mountd 1011/udp #rpc. Mountd
Rquotad 1012/tcp #rpc. Rquotad
Rquotad 1012/udp #rpc. Rquotad

3. Restart NFS Service
Service NFS Restart
Chkconfig NFS On

4. Now that the RPC-related port is fixed, you can add a firewall rule
#portmap
/sbin/iptables-a input-s 192.168.1.0/24-p TCP--dport 111-j ACCEPT
/sbin/iptables-a input-s 192.168.1.0/24-p UDP--dport 111-j ACCEPT
#nfsd
/sbin/iptables-a input-s 192.168.1.0/24-p TCP--dport 2049-j ACCEPT
/sbin/iptables-a input-s 192.168.1.0/24-p UDP--dport 2049-j ACCEPT
#mountd
/sbin/iptables-a input-s 192.168.1.0/24-p TCP--dport 1011-j ACCEPT
/sbin/iptables-a input-s 192.168.1.0/24-p UDP--dport 1011-j ACCEPT
#rquotad
/sbin/iptables-a input-s 192.168.1.0/24-p TCP--dport 1012-j ACCEPT
/sbin/iptables-a input-s 192.168.1.0/24-p UDP--dport 1012-j ACCEPT
#rpc. statd
/sbin/iptables-a input-s 192.168.1.0/24-p TCP--dport 32768-j ACCEPT
/sbin/iptables-a input-s 192.168.1.0/24-p UDP--dport 32768-j ACCEPT


[Email protected] iosupload]# Cat/etc/exports
/wqdata 22.10.9.3 (rw,sync,no_root_squash,anonuid=0,anongid=0)

[Email protected] nfs84]# mount-t NFS 22.10.9.4:/wqdata//mnt/nfs84/

NFS Service Configuration Fixed port

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.