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.
I am trying to network 2 Redhat 9 boxes connected to the Internet through a Netcomm NB1300plus4 ADSL Modem/Router/Switch.
This thing has DHCP and has given the IP addresses 192.168.1.13 to the "server" and
192.168.1.6 to the "client"
Kernel is 2.4.20-6 It seems I have to use NFS
NFS not running at boot-up (built as module)
I followed the steps described in 'http://nfs.sourceforge.net/nfs-howto/' but when I try to mount a directory on the client I get the following message:
"mount: 192.168.1.13:/home failed, reason given by server: Permission denied"
root name, user name and passwords are exactly the same on the 2 boxes
Server side
=========
this is the "ls -la" entry from the server from /
drwxr-xr-x 4 rene rene 4096 Sep 13 22:22 home
this is the /etc/exports file on server:
/var 192.168.1.6(ro)
/home 192.168.1.6(ro)
this is the /etc/hosts.deny on server
portmap:ALL
lockd: ALL
mountd: ALL
rquotad: ALL
this is the /etc/hosts.allow on server
portmap: 192.168.1.6
lockd: 192.168.1.6
rquotad: 192.168.1.6
mountd: 192.168.1.6
statd: 192.168.1.6
ALL: localhost
rpc.mountd: ALL
This is the script I used to start it up after booting up
#!/bin/bash
/sbin/insmod nfs
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/sbin/rpc.statd
/sbin/rpc.lockd
/usr/sbin/rpc.rquotad
and the result of rpcinfo -p from the server after running previous script
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
391002 2 tcp 32769 sgi_fam
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100005 1 udp 32772 mountd
100005 1 tcp 33101 mountd
100005 2 udp 32772 mountd
100005 2 tcp 33101 mountd
100005 3 udp 32772 mountd
100005 3 tcp 33101 mountd
100011 1 udp 1017 rquotad
100011 2 udp 1017 rquotad
100011 1 tcp 1020 rquotad
100011 2 tcp 1020 rquotad
100024 1 udp 32773 status
100024 1 tcp 33102 status
Client side
========
Script used on client after booting up
#!/bin/bash
/sbin/insmod nfs
/sbin/rpc.lockd
/sbin/rpc.statd
the result of rpcinfo -p from the client after running previous script
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
391002 2 tcp 1025 sgi_fam
100024 1 udp 1028 status
100024 1 tcp 3590 status
result of "ls -la" from /mnt from client
total 23
drwxr-xr-x 5 root root 4096 Oct 19 20:15 .
drwxr-xr-x 19 root root 4096 Oct 19 18:49 ..
drwxr-xr-x 2 root root 4096 Oct 19 10:33 cdrom
drwxr-xr-x 5 rene rene 7168 Oct 20 00:19 floppy
drwxr-xr-x 2 rene rene 4096 Oct 19 20:15 home
Command used on client:
[root@hp rene]# mount 192.168.1.13:/home /mnt/home
I have checked and re-checked many times and I can't work out what is wrong.
Any help or hint most appreciated. If necessary I can disconnect one box from the net and
connect the 2 boxes with a cross-over cable to achieve networking (if this makes a solution easier)
This is the relevant resulting line from 'ls -la' issued from / (root - lines for other directories ignored)
drwxr-xr-x 4 rene rene 4096 Sep 13 22:22 home
I've found that running the following lines on the client fixes the problem
"/etc/rc.d/init.d/nfs stop"
"/etc/rc.d/init.d/nfs start"
I am now able to see the shared files from (server) /home on the client immediately (/mnt/home) after rebooting and without having to run any script as explained earlier but a new addition (/var) to this system is not giving the expected result, so I'll investigate a bit more and update this post accordingly.
Thanks to emailssent.
I've found the server is not functional under Redhat 9 unless I run the following line which I have added to the start of the script described above.
/usr/sbin/exportfs -ra
There are probably more elegant ways of doing it but I find it premature to spend time on it when one major problem still persists. The problem is, regardless of what I do, I can only manage to see the first level of directories from the client. For example when I export from the server and mount on the client "/var", I can only see the contents of "/var" on the client, not the content of the sub-directories in "/var" (like "/var/www"). If I try to export from the server and mount on the client "/var/www" then I get a message on the client saying it cannot mount /var
Since Redhat 9 is a dead end, I decided to install Fedora core2, I'll wait till I see how NFS go with it and Ill then update this post.
You have make another share on the NFS server
for /var/www/
(becz. as far i remember they appear on the the same disk, if they appear on another disk then u will be able to mount it also without creating another share)
To Jack:
Yes that fixed it. I can now see all the subdirectories, sub-subdirectories and files in /var/www ( and others). Great stuff.
So, for posterity, I've got now in my "/etc/exports" (on server)
/var 192.168.1.6(ro,no_root_squash)
/var/www 192.168.1.6(ro,no_root_squash)
and in "/etc/fstab" on client
192.168.1.13:/var /mnt/var nfs ro 0 0
192.168.1.13:/var/www /mnt/var/www nfs ro 0 0
also created directories "/var" and "/var/www" in "/mnt"
Let's backup to the first set of exports /var and /home
As you export the /var directory you can mount that, but you don't export the /var/www as a resource so therefore you can't mount it.
You can still reach the /var/www directory using the /mnt/var/www path (provided that you mount /var to /mnt/var on the client).
Compare to mounting a hard disk partition. You mount the entire partition with all of it's subdirectories, but you can't mount a directory of a partition.
Anothere solutions now I remembered as I am reading ugge post, that if u don't want to make seperated export for ur www then u can try to mount it directly from the NFS client.
That's without exporting www u can just mount it from NFS client
#mount -a -t nfs
or
#mount /var/www /var/www
(mount <sorce directry on NFS server> <destination directory on NFS client>
This all above is a NFS rule provided by nfs protocol.
You can't mount what you don't explicitly export.
If you don't export the /var/www then you can't mount that directly, because that resource doesn't exist as far as exports go.
You will have to mount the /var directory and then cd to the right subdirectory on the client.
Thanks to you people for all your suggestions. I definitely have to streamline the set up but I will do it slowly, one thing at a time after I install the new distro as explained before.
I can now see all the shares from the client, form all the directories listed although I am getting the following message after runnung the script "nfs.sh" on the server:
192.168.1.6:/home Invalid argument
which doesn't seem to affect anything and which I can't explain.
Also I have to run the scripts a couple of times after re-booting.
Here are the latest files I used.
# "ls -la" of script on server (can only run as root)
-rwx------ 1 root root 169 Oct 24 12:23 nfs.sh
# script nfs.sh
#!/bin/bash
/usr/sbin/exportfs -ra
/sbin/insmod nfs
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/sbin/rpc.statd
/sbin/rpc.lockd
/usr/sbin/rpc.rquotad
Client side
========
Appropriate mount points in /mnt to match the exports file on server
Appropriate mount entries in /etc/fstab
# script nfs.sh (can only run as root as above)
#!/bin/bash
/sbin/insmod nfs
/sbin/rpc.lockd
/sbin/rpc.statd
(this script appears unnecessary)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.