Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have my nfs server running on 192.168.1.99 box, and I have my /etc/exports configured using

/myshare 192.168.1.*(rw,sync,no_subtree_check)

I was able to mount nfs from 192.168.1.50 client box.

However I was unable to mount from 192.168.1.49! ("mount.nfs mount(2) permission denied" followed by "mount.nfs access denied by server while mounting")

Then I found that I can make connection if I change client's ip to 192.168.1.48

Finally, I was able to make it work by using 192.168.1.0/24 instead of 192.168.1.*

Could anybody explain why 192.168.1.0/24 works for 192.168.1.49, but 192.168.1.* does not?

    netmask 255.255.255.0
    network 192.168.1.0

... I'm not an administrator, and I have weak understanding of subnets... Ubuntu64, 12.04...

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Please refer to the manpage of exports(5):

Machine Name Formats
NFS clients may be specified in a number of ways:

[...]

IP networks
    You  can  also  export  directories  to  all hosts on an IP (sub-) network
    simultaneously. This is done by specifying an IP address and netmask  pair
    as  address/netmask  where  the netmask can be specified in dotted-decimal
    format,  or  as  a  contiguous   mask   length.    For   example,   either
    `/255.255.252.0'  or  `/22'  appended  to  the  network  base IPv4 address
    results in identical subnetworks with 10 bits of host. [...]
    Wildcard characters generally  do  not  work on IP addresses, though they
    may work by accident when reverse DNS lookups fail.

wildcards
    Machine names may contain the wildcard characters * and ?, or may  contain
    character  class lists within [square brackets].  This can be used to make
    the exports file more compact;  for  instance,  *.cs.foo.edu  matches  all
    hosts  in  the domain cs.foo.edu.  As these characters also match the dots
    in a domain name, the given pattern will also match all hosts  within  any
    subdomain of cs.foo.edu.

This simply means you're configuring it wrong in the line

/myshare 192.168.1.*(rw,sync,no_subtree_check)

Wildcards can be used in hostnames, for specifying IP networks, you need to use dotted-decimal IP addresses and an optional subnet size. The reverse IP-lookup story above could explain why it worked for a specific address.

share|improve this answer
    
192.168.1.* worked for 192.168.1.50, nslookup 192.168.1.50 returns server can't find 50.1.168.192.in-addr.arpa.: NXDOMAIN (run on NFS server). Same thing with 192.16.1.49 –  Yevgen Yampolskiy Dec 11 '12 at 12:21
    
Also 192.168.1.* worked for 192.168.1.48 –  Yevgen Yampolskiy Dec 11 '12 at 12:21
    
'may work by accident' is a strange wording –  Yevgen Yampolskiy Dec 11 '12 at 12:24
    
You're hitting undefined behaviour by not following documentation. Besides, nslookup is not the same as standard libc resolving (e.g. does not use /etc/hosts). –  gertvdijk Dec 11 '12 at 12:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.