Дек 042010
 

1 На сервере

конфиг ядра

— Network File Systems
NFS client support
[M] NFS client support for NFS version 3
[ ] NFS client support for the NFSv3 ACL protocol extension
[ ] NFS client support for NFS version 4 (EXPERIMENTAL)
[ ] NFS client support for NFSv4.1 (DEVELOPER ONLY)
[M] Provide NFS client caching support
<*> NFS server support
[*] NFS server support for NFS version 3
[*] NFS server support for the NFSv3 ACL protocol extension
[ ] NFS server support for NFS version 4 (EXPERIMENTAL)

sudo emerge emerge nfs-utils

потом

sudo nano /etc/exports
/home/ 192.168.1.3/24(sync,no_root_squash,rw)

потом

sudo exportfs -ra
sudo /etc/init.d/nfs reload
sudo rc-update add nfs default
sudo rc-update add portmap default
sudo /etc/init.d/nfs start

Проверяем стартует ли NFS

sudo rpcinfo -p

2 клиент

конфиг ядра

— Network File Systems
<*> NFS client support
[*] NFS client support for NFS version 3
[ ] NFS client support for the NFSv3 ACL protocol extension
[ ] NFS client support for NFS version 4 (EXPERIMENTAL)
[ ] NFS client support for NFSv4.1 (DEVELOPER ONLY)
[*] Provide NFS client caching support
NFS server support
[M] NFS server support for NFS version 3
[] NFS server support for the NFSv3 ACL protocol extension
[ ] NFS server support for NFS version 4 (EXPERIMENTAL)

sudo emerge nfs-utils
sudo rc-update add portmap default
sudo rc-update add nfsmount default
sudo /etc/init.d/nfsmount start

делаем запись в:

sudo nano /etc/fstab

192.168.1.3:/home/ /mnt/nfs/home/ nfs bg,hard 0 0
почемуто с такими опциями в fstab’e он нехотел мантироваться defaults,auto,users,exec 0 0, я так и не понял почему.

nfs я подымал для локальной сети…так что во внешку порты не смотрят…я нестал заморачиваться с iptablesom, но современем разберусь.

делаем NFS порты стаичискими

#nano /etc/default/nfs-common
STATDOPTS=»—port 32765 —outgoing-port 32766″

touch /etc/modprobe.d/options.local
options lockd nlm_udpport=32768 nlm_tcpport=32768

#nano etc/default/nfs-kernel-server
RPCMOUNTDOPTS=»-p 32767″

iptables

$IPTABLES -N NFS
$IPTABLES -A NFS -p tcp -m tcp -m multiport —dports 32766,32767,32768 -s 192.168.1.1/24 -j ACCEPT
$IPTABLES -A NFS -p udp -m udp -m multiport —dports 32766,32767,32768 -s 192.168.1.1/24 -j ACCEPT

 Leave a Reply

(required)

(required)

35 Запросов к базе. 0,418 Генерации страницы, 36MB Использование памяти.
Вы зашли с IP: 54.224.108.238