How to configure GL mt300n as a NFS server?

I am new to this and I am wondering how I can modify the GL MT300n as an NFS server. I am grateful for any replies. Thank you

Hello!

First things first, you would need a USB flash drive to store the files. The router itself only has 16 MB of storage, and it should not be used to store files other than OpenWRT configurations.

I assume your running the Gl-Inet firmware on your device? You should be able to plug a USB flash drive in and it should mount to the system.

Have you ever used OpenWRT command line? To setup the server itself you will need to SSH into the router as root, enter your root password (set in the Web interface when you first setup the device). Then you need to run a few command as listed in the OpenWRT wiki to set the server up: https://wiki.openwrt.org/doc/howto/nfs.server#installation

Personally I can find the wiki sometimes confusing, so basically once you SSH in you need to run these commands:

opkg update

This will update the system’s packages.

opkg install nfs-kernel-server

This command will install nfs-kernel-server, the NFS server itself.

Now edit the file /etc/exports/ to configure the NFS server itself. This part can get a little bit confusing, because its different for everyones needs, but the basic syntax is as follows:

/mnt/sda3   192.168.1.2(rw,sync,no_subtree_check)

The /mnt/sdax is where your you would put the location of the mounted drive. To find out this information, run df -h, and find the disk with the size that matches your USB drive’s size. It should show somewhere on that line as /mnt/sdaX, which is where the drive is located.

The 192.168.1.2 is the client’s IP that should have access to the share (NFS dosen’t have password logins, it bases logins by IP). The rest are customizable options for the share itself, but leaving the defaults should work fine.

Once you’ve changed the /etc/exports/ file, you need to start the NFS server and its processes. Run the following commands one after another:

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

This should start the NFS server. At this point you should be able to point your client to the router’s IP address and see the NFS shares. This guide may be slightly off, given I wrote it at 3 AM, so please do post back if you have any issues.