# NFS mount issues [SOLVED]

## csim

Hi,

i'm having difficulties getting NFS mount to work. It gives me permission denied, and running

```

showmount -e 10.0.0.10

```

on the client doesn't show any exports, even though running showmount -e on the server does.

it only shows the following text:

```

Export list for 10.0.0.10:

```

Here's the output of rpcinfo:

```

rpcinfo -p 10.0.0.10

   program vers proto   port  service

    100000    4   tcp    111  portmapper

    100000    3   tcp    111  portmapper

    100000    2   tcp    111  portmapper

    100000    4   udp    111  portmapper

    100000    3   udp    111  portmapper

    100000    2   udp    111  portmapper

    100024    1   udp  47068  status

    100024    1   tcp  40210  status

    100005    1   udp  56116  mountd

    100005    1   tcp  36061  mountd

    100005    2   udp  56116  mountd

    100005    2   tcp  36061  mountd

    100005    3   udp  56116  mountd

    100005    3   tcp  36061  mountd

    100021    1   udp  56876  nlockmgr

    100021    3   udp  56876  nlockmgr

    100021    4   udp  56876  nlockmgr

    100021    1   tcp  40720  nlockmgr

    100021    3   tcp  40720  nlockmgr

    100021    4   tcp  40720  nlockmgr

    100003    2   udp   2049  nfs

    100003    3   udp   2049  nfs

    100003    4   udp   2049  nfs

    100003    2   tcp   2049  nfs

    100003    3   tcp   2049  nfs

    100003    4   tcp   2049  nfs

```

Output of nmap:

```

nmap 10.0.0.10

Starting Nmap 4.76 ( http://nmap.org ) at 2009-09-23 23:13 CEST

Interesting ports on 10.0.0.10:

Not shown: 997 closed ports

PORT     STATE SERVICE

111/tcp  open  rpcbind

873/tcp  open  rsync

2049/tcp open  nfs

```

Output of route on the client:

```

route     

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.0.0.0        *               255.255.255.0   U     1      0        0 eth0

192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0

loopback        -               255.0.0.0       !     0      -        0 -

loopback        localhost.local 255.0.0.0       UG    0      0        0 lo

default         10.0.0.1        0.0.0.0         UG    0      0        0 eth0

```

and my dhcpd.conf:

```

#option domain-name "localhost";

option domain-name-servers 10.0.0.130;

option routers 10.0.0.1;

default-lease-time 600;

max-lease-time 7200;

ddns-update-style interim;

#interim for dynamic DNS

#ignore client-updates;

#authoritative;

subnet 10.0.0.0 netmask 255.255.255.0 {

  interface eth0;

  range 10.0.0.10 10.0.0.100;

#  option ip-forwarding off;

  option broadcast-address 10.0.0.0;

  option subnet-mask 255.255.255.0;

}

```

I thought it might be related to the fact that I'm unable to ping the client from the server, but I'm not sure.

If anyone can help that'd be great!   :Very Happy: Last edited by csim on Thu Sep 24, 2009 1:53 pm; edited 1 time in total

----------

## HeissFuss

Contents of /etc/exports on the server would be helpful.

----------

## csim

 *HeissFuss wrote:*   

> Contents of /etc/exports on the server would be helpful.

 

Sorry i forgot about it, it's 

```

/home/user1 10.0.0.0/255.255.255.0(async,rw,no_root_squash,no_subtree_check)

```

/home/user1 is the location of user account

----------

## HeissFuss

Is the nfs module loaded on the client or is it built into the kernel?  Are you running the nfsmount service on the client?

Do you have another host with functional nfs mounts that you can check 'showmount' against this other nfs server?

----------

## csim

The NFS is built as modules, it wasn't built into the kernel. Here are the modules loaded on both server and client:

```

nfsd                  327328  9 

lockd                  84496  1 nfsd

nfs_acl                 3776  1 nfsd

auth_rpcgss            51072  1 nfsd

sunrpc                242184  11 nfsd,lockd,nfs_acl,auth_rpcgss

```

Strange thing is that nfs doesn't get loaded, but loading it on both machines doesn't change anything.

/etc/init.d/nfs also seems to start mountd, but i also tried /etc/init.d/nfsmount to no avail.

Unfortunately i have no other client or server to test it on.   :Crying or Very sad: 

One strange thing i just noticed, running ifconfig gives:

```

eth0      Link encap:Ethernet  

          inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::218:f3ff:feb6:555f/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:0

          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:2052 (2.0 KiB)  TX bytes:8613 (8.4 KiB)

          Interrupt:16 Base address:0x2000 

```

according to /var/log/messages, dhcp server also assigns 10.0.0.10.

but it seems that nmap is actually seeing the client if i run 10.0.0.10. The above results from nmap are actually those from the client.

For example, rsync wouldn't work telling me that it is unable to access port 22. Running the sshd service on the client would make nmap see port 22 for ssh and rsync -opts /local/path 10.0.0.10:/some/path would copy files to /some/path on the local machine, the client.

Any ideas?

----------

## Anarcho

Which way are you trying to mount? From server to client or the other way round?

For me it seems that you are mixing with the ip addresses? Shouldn't you use "showmount -e 10.0.0.1" and not with 10.0.0.10?

----------

## csim

Could be but ping 10.0.0.1 gives me 

```

ping 10.0.0.1

PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.

From 10.0.0.10 icmp_seq=2 Destination Host Unreachable

From 10.0.0.10 icmp_seq=3 Destination Host Unreachable

From 10.0.0.10 icmp_seq=4 Destination Host Unreachable

```

Basically I'm unable to ping anything but 10.0.0.10    :Sad: 

----------

## Anarcho

 *csim wrote:*   

> Could be but ping 10.0.0.1 gives me 
> 
> ```
> 
> ping 10.0.0.1
> ...

 

So this is from the client itself which has the IP 10.0.0.10?

If you can't reach anything outside, then of course, you can't mount anything. But it could also be that you have restrictive (and most probably stupid then) rules on the server which disallows ICMP Ping. Could you check this?

Just to make sure: Your SERVER has IP 10.0.0.1?

----------

## csim

 *Anarcho wrote:*   

> 
> 
> If you can't reach anything outside, then of course, you can't mount anything. But it could also be that you have restrictive (and most probably stupid then) rules on the server which disallows ICMP Ping. Could you check this?
> 
> 

 

Pardon my stupid question but what exactly should i look for?

 *Anarcho wrote:*   

> 
> 
> Just to make sure: Your SERVER has IP 10.0.0.1?

 

My assumption was that DHCP assigns it automatically based on configuration in dhcpd.conf.

I just tried  

```

ifconfig eth0 10.0.0.0 netmask 255.255.255.0 up

```

and 

 *Quote:*   

> 
> 
> route add default gw 10.0.0.1
> 
> 

 

on the server, but it still doesn't work.

EDIT:

Here's the output from dhcpcd eth0 on the client:

```

eth0: dhcpcd 4.0.13 starting

eth0: broadcasting for a lease

eth0: offered 10.0.0.10 from 10.0.0.0

eth0: acknowledged 10.0.0.10 from 10.0.0.0

eth0: checking 10.0.0.10 is available on attached networks

eth0: leased 10.0.0.10 for 600 seconds

```

----------

## Anarcho

I'm completely confused about your network.

Could you please describe your network completely?

Which computers are in there, which one is the router, do you have a seperated router, which IP addresses should they have, which do they have, what are the routing tables, which is the NFS server and which is the NFS client, etc.

i.e. the following commands on each computer:

- ifconfig -a

- route -n

- cat /etc/exports

----------

## csim

It's the most simple setup   :Smile: 

Basically just 1 laptop connected directly to 1 computer, no other connections except a client connected to a router wirelessly(internet).

No firewall on both computers.

SERVER:

dhcpd.conf slightly changed:

```

#option domain-name "localhost";

ddns-update-style interim;   

#interim for dynamic DNS

#ignore client-updates;

authoritative;

#subnet 10.152.187.0 netmask 255.255.255.0 {

#}

subnet 10.0.0.0 netmask 255.255.255.0 {

  interface eth0;

  option domain-name-servers 10.0.0.130;

  option routers 10.0.0.1;

  range 10.0.0.10 10.0.0.20;

#  option ip-forwarding off;

  option broadcast-address 10.0.0.255;

  option subnet-mask 255.255.255.0;

  default-lease-time 600;

  max-lease-time 7200;

}

```

output of ifconfig -a:

```

eth0      Link encap:Ethernet  HWaddr ...  

          inet addr:10.0.0.0  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::223:54ff:fef5:24b5/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:7 errors:0 dropped:0 overruns:0 frame:0

          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:987 (987.0 B)  TX bytes:1278 (1.2 KiB)

          Interrupt:18 

eth1      Link encap:Ethernet  HWaddr ...  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:17 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:49 errors:0 dropped:0 overruns:0 frame:0

          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:4708 (4.5 KiB)  TX bytes:4708 (4.5 KiB)

```

output of route -n:

```

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0

127.0.0.0       -               255.0.0.0       !     0      -        0 -

127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo

0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 eth0

```

cat /etc/exports, slightly changed from 10.0.0.0/255.255.255.0 to * :

```

/home/user1 *(async,rw,no_root_squash,no_subtree_check)

```

CLIENT:

output of ifconfig -a:

```

eth0      Link encap:Ethernet  HWaddr ...  

          inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:5 errors:0 dropped:0 overruns:0 frame:0

          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:864 (864.0 B)  TX bytes:897 (897.0 B)

          Interrupt:16 Base address:0x6000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:48 errors:0 dropped:0 overruns:0 frame:0

          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:3168 (3.0 KiB)  TX bytes:3168 (3.0 KiB)

pan0      Link encap:Ethernet  HWaddr ...  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr ...  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr ...

          UP RUNNING  MTU:0  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```

output of route -n:

```

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.0.0.0        0.0.0.0         255.255.255.0   U     1      0        0 eth0

127.0.0.0       -               255.0.0.0       !     0      -        0 -

127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo

0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 eth0

```

----------

## Veldrin

your server has an invalid address: 10.0.0.0/24 is a network, an not a host address

use something like 10.0.0.2 as address for the server. (10.0.0.1 is already occupied by the router)

an change all server-related ip-addresses.

cheers

V.

----------

## richard.scott

you can't have an IP address 10.0.0.0 on an interface for your server config.

10.0.0.0 is a network address and not a routable IP address.

See: http://www2.entropy.ch/download/subnetting-table.pdf

Hope that helps,

Rich

----------

## richard.scott

LOL Veldrin... you beat me to it   :Embarassed: 

----------

## Veldrin

 *richard.scott wrote:*   

> LOL Veldrin... you beat me to it  

 You cannot win always. Normally I am the slow one...   :Laughing: 

----------

## csim

Thanks Veldrin & richard.scott! (and of course Anarcho & HeissFuss too)  :Very Happy: 

I only changed the following, after server restart i did:

```

ifconfig eth0 10.0.0.1 netmask 255.255.255.0 up 

```

and now i'm able to ping client from server and viceversa, ssh and rsync works.

Running showmount -e on client shows contents of /etc/exports.

However running:

```

mount -t nfs 10.0.0.1:/home/user1 /some/empty/dir

```

stalls and does nothing, i kept it running for a while but nothing happened.

EDIT: i forgot to run nfs and rpcbind services on client sorry   :Embarassed: 

Thanks everyone!

----------

