LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable To Create LAN Using NFS (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-create-lan-using-nfs-289564/)

numbersix 02-13-2005 03:25 AM

Unable To Create LAN Using NFS
 
I finally made the decision to ditch Windows and installed SuSE 9.2 Pro on our four machines at home a couple of weeks ago. Three are desktops one a laptop. The install was painless on each machine. I left one as a dual boot with Win XP (only so that we could use three applications that I have yet to try and find open source equivalents for).
We have broadband via a cable modem and all machines access the internet through this one connection using a Netgear RP614 v2 Cable/DSL Router Gateway. This has a built in firewall that uses NAT. It is also a 4 port 10/100 Mbps network switch.
When we had Win XP we had all machines networked to share files and printers using the same NIC's/cables as we used for the internet.
When I installed SuSE there was no problem with the internet connection on any machine, it was available immediately. The SuSE firewall is running on all machines as Zone Alarm used to be with Windows.
One of the reasons I changed to Linux was security and I do understand that many things that were 'defaults' and 'easy to set up' in Windows need to be specifically set up in Linux. Networks can be a serious security issue and I'm pleased that I have to take the time to ensure correct configuration.
I don't need network access to the Windows installation so I don't need to use SAMBA, that is correct isn't it? What I should use is NFS?
I have carefully gone through setting up an NFS server and client, opening the SuSE firewall to allow internal networking. I've set the files/directories I want to share correctly. Yet I am unable to 'see' the other machines on the network or access the shares.
I'm obviously doing something wrong and would appreciate a talk through of the steps necessary to set up NFS.
On my machine I have two NIC's that are part of the motherboard (ASUS A7N8X DeLuxe Rev 2) one is a 3Com 3C920B-EMB Integrated Fast Ethernet Controller and the other an Nvidia nforce 2 Ethernet which is configured with DHCP and used for my internet connection.
The other machines have only one NIC each and I have only ever used one of my onboard cards.
Do I need additional NIC's for each machine to create a seperate LAN from the Internet connection?
I've looked in books, forums, the internet, Google and am now very confused. I have every intention of learning about TCP/IP etc, but for now all I want is to get our LAN up and running. Then we can settle down and start to learn. Sorry about the length of this post.

tredegar 02-13-2005 05:08 AM

You seem to have made a good start. congratulations on getting this far.

Your connectivity problems are probably due to the firewalls you have running: You probably do not need these (unless you fear mischief from within your network. Your netgear kit is running a firewall, so you can turn off the suse firewalls, this'll be much easier than configuring them all!

Then check that you can "ping" your machines. You should be able to, either by their LAN IP numbers, or names if you have /etc/hosts set up correctly. When I was setting up a similar network, having started with DHCP, I later found it much easier to dispense with DHCP, and allocate all my machines static IP numbers. The DSL modem/router/switch/firewall gets its WAN (Internet) dynamic IP address from my ISP, and I do not really care what this is (unless I want to connect from the internet)

NFS was relatively easy to set up, ssh was a bit more of a challenge.

So, I'd suggest you connect to your netgear router/switch, check its firewall is properly enabled, then disable the firewalls on your LAN.

You do not need additional network cards: Inter-machine traffic, and internet traffic will be routed correctly. If you cannot "ping" then you have a basic network problem: No NIC, no/bad cable, or a firewall in the way. There's nothing wrong with your cabling or cards as all machines can access the internet, so just connect each machines eth0 port to the netgear router/switch and turn the suse firewalls off.

Hope this helps.

fsbooks 02-13-2005 05:44 AM

What have you tried to do to "see" the other machines? Do you have their IP addresses? Are you running DHCP or have you assigned static IP's. Do the machines have names or FQDN's? Can you "ping" them?

Setting up NFS is generally a two step process once networking is setup. On the host (while the file systems reside), permission is given to other machines in /etc/exports (see "man exports"). Mounting on the client can be done manually (for a temporary connection), or through fstab (for a mount that can last through reboot).

I will give you an abbreviated version of how I would do this on my network, depending on where you are in your setup, expect some variation, but perhaps it will get you started. Once you have some specific errors, I (or someone) can help you through it.

I have two machine bat and fly. My domain is mslahome.net. I have static IP's. In my /etc/hosts file, I have the following:

192.168.0.77 bat.mlsahome.net bat
192.158.0.123 fly.mlsahome.net fly

bat is the host. I wish to export the /data filesystem. Therefore, I have the following line in /etc/exports

/data fly.mlsahome.net(rw,async,no_root_squash)

Your options will likely vary. I want read/write access, I trust my network and want faster writes, and I want root access to the filesystem. Again, look at "man exports", particularly the examples at the bottom and don't worry if you don't understand it all.

I need to start nfs services. (I don't generally use Suse, so I am somewhat guessing here). I type the following as root "chkconfig nfs 35;chkconfig nfslock 35;chkconfig nfsserver 35" to setup automatic service starting at reboot for unlevel 3 and 5. I also start the services now (to avoid reboot): "cd /etc/init.d;./nfs start;./nfslock start; ./nfsserver start:.

I then go to fly make a mount point (mkdir /data_bat) and add the following line to /etc/fstab:

bat:/data /data_bat nfs rw,async 0 0

This will mount the filesystem at the next boot, I want it now. Therefore I type "mount /data_bat".

numbersix 02-13-2005 12:46 PM

Hi

Thanks for the replies and help. I'm still getting nowhere. This will sound silly to you but how do I ping the other machines?
The SuSE firewall is turned off but it didn't seem to make any difference.
I've been configuring NFS via YAST as I'm very new to command line stuff.

tredegar 02-14-2005 02:49 AM

To "ping":

Open a terminal.
The command is ping name.or.number.of.machine eg
ping localhost (to ping yourself)
ping 127.0.0.1 (the same as the above)
ping 192.168.0.77 (a different machine on your LAN)

The above pings will continue indefinitely: to stop them, use <CTRL>-C.

man ping will tell you more.

fsbooks 02-14-2005 10:20 PM

What have you tryed with yast? Are there any messages that might illumiinate the problem either on the console or perhaps in /var/log/messages or /var/log/syslog or such? (Error messages are your friend, even if sometimes a bit obscure.) What does the /etc/exports look like on the server, and /etc/fstab on the clients?

I found the following on the web: http://www.novell.com/documentation/...l/ch14s09.html . How far have you gotten. Don't worry, you will get through it.

numbersix 02-15-2005 07:07 AM

Hi
Yesterday when I pinged I was successful in every direction.
I've followed the instructions in the SuSE Administrators Manual that came with the software to set up an NFS server on my machine.
I've also followed the instructions for setting up NFS clients on the other three. The problem is when I cick on 'add' in 'NFS Client' in Yast, I get the window asking for the host name of the NFS server. I click on 'choose' and a message comes up telling me it's 'scanning for hosts on this LAN'. After a short wait I get a small window titled 'NFS Servers' and there's nothing there to select.
This indicates, based on my minimal knowledge, that I can't have set up the server correctly. I could enter the info manually but the information in the book and on the SuSe website doesn't make it clear what exactly to enter - I've set host names for all the computers so I can identify them - do I use those names or IP addresses?
I also have a problem accessing /etc/fstab and /etc/exports etc. I log in as root correctly but get "Permission denied" messages -
Password:
linux:~ # /etc/fstab
-bash: /etc/fstab: Permission denied
linux:~ # /etc/exports
-bash: /etc/exports: Permission denied
linux:~ # /var/log/messages
-bash: /var/log/messages: Permission denied
I'll try again 'by the book'

tredegar 02-15-2005 07:56 AM

Some progress then.....
Ping is working so the network is functioning & connected: good.
I do not use suse, so I do not use yast, I do not much like mandrake's "Control centre" either. So we'll try and do things by hand.

To start with your errors:

Quote:

linux:~ # /etc/fstab
-bash: /etc/fstab: Permission denied
The # sign is the root prompt. It is waiting for you to type a command.
/etc/fstab is a text file. It is true that almost everything in linux is a file, (including commands), but this is a plain ordinary text file, and you cannot execute it, so you get "Permission denied". Same for the other files. If you typed cat /etc/fstab the cat command would give you a listing of the contents of the file /etc/fstab.

You need to edit some files. You can do this from the command line (You really should learn a tiny bit about vi the command-line editor. It only takes 5mins to learn the basics, and one day, when your GUI has failed, knowing how to use vi will save you. Yes, being a newbie is hard at first, there are a lot of things to learn about!)

The easiest way for you to edit a file as root is:

Open a terminal.
Give the su command and password. (You know how to do this already)
Give the following command kwrite &
That will start up kwrite ( which is very easy to use ) as the root user because it was started from a "root console". You need to be root because the /etc/hosts file belongs to root, and root has set it so that only root can write to that file.

Open up /etc/hosts with kwrite. (File...Open...Navigate to it etc)

In here you need a list of your computers names and their IP addresses, and their short names. Mine looks like this:

127.0.0.1 localhost
10.0.0.77 p4.home.net p4
10.0.0.66 p3.home.net p3

You have more computers than I do, so add them all in. You need the localhost line, but you do NOT need the names or IP addys of my computers! You will have to do this on all your computers.

Save the file, do not close the (root's) kwrite window just yet. You need to edit /etc/exports and /etc/fstab as it says in the link fsbooks gave you.

Good luck, you will get there.


All times are GMT -5. The time now is 07:57 PM.