In order to operate a NFS server on the IPFire, the nfs package needs to be installed.
NFS can be installed as an IPFire addon over the console with:
pakfire install nfs
or over the IPFire web interface via Pakfire.
After the successful installation of both Addons they are to be seen in the right selection field on the Pakfire page in the Webinterface.
A finished export-file looks in approximately like this:
Filename = /etc/exports
/mnt/harddisk/Daten 192.168.0.0/24(rw,async,subtree_check, no_root_squash,anonuid=99,anongid=99)
In the example the following options were set:
|/mnt/harddisk/Data||The directory on the IPFire where the data to be stored|
|192.168.0.0/24||The IP or the network, which may access the NFS server (PC´s in IP range from 192.168.x.x permitted|
|rw||Enable read and write access|
|async||Allow the server to cache the data and to write it only if the opportunity is in addition|
|subtree_check||This option proofs that the data will be written in the correct subdirectory|
|no_root_squash||The anonymous user/GruppenID|
|anonuid=99,anongid=99||User and Group ID, who accessed to the NFS server. (99 = nobody, 0 = root)|
If the file is processed and stored, the NFS server must be reloaded now. To do so and start the missing services, the following command line is vital:
If not everything are returned here with green OK, some options are falsely set or not available.
The following steps on Client side leads now to the target:
Under Linux the slogan takes affect all is a file. These following the released folder on the server is also a file or a directory. We create this new file under the directory
/media. Thus a file on the Client exists, which refers in reality to the server (and nobody will notice it).
sudo mkdir /media/server
creates the file. In place of “server” you take any name which you prefer. This file belonged however to the user root and as normal user you do not have access on it. To change this two command lines are necessary:
sudo chown user /media/server sudo chgrp user /media/server
Now the file belongs to the user (your user name) and the user can access it. However it is missing still another little thing, cause the reference, that this file is to refer its contents from the server.
We divide the client now where the server is. You need to enter the following line into the file
filename = /etc/fstab
192.168.0.1:/home/user/shared /media/server nfs rw,rsize=8192,wsize=8192 0 0
/etc/fstab is a list of all volumes which according to standard accesses. Here you should find the record from all your volumes.
/media/server. That is the file on the client which points to the server. The trick is: You store something into the file
/media/serverand in reality the contents of the file are on the server!
sudo mount -a
This mounts the remote shared resource into the local file system on
/media/server. The storage space on the remote server should be available to you and you should be able to place files into the folder as well. Have fun!
If IPFire should act as a client, the record in
/etc/fstab is not enough to mount the network drive automatically during the boot process. A workaround is to insert the line below into the file
mount -a -t nfs
To release portmap on the blue network segment, a record must take place in the file hosts.allow.
The record of
/etc/hosts.allow will need these lines created (add them):
sshd : ALL ALL : localhost ALL : 192.168.0.0/255.255.255.0