This shows you the differences between two versions of the page.
nfs [2011/11/10 17:18] k2patel [Services] |
nfs [2020/08/10 02:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== NFS Server / Client ====== | ||
- | This is the notes from my setup. | ||
- | |||
- | ===== Server ===== | ||
- | |||
- | ==== Export ==== | ||
- | |||
- | I am setting up server for NFSv4 without Security IP based access list.\\ | ||
- | **NOTE :** Match your uid with anonuid | ||
- | |||
- | <code bash | /etc/exports> | ||
- | /home 192.168.1.0/24(rw,sync,insecure,root_squash,no_subtree_check,fsid=0) | ||
- | /home/download 192.168.1.4(rw,nohide,sync,insecure,no_root_squash,no_subtree_check,anonuid=1000,anongid=100) | ||
- | /home/movies 192.168.1.4(rw,nohide,sync,insecure,no_root_squash,no_subtree_check,anonuid=1000,anongid=100) | ||
- | /home/net/Pictures 192.168.1.4(rw,nohide,sync,insecure,no_root_squash,no_subtree_check,anonuid=1000,anongid=100) | ||
- | </code> | ||
- | |||
- | ==== NFS Ports ==== | ||
- | |||
- | |||
- | Now change following settings.\\ | ||
- | If any of the variable not exists please add as new line.\\ | ||
- | **NOTE :** Use What ever port you like match to the iptables rule after. | ||
- | <code bash | /etc/sysconfig/nfs> | ||
- | LOCKD_TCPPORT=59620 | ||
- | LOCKD_UDPPORT=59620 | ||
- | STATD_PORT=59622 | ||
- | MOUNTD_PORT=59621 | ||
- | </code> | ||
- | |||
- | ==== Firewall ==== | ||
- | |||
- | Add Following lines to your firewall rules. | ||
- | |||
- | <code bash | /etc/sysconfig/iptables> | ||
- | -A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m tcp -p tcp --dport 59620 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m tcp -p tcp --dport 59621 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m tcp -p tcp --dport 59622 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m udp -p udp --dport 59620 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m udp -p udp --dport 59621 -j ACCEPT | ||
- | -A INPUT -m state --state NEW -m udp -p udp --dport 59622 -j ACCEPT | ||
- | </code> | ||
- | |||
- | ==== Services ==== | ||
- | |||
- | Now restart / start all modified services.\\ | ||
- | In new Fedora it is some thing like as follow\\ | ||
- | Some server require to be started in specific order. | ||
- | |||
- | * systemctl restart rpcbind.service | ||
- | * systemctl restart iptables.service | ||
- | * systemctl restart nfs-idmap.service | ||
- | * systemctl resteart nfs-lock.service | ||
- | * systemctl restart nfs-server.service | ||
- | |||
- | ===== Client ===== | ||
- | |||
- | |||
- | |||
- | [[http://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s1-nfs-server-export.html | Best Referance]] |