NFS服务器设置:192.168.1.0/24 vs 192.168.1。*

我有我的nfs服务器运行在192.168.1.99框,我有我的/ etc / exportsconfiguration使用

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

我能够从192.168.1.50客户端安装nfs。

但是我无法从192.168.1.49安装! (“mount.nfs mount(2)权限被拒绝”,后面跟着“mount.nfs访问被服务器挂载时拒绝”)

然后我发现我可以连接,如果我更改客户端的IP到192.168.1.48

最后,我能够通过使用192.168.1.0/24而不是192.168.1.*来使它工作192.168.1.*

有谁可以解释为什么192.168.1.0/24192.168.1.49 ,但192.168.1.*不?

  netmask 255.255.255.0 network 192.168.1.0 

…我不是pipe理员,我对子网了解不够… Ubuntu64,12.04 …

请参阅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. 

这只是意味着你正在configuration错误的行

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

通配符可用于主机名,用于指定IPnetworking,您需要使用点分十进制IP地址和可选的子网大小。 上面的反向IP查询故​​事可以解释为什么它为一个特定的地址工作。