informatica:linux:nfs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
informatica:linux:nfs [2013/05/21 17:25] – javi | informatica:linux:nfs [2015/04/13 20:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
sudo aptitude install nfs-common nfs-kernel-server | sudo aptitude install nfs-common nfs-kernel-server | ||
+ | |||
==== Configuracion servidor ==== | ==== Configuracion servidor ==== | ||
Line 15: | Line 16: | ||
sudo vim / | sudo vim / | ||
- | Se añade la linea: | + | Se añade la linea con la carpeta a comartir, en este caso /home/datos: |
# | # | ||
Line 171: | Line 172: | ||
100005 | 100005 | ||
</ | </ | ||
+ | |||
+ | |||
==== Ejemplo reglas iptables ==== | ==== Ejemplo reglas iptables ==== | ||
Line 181: | Line 184: | ||
VM=" | VM=" | ||
KVM_VM_IP=" | KVM_VM_IP=" | ||
+ | KVM_LAN_IP=" | ||
NFS_PORTS=" | NFS_PORTS=" | ||
Line 194: | Line 198: | ||
then | then | ||
$IPTABLES -A INPUT -i $VIRT_IF -s $VM -d $KVM_VM_IP -p tcp --dport $port -j ACCEPT | $IPTABLES -A INPUT -i $VIRT_IF -s $VM -d $KVM_VM_IP -p tcp --dport $port -j ACCEPT | ||
- | $IPTABLES -A INPUT -i $VIRT_IF -s $VM -d $KVM_VM_IF | + | $IPTABLES -A INPUT -i $VIRT_IF -s $VM -d $KVM_VM_IP |
fi | fi | ||
done | done | ||
+ | # NFSD | ||
+ | $IPTABLES -A INPUT -i $VIRT_IF -s $VM -d $KVM_LAN_IP -p tcp --dport 2049 -j ACCEPT | ||
</ | </ | ||
Line 205: | Line 211: | ||
==== Instalacion ==== | ==== Instalacion ==== | ||
- | En el servidor | + | **IMPORTANTE** NFSv4 exporta de forma distinta que NFSv3. |
+ | |||
+ | ^ Directorio donde se alojan | ||
+ | | /srv/www | / | ||
+ | | /srv/svn | / | ||
+ | |||
+ | 1. Servidor: | ||
sudo aptitude install nfs-common nfs-kernel-server | sudo aptitude install nfs-common nfs-kernel-server | ||
- | NOTA: en principio winbind **NO** hace falta | + | 2. Cliente: |
+ | sudo aptitude install nfs-common | ||
+ | | ||
+ | NOTA: en principio rpcbind **NO** hace falta | ||
- | ==== Configuracion servidor ==== | + | ==== Configuracion |
1. Configurar los siguientes archivos: | 1. Configurar los siguientes archivos: | ||
- | | + | **/ |
< | < | ||
Line 240: | Line 255: | ||
</ | </ | ||
- | | + | **/ |
< | < | ||
Line 257: | Line 272: | ||
**IMPORTANTE**: | **IMPORTANTE**: | ||
- | /etc/fstab | + | ==== Configuracion servidor ==== |
- | | + | 0. Realizar los pasos anteriores |
+ | |||
+ | 1. Configurar los siguientes archivos: | ||
+ | |||
+ | **/etc/exports** | ||
+ | |||
+ | | ||
2. Se reinicia el servicio: | 2. Se reinicia el servicio: | ||
sudo exportfs -rav | sudo exportfs -rav | ||
- | |||
Line 270: | Line 290: | ||
==== Configuracion cliente ==== | ==== Configuracion cliente ==== | ||
- | 1. Instalar estos paquetes: | + | 1. Ver los recursos que ofrece el servidor: |
- | sudo aptitude install | + | sudo showmount -e nfs_server.example.com |
+ | |||
+ | 2. Montar el recurso: | ||
+ | |||
+ | sudo mount -v -t nfs4 nfs_server.example.com:/ | ||
+ | |||
+ | 3. Comprobar permisos: | ||
+ | |||
+ | ls -la /mnt/nfs | ||
+ | |||
+ | **NO** deberia pertenecer a nobody: | ||
+ | |||
+ | 4. Para montar definitivamente editar: | ||
+ | |||
+ | sudo vim / | ||
+ | |||
+ | Y anyadir la siguiente entrada: | ||
+ | |||
+ | | ||
- | 2. Y se monta el recurso: | + | 5. Ahora lo puede montar cualquier usuario: |
- | | + | mount /mnt/nfs |
informatica/linux/nfs.1369157151.txt.gz · Last modified: 2015/04/13 20:19 (external edit)