OpenWrt Forum Archive

Topic: Confused about how to install NFS server

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm a newbie. That being said, I bought the TL-WR1043ND, proceeded to install OpenWrt (first time ever) as per wiki. Worked well. Than I proceeded to install whatever is necessary to connect a USB drive to the router, as per wiki. Worked well. Than I proceeded to install whatever is necessary to be able to access the content of the USB drive using NFS. I rebooted. All seems fine except I can't see the USB drive from LAN clients.

Being a newbie, I have a hard time understanding all the instructions there:
http://wiki.openwrt.org/doc/howto/nfs.s … stallation

I can't make sense of all these installation steps. So lets see:

opkg update
opkg install nfs-kernel-server

Above is fine, pretty straightforward, and it worked as expected, I can confirm ports 111 and 32777-32780 are being listened on, and that nfsd and portmap are running.

I see the content of my "/etc/exports" is

/mnt    *(ro,all_squash,insecure,sync)"

Guess it means whatever is in "/mnt" is going to be served by nfs server (yes?). Fine then.

Now the rest of the installation instructions are weird... I don't know what to make of:

vi /etc/exports
. /etc/init.d/portmap start
. /etc/init.d/portmap enable
. /etc/init.d/nfsd start
. /etc/init.d/nfsd enable

and

netstat -a
$IPT -A INPUT -j ACCEPT -i eth0.1 -s $NET_LAN -p tcp --dport 111 #------------------- portmap
$IPT -A INPUT -j ACCEPT -i eth0.1 -s $NET_LAN -p udp --dport 111 #------------------- portmap
$IPT -A INPUT -j ACCEPT -i eth0.1 -s $NET_LAN -p tcp --dport 32777:32780 #----------- nfsd
$IPT -A INPUT -j ACCEPT -i eth0.1 -s $NET_LAN -p udp --dport 32777:32780 #----------- nfsd
$IPT -t raw -A INPUT -i $IF_LAN -s $NET_LAN -p tcp --dport 32777:32780 -j NOTRACK #-- don't track nfs
$IPT -t raw -A INPUT -i $IF_LAN -s $NET_LAN -p udp --dport 32777:32780 -j NOTRACK #-- don't track nfs
$IPT -t raw -A OUTPUT -o $IF_LAN -d $NET_LAN -p tcp --dport 32777:32780 -j NOTRACK #- don't track nfs
$IPT -t raw -A OUTPUT -o $IF_LAN -d $NET_LAN -p udp --dport 32777:32780 -j NOTRACK #- don't track nfs

I suspect the first block of instructions is to enable the daemons at reboot. I did this thru Luci. Still, does that block of instructions make any sense? A noob like me would be led to create a file named /etc/exports which content is the four listed command to start and enable dameons... Really?

Second block of instructions I can't make sense of it either. It appears a bit of explanation is missing in between two block of instructions.

First would be "type 'netstat -a' to confirm port 111 and 32777-32780 are being listened on by nfs server" (yes?)

Second would be add the following firewall directives... where? Which files? And what do they accomplish exactly (I would want to have an explicit statement that these directives only enable lan access, not wan access of the usb storage).

So there we are, in which file exactly do I add these firewall directives, and what exactly do they accomplish? Do I add them as is without any substitution? I suspect this is the last bit I need to work on to make my NFS works properly.

The discussion might have continued from here.