Mapear disco duro por red NFS y openwrt
De Seguridad Wireless
Contenido |
Mapear disco duro por red NFS y openwrt
Para no colapsar la pequeña memoria de la fonera, montaremos un server NFS en el pc y la fonera como cliente NFS.
Instalamos con red en la fonera openwrt kamikaze los siguientes paquetes.
Fonera ip=192.168.1.1
root@OpenWrt:/scripts# ipkg list |grep nfs kmod-fs-nfs - 2.6.22.4-atheros-1 - Kernel module for NFS support kmod-fs-nfsd - 2.6.22.4-atheros-1 - Kernel module for NFS kernel server support nfs-kernel-server - 1.0.7-1 - Kernel NFS server support nfs-kernel-server-utils - 1.0.7-1 - NFS server utils nfs-server - 2.2beta47-1 - User Space NFS server nfs-utils - 1.1.0-1 - updated mount utility (includes nfs4) unfs3 - 0.9.17-1 - User-space NFSv3 Server root@OpenWrt:/scripts# ipkg install nfs-utils Installing nfs-utils (1.1.0-1) to root... Downloading http://ipkg.k1k2.de/packages/./nfs-utils_1.1.0-1_mips.ipk Installing libwrap (7.6-1) to root... Downloading http://ipkg.k1k2.de/packages/./libwrap_7.6-1_mips.ipk Installing libevent (1.1-1) to root... Downloading http://ipkg.k1k2.de/packages/./libevent_1.1-1_mips.ipk Installing libblkid (1.39-1) to root... Downloading http://ipkg.k1k2.de/packages/./libblkid_1.39-1_mips.ipk Configuring libblkid Configuring libevent Configuring libwrap Configuring nfs-utils Done. root@OpenWrt:/scripts# ipkg install portmap Installing portmap (6.0-1) to root... Downloading http://ipkg.k1k2.de/packages/./portmap_6.0-1_mips.ipk Configuring portmap Done. root@OpenWrt:/scripts# ipkg install kmod-fs-nfs Installing kmod-fs-nfs (2.6.22.4-atheros-1) to root... Downloading http://ipkg.k1k2.de/packages/./kmod-fs-nfs_2.6.22.4-atheros-1_mips.ipk Configuring kmod-fs-nfs Done. root@OpenWrt:/scripts#
En el pc con debian GNU/linux el server
Debian ip=192.168.1.11
:/home/dudu# apt-get install portmap nfs-user-server Leyendo lista de paquetes... Hecho Creando árbol de dependencias Leyendo la información de estado... Hecho Los siguientes paquetes se ELIMINARÁN: nfs-kernel-server Se instalarán los siguientes paquetes NUEVOS: nfs-user-server Se actualizarán los siguientes paquetes: portmap 1 actualizados, 1 se instalarán, 1 para eliminar y 437 no actualizados. Necesito descargar 138kB de archivos. Se liberarán 123kB después de desempaquetar. ¿Desea continuar [S/n]? s Des:1 http://ftp.au.debian.org testing/main portmap 6.0-5 [34,1kB] Des:2 http://ftp.au.debian.org testing/main nfs-user-server 2.2beta47-24 [103kB] Descargados 138kB en 18s (7565B/s) Preconfigurando paquetes ... (Leyendo la base de datos ... 99846 ficheros y directorios instalados actualmente.) Desinstalando nfs-kernel-server ... Stopping NFS kernel daemon: mountd nfsd. Unexporting directories for NFS kernel daemon.... :/home/dudu#
Debian 192.168.1.11
mkdir /mnt/nfs lenny dudu # chmod 777 /mnt/nfs/ nano /etc/exports # SERVIDOR NFS CONFIGURACION DUDU ############################################# /mnt/nfs 192.168.1.1(async,no_root_squash,subtree_check,rw) lenny tftpboot # /etc/init.d/portmap start Starting portmap daemon.... lenny tftpboot # /etc/init.d/nfs-user-server start Starting NFS servers: nfsd mountd. lenny tftpboot #
Fonera
192.168.1.1
root@OpenWrt:/# /etc/init.d/firewall stop
root@OpenWrt:/# mkdir /compartido
root@OpenWrt:/# portmap
root@OpenWrt:/# mount -t nfs 192.168.1.11:/mnt/nfs /compartido
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
none 6.6M 56.0k 6.6M 1% /tmp
tmpfs 512.0k 0 512.0k 0% /dev
mini_fo:/tmp/root 1.1M 1.1M 0 100% /tmp/root
/dev/mtdblock3 5.9M 1.0M 4.9M 17% /jffs
mini_fo:/jffs 1.1M 1.1M 0 100% /
192.168.1.11:/mnt/nfs 17.6G 6.2G 11.4G 35% /compartido
root@OpenWrt:/# umount /compartido/
Autor: *dudux