Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Good day everyone. Just a brief note about me, I've been using MX-Linux 23 now and have been using MX-Linux for about 3 years. Before that I dabbled in Linux for many years, but my primary system was Windows.
For the most part I am able to get things done by using Google to search for whatever it is I'm trying to accomplish, but every now and then I run into a problem I can't quite figure out. One such item is NFS.
I have basically 3 systems on my local network of the 10.0.0.0 range and I would like to be able to share folders or drives on the network and being as all run basically the same system (MX-Linux) I thought this should be easy.
I first tried using Samba, but decided after several failed attempts that it might be easier to use a method like NFS being as it is for Linux systems. I did my usual Google search and came up with a dummies link How to Share Files with NFS on Linux Systems. I thought this should be a good way to do it as it proudly proclaimed only 2 basic steps were involved. I should have known better at this point because it's never as easy as they say.
My first problem was the lack of an explanation on setting up a line in the exports file to export the folder I wanted to share. This was the problem area:
If you want to give access to all hosts on a LAN such as 192.168.0.0, you could change this line to
/home 192.168.0.0/24(rw,sync)
I understand the /home is the folder I wish to share on the exporting system and 192.168.0.0 is the IP address user range I wish to have access, but no place in the article was the /24 after the IP address mentioned.
So once again I went off in search in Googleland and found a explanation of sorts under a Fedora article which read:
IP networks — Allows the matching of hosts based on their IP addresses within a larger network. For example, 192.168.0.0/28 allows the first 16 IP addresses, from 192.168.0.0 to 192.168.0.15, to access the exported file system, but not 192.168.0.16 and higher.
Great, now I know that the /28 limits the number in the IP range of addresses, but how does 28 correspond to 16 IP addresses?
I realize that part of the problem with Linux is it's infinite configurability, but there needs to be a simple way to do something that applies to us simple users.
For the record I have a 10Tb hard drive coming which I want to eventually setup as NFS shared so my other systems on the local network can access it to read and write to. As I said, all of my systems are running the same OS (MX-Linux) and they all use the same user and password. I thought this would make it easier to share, but I guess not.
I do have a 3Tb hard drive setup on another networked computer running FreeNAS and it works flawlessly. I can read and write to it from any other computer on my network. I considered installing the new 10Tb drive into this computer, but it's been so long since I set it up I figure I have forgotten how I did it. Once things work I tend to forget how I got it working and just use it.
Also this is an older HP system and I fear the 10Tb drive may not work with the older hardware. Besides that I wanted the new drive to be local on the system I use the most and just accessible to the other computers on the network.
So this is my problem. Is there a fairly easy way to establish this, keeping in mind there are no worries about security, I live alone and no one else uses my computers. Perhaps a link to an article that explains it for us simple users? Any and all help sincerely appreciated...
This has to do with network masks, so look those up if you want to learn about them. To get you setup quickly, if you have 10.0.0.1, 10.0.0.2, 10.0.0.3, etc then you'd use
Code:
/home 10.0.0.0/24(rw,sync)
Make sure rpcbind, nfsd & friends are running, and check from the remote system(s) with showmount -e (the NFS server address). Samba will work as well, but NFS might be simpiler as there's no complex smb.conf file to mess with.
mx automatically configures the firewall so if you have not turned it off or allowed nfs traffic then you will not be able to connect. The same goes for samba.
Another option for sharing files between computers is using sftp from the file browser. No configuration files.
Great, now I know that the /28 limits the number in the IP range of addresses, but how does 28 correspond to 16 IP addresses?
If you write an IP address in binary, you get 32 bits (for IPv4).
The /number is a number of bits which are the same for the addresses in the range.
So with a mask of 28 bits, that leaves 32-28 = 4 bits left over - i.e. 4 bits with which indicate the addresses.
With 4 bits of binary, you can have 0000 up to 1111 which is decimal 0 to 15, or 16 distinct addresses.
Similarly, a mask of 24 bits leaves 32-24 = 8 bits left over, a full byte, which can represent 256 addresses.
As michaelk suggests, the output of "ip address" should provide an acceptable value for your network - it doesn't matter using /24 even if you only have 3 devices on the network (unless you have devices which you need to exclude).
Sorry everyone, I do appreciate your replies, but they came a little late for me. I found the MX Linux forum and posted much the same query. One of their first suggestions was to use the MX Samba Config app to setup my shares and this worked very well indeed. So now I have the 10Tb hard drive, a 2Tb USB SSD drive and my /home folder all shared and accessible on the 2 other systems on my local network. The NFS info is appreciated, but for now at least I can access my shares as desired.
Thanks!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.