Jump to content
Калькуляторы

nfs clent openwrt -server debian(или ubutnu)

Просидел неделю не могу клиента и сервер соединить

route на сервере

 

root@r:~# route
Kernel IP routing table server
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         ser.mshome.net  0.0.0.0         UG    100    0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     100    0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     101    0        0 eth1

ip server 192.168.1.2, ip clenta 192.168.1.1

client
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
root@client:~#

root@r:/etc/init.d# exportfs -rav
exporting *:/home/nfs4
exporting *:/home/nfs
root@r:/etc/init.d#

root@r:/etc/init.d# showmount -e 192.168.1.2
Export list for 192.168.1.2:
/home/nfs4 *
/home/nfs  *

root@r:/etc/init.d# showmount -e 192.168.1.1
clnt_create: RPC: Unable to receive

запустил в ручную portmap
root@r:/etc/init.d# showmount -e 192.168.1.1
clnt_create: RPC: Program not registered
с стороны клиента
root@client:/usr/sbin# showmount -e 192.168.1.1
clnt_create: RPC: Program not registered

root@client:/usr/sbin# showmount -e 192.168.1.2
Export list for 192.168.1.2:
/home/nfs4 *
/home/nfs  *

файл hosts на клиенте
root@client:/etc# cat hosts
127.0.0.1 localhost
192.168.1.1 client
192.168.1.2 r

на сервере

127.0.0.1    localhost
#127.0.1.1    r
192.168.1.2     r
192.168.1.1     client

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

запуск на сервере

root@r:/etc/init.d# mount -t nfs4 -o nolock 192.168.1.1:/home/nfs4/ /home/nfs4/ -vvv
mount.nfs4: timeout set for Mon Oct 21 16:33:57 2019
mount.nfs4: trying text-based options 'nolock,vers=4.2,addr=192.168.1.1,clientaddr=192.168.1.2'
mount.nfs4: mount(2): Connection refused
mount.nfs4: trying text-based options 'nolock,addr=192.168.1.1'
mount.nfs4: prog 100003, trying vers=3, prot=6
mount.nfs4: portmap query retrying: RPC: Program not registered
mount.nfs4: prog 100003, trying vers=3, prot=17
mount.nfs4: portmap query failed: RPC: Program not registered
mount.nfs4: requested NFS version or transport protocol is not supported


запуск на клиенте
root@client:/sbin# mount -t nfs4 -o nolock 192.168.1.2:/home/nfs4/ /home/nfs4/ -
vvv
mount.nfs4: No such device
mount: mounting 192.168.1.2:/home/nfs4/ on /home/nfs4/ failed: No such device
root@client:/sbin# mount.nfs4 -o nolock 192.168.1.2:/home/nfs4/ /home/nfs4/ -vvv
mount.nfs4: timeout set for Thu Sep  8 17:41:11 2011
mount.nfs4: trying text-based options 'nolock,addr=192.168.1.2,clientaddr=192.168.1.1'
mount.nfs4: mount(2): No such device
mount.nfs4: No such device

root@r:/etc/init.d# rpcinfo
   program version netid     address                service    owner
    100000    4    tcp6      ::.0.111               portmapper superuser
    100000    3    tcp6      ::.0.111               portmapper superuser
    100000    4    udp6      ::.0.111               portmapper superuser
    100000    3    udp6      ::.0.111               portmapper superuser
    100000    4    tcp       0.0.0.0.0.111          portmapper superuser
    100000    3    tcp       0.0.0.0.0.111          portmapper superuser
    100000    2    tcp       0.0.0.0.0.111          portmapper superuser
    100000    4    udp       0.0.0.0.0.111          portmapper superuser
    100000    3    udp       0.0.0.0.0.111          portmapper superuser
    100000    2    udp       0.0.0.0.0.111          portmapper superuser
    100000    4    local     /run/rpcbind.sock      portmapper superuser
    100000    3    local     /run/rpcbind.sock      portmapper superuser
    100005    1    udp       0.0.0.0.147.17         mountd     superuser
    100005    1    tcp       0.0.0.0.202.45         mountd     superuser
    100005    1    udp6      ::.237.156             mountd     superuser
    100005    1    tcp6      ::.151.11              mountd     superuser
    100005    2    udp       0.0.0.0.206.119        mountd     superuser
    100005    2    tcp       0.0.0.0.132.71         mountd     superuser
    100005    2    udp6      ::.222.149             mountd     superuser
    100005    2    tcp6      ::.169.71              mountd     superuser
    100005    3    udp       0.0.0.0.172.26         mountd     superuser
    100005    3    tcp       0.0.0.0.205.91         mountd     superuser
    100005    3    udp6      ::.199.204             mountd     superuser
    100005    3    tcp6      ::.199.175             mountd     superuser
    100003    3    tcp       0.0.0.0.8.1            nfs        superuser
    100003    4    tcp       0.0.0.0.8.1            nfs        superuser
    100003    3    udp       0.0.0.0.8.1            nfs        superuser
    100003    3    tcp6      ::.8.1                 nfs        superuser
    100003    4    tcp6      ::.8.1                 nfs        superuser
    100003    3    udp6      ::.8.1                 nfs        superuser
    100021    1    udp       0.0.0.0.217.191        nlockmgr   superuser
    100021    3    udp       0.0.0.0.217.191        nlockmgr   superuser
    100021    4    udp       0.0.0.0.217.191        nlockmgr   superuser
    100021    1    tcp       0.0.0.0.171.111        nlockmgr   superuser
    100021    3    tcp       0.0.0.0.171.111        nlockmgr   superuser
    100021    4    tcp       0.0.0.0.171.111        nlockmgr   superuser
    100021    1    udp6      ::.159.47              nlockmgr   superuser
    100021    3    udp6      ::.159.47              nlockmgr   superuser
    100021    4    udp6      ::.159.47              nlockmgr   superuser
    100021    1    tcp6      ::.163.9               nlockmgr   superuser
    100021    3    tcp6      ::.163.9               nlockmgr   superuser
    100021    4    tcp6      ::.163.9               nlockmgr   superuser

запуск на сервере
mount -t nfs4 -o nolock 192.168.1.1:/home/nfs4/ /home/nfs4/ -vvv
mount.nfs4: timeout set for Mon Oct 21 17:09:07 2019
mount.nfs4: trying text-based options 'nolock,vers=4.2,addr=192.168.1.1,clientaddr=192.168.1.2'
mount.nfs4: mount(2): Connection refused
mount.nfs4: trying text-based options 'nolock,addr=192.168.1.1'
mount.nfs4: prog 100003, trying vers=3, prot=6
mount.nfs4: portmap query retrying: RPC: Program not registered
mount.nfs4: prog 100003, trying vers=3, prot=17
mount.nfs4: portmap query failed: RPC: Program not registered
mount.nfs4: requested NFS version or transport protocol is not supported
root@r:/etc/init.d#

запуск с стороны клиента

root@r:/etc/init.d# nfsstat
Server rpc stats:
calls      badcalls   badfmt     badauth    badclnt
61         2          2          0          0      

Server nfs v3:
null             getattr          setattr          lookup           access          
4        16%     6        24%     0         0%     4        16%     2         8%    
readlink         read             write            create           mkdir            
0         0%     0         0%     0         0%     0         0%     0         0%    
symlink          mknod            remove           rmdir            rename          
0         0%     0         0%     0         0%     0         0%     0         0%    
link             readdir          readdirplus      fsstat           fsinfo          
0         0%     0         0%     0         0%     3        12%     4        16%    
pathconf         commit          
2         8%     0         0%    

Server nfs v4:
null             compound        
2         5%     34       94%    

Server nfs v4 operations:
op0-unused       op1-unused       op2-future       access           close            
0         0%     0         0%     0         0%     2         2%     0         0%    
commit           create           delegpurge       delegreturn      getattr          
0         0%     0         0%     0         0%     0         0%     18       21%    
getfh            link             lock             lockt            locku            
2         2%     0         0%     0         0%     0         0%     0         0%    
lookup           lookup_root      nverify          open             openattr        
2         2%     0         0%     0         0%     0         0%     0         0%    
open_conf        open_dgrd        putfh            putpubfh         putrootfh        
0         0%     0         0%     18       21%     0         0%     4         4%    
read             readdir          readlink         remove           rename          
0         0%     0         0%     0         0%     0         0%     0         0%    
renew            restorefh        savefh           secinfo          setattr          
0         0%     0         0%     0         0%     0         0%     0         0%    
setcltid         setcltidconf     verify           write            rellockowner    
0         0%     0         0%     0         0%     0         0%     0         0%    
bc_ctl           bind_conn        exchange_id      create_ses       destroy_ses      
0         0%     0         0%     4         4%     2         2%     2         2%    
free_stateid     getdirdeleg      getdevinfo       getdevlist       layoutcommit    
0         0%     0         0%     0         0%     0         0%     0         0%    
layoutget        layoutreturn     secinfononam     sequence         set_ssv          
0         0%     0         0%     2         2%     24       28%     0         0%    
test_stateid     want_deleg       destroy_clid     reclaim_comp     allocate        
0         0%     0         0%     2         2%     2         2%     0         0%    
copy             copy_notify      deallocate       ioadvise         layouterror      
0         0%     0         0%     0         0%     0         0%     0         0%    
layoutstats      offloadcancel    offloadstatus    readplus         seek            
0         0%     0         0%     0         0%     0         0%     0         0%    
write_same      
0         0%    

Client rpc stats:
calls      retrans    authrefrsh
62         0          62      

Client nfs v3:
null             getattr          setattr          lookup           access          
2         8%     6        26%     0         0%     4        17%     2         8%    
readlink         read             write            create           mkdir            
0         0%     0         0%     0         0%     0         0%     0         0%    
symlink          mknod            remove           rmdir            rename          
0         0%     0         0%     0         0%     0         0%     0         0%    
link             readdir          readdirplus      fsstat           fsinfo          
0         0%     0         0%     0         0%     3        13%     4        17%    
pathconf         commit          
2         8%     0         0%    

Client nfs v4:
null             read             write            commit           open            
5        12%     0         0%     0         0%     0         0%     0         0%    
open_conf        open_noat        open_dgrd        close            setattr          
0         0%     0         0%     0         0%     0         0%     0         0%    
fsinfo           renew            setclntid        confirm          lock            
4        10%     0         0%     0         0%     0         0%     0         0%    
lockt            locku            access           getattr          lookup          
0         0%     0         0%     2         5%     2         5%     2         5%    
lookup_root      remove           rename           link             symlink          
2         5%     0         0%     0         0%     0         0%     0         0%    
create           pathconf         statfs           readlink         readdir          
0         0%     2         5%     0         0%     0         0%     0         0%    
server_caps      delegreturn      getacl           setacl           fs_locations    
6        15%     0         0%     0         0%     0         0%     0         0%    
rel_lkowner      secinfo          fsid_present     exchange_id      create_session  
0         0%     0         0%     0         0%     4        10%     2         5%    
destroy_session  sequence         get_lease_time   reclaim_comp     layoutget        
2         5%     0         0%     0         0%     2         5%     0         0%    
getdevinfo       layoutcommit     layoutreturn     secinfo_no       test_stateid    
0         0%     0         0%     0         0%     2         5%     0         0%    
free_stateid     getdevicelist    bind_conn_to_ses destroy_clientid seek            
0         0%     0         0%     0         0%     2         5%     0         0%    
allocate         deallocate       layoutstats      clone            
0         0%     0         0%     0         0%     0         0%    

root@r:/etc/init.d#

root@r:/etc/init.d# rpcinfo -p 192.168.1.2
   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
    100005    1   udp  37649  mountd
    100005    1   tcp  51757  mountd
    100005    2   udp  52855  mountd
    100005    2   tcp  33863  mountd
    100005    3   udp  44058  mountd
    100005    3   tcp  52571  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp  55743  nlockmgr
    100021    3   udp  55743  nlockmgr
    100021    4   udp  55743  nlockmgr
    100021    1   tcp  43887  nlockmgr
    100021    3   tcp  43887  nlockmgr
    100021    4   tcp  43887  nlockmgr
root@r:/etc/init.d#

root@r:/etc/init.d# rpcinfo -p 192.168.1.1
   program vers proto   port  service
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper

root@client:/# rpcinfo -p 192.168.1.1
-ash: rpcinfo: not found
root@client:/# rpcinfo -p 192.168.1.2
-ash: rpcinfo: not found
root@client:/#


    100021    1   udp  55743  nlockmgr
    100021    3   udp  55743  nlockmgr
    100021    4   udp  55743  nlockmgr
    100021    1   tcp  43887  nlockmgr
    100021    3   tcp  43887  nlockmgr
    100021    4   tcp  43887  nlockmgr
root@r:/etc/init.d#

root@r:/etc/init.d# rpcinfo -p 192.168.1.1
   program vers proto   port  service
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper

root@client:/# rpcinfo -p 192.168.1.1
-ash: rpcinfo: not found
root@client:/# rpcinfo -p 192.168.1.2
-ash: rpcinfo: not found
root@client:/#

 

 

Edited by ffs1980.

Share this post


Link to post
Share on other sites

Кто ж по root к экспортированной системе подключается? Сделайте отдельного юзера. Или гуглите no_root_squash

Share this post


Link to post
Share on other sites

точка доступа на openwrt, добавить просто пользователя там нет такой возможности, только смена пароля.

Share this post


Link to post
Share on other sites

Сервер монтирует клиента, а клиент монтирует сервер? Вы себе представляете что это так работает?

Share this post


Link to post
Share on other sites

клиент к серверу это понятно, обратное делал только для статистики. Перебрал всё никак не работает.

Share this post


Link to post
Share on other sites
mount.nfs4: No such device
root@client:/usr/sbin# showmount -e 192.168.1.1
clnt_create: RPC: Program not registered

ошибка тут должна, но по интернету перелазил и не помогло.

Share this post


Link to post
Share on other sites
/home/nfs/ *(ro,async,all_squash,no_subtree_check)

/home/nfs4/ *(ro,sync,all_squash,fsid=0,crossmnt,no_subtree_check)
root@r:/etc/init.d# rpcinfo -p 192.168.1.1
   program vers proto   port  service
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
root@r:/etc/init.d# showmount -e 192.168.1.1
clnt_create: RPC: Program not registered
root@r:/etc/init.d# rpcinfo -p 192.168.1.2
   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
    100005    1   udp  36364  mountd
    100005    1   tcp  44195  mountd
    100005    2   udp  43950  mountd
    100005    2   tcp  36787  mountd
    100005    3   udp  60716  mountd
    100005    3   tcp  39633  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp  43848  nlockmgr
    100021    3   udp  43848  nlockmgr
    100021    4   udp  43848  nlockmgr
    100021    1   tcp  41023  nlockmgr
    100021    3   tcp  41023  nlockmgr
    100021    4   tcp  41023  nlockmgr
root@r:/etc/init.d# 

на клиенте


root@client:/usr/sbin# lsmod
Module                  Size  Used by    Tainted: G  
nf_nat_irc               784  0 
nf_conntrack_irc        2464  1 nf_nat_irc
nf_nat_ftp               976  0 
nf_conntrack_ftp        4416  1 nf_nat_ftp
ipt_MASQUERADE           976  1 
iptable_nat             2544  1 
nf_nat                 10384  4 nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat
pppoe                   8240  0 
xt_conntrack            2064  3 
xt_CT                   1424  0 
xt_NOTRACK               528  0 
iptable_raw              560  1 
xt_state                 608  0 
nf_conntrack_ipv4       4464  6 iptable_nat,nf_nat
nf_defrag_ipv4           656  1 nf_conntrack_ipv4
nf_conntrack           40448 12 nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_conntrack,xt_CT,xt_NOTRACK,xt_state,nf_conntrack_ipv4
pppox                   1152  1 pppoe
ipt_REJECT              1712  2 
xt_TCPMSS               2528  0 
ipt_LOG                 6064  0 
xt_comment               400  0 
xt_multiport            1104  0 
xt_mac                   528  0 
xt_limit                 992  0 
iptable_mangle           816  1 
iptable_filter           592  1 
ip_tables               8880  4 iptable_nat,iptable_raw,iptable_mangle,iptable_filter
xt_tcpudp               1600  1 
x_tables                9936 18 ipt_MASQUERADE,iptable_nat,xt_conntrack,xt_CT,xt_NOTRACK,iptable_raw,xt_state,ipt_REJECT,xt_TCPMSS,ipt_LOG,xt_comment,xt_multiport,xt_mac,xt_limit,iptable_mangle,iptable_filter,ip_tables,xt_tcpudp
ppp_async               7136  0 
ppp_generic            19648  3 pppoe,pppox,ppp_async
slhc                    3984  1 ppp_generic
lockd                  56704  0 
sunrpc                162752  1 lockd
hfs                    39232  0 
ath5k                 143856  0 
ath                    15376  1 ath5k
mac80211              264576  1 ath5k
nls_base                4688  1 hfs
crc_ccitt                944  1 ppp_async
exportfs                2608  0 
cfg80211              155696  3 ath5k,ath,mac80211
compat                  5872  3 ath5k,mac80211,cfg80211
arc4                     768  2 
aes_generic            31536  0 
crypto_algapi           9264  2 arc4,aes_generic
root@client:/usr/sbin# lsmod
Module                  Size  Used by    Tainted: G  
nf_nat_irc               784  0 
nf_conntrack_irc        2464  1 nf_nat_irc
nf_nat_ftp               976  0 
nf_conntrack_ftp        4416  1 nf_nat_ftp
ipt_MASQUERADE           976  1 
iptable_nat             2544  1 
nf_nat                 10384  4 nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat
pppoe                   8240  0 
xt_conntrack            2064  3 
xt_CT                   1424  0 
xt_NOTRACK               528  0 
iptable_raw              560  1 
xt_state                 608  0 
nf_conntrack_ipv4       4464  6 iptable_nat,nf_nat
nf_defrag_ipv4           656  1 nf_conntrack_ipv4
nf_conntrack           40448 12 nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_conntrack,xt_CT,xt_NOTRACK,xt_state,nf_conntrack_ipv4
pppox                   1152  1 pppoe
ipt_REJECT              1712  2 
xt_TCPMSS               2528  0 
ipt_LOG                 6064  0 
xt_comment               400  0 
xt_multiport            1104  0 
xt_mac                   528  0 
xt_limit                 992  0 
iptable_mangle           816  1 
iptable_filter           592  1 
ip_tables               8880  4 iptable_nat,iptable_raw,iptable_mangle,iptable_filter
xt_tcpudp               1600  1 
x_tables                9936 18 ipt_MASQUERADE,iptable_nat,xt_conntrack,xt_CT,xt_NOTRACK,iptable_raw,xt_state,ipt_REJECT,xt_TCPMSS,ipt_LOG,xt_comment,xt_multiport,xt_mac,xt_limit,iptable_mangle,iptable_filter,ip_tables,xt_tcpudp
ppp_async               7136  0 
ppp_generic            19648  3 pppoe,pppox,ppp_async
slhc                    3984  1 ppp_generic
lockd                  56704  0 
sunrpc                162752  1 lockd
hfs                    39232  0 
ath5k                 143856  0 
ath                    15376  1 ath5k
mac80211              264576  1 ath5k
nls_base                4688  1 hfs
crc_ccitt                944  1 ppp_async
exportfs                2608  0 
cfg80211              155696  3 ath5k,ath,mac80211
compat                  5872  3 ath5k,mac80211,cfg80211
arc4                     768  2 
aes_generic            31536  0 
crypto_algapi           9264  2 arc4,aes_generic
root@client:/usr/sbin# 

 

 

Edited by ffs1980.

Share this post


Link to post
Share on other sites
12 часов назад, ffs1980. сказал:

mount.nfs4: No such device

root@client:/usr/sbin# showmount -e 192.168.1.1
clnt_create: RPC: Program not registered

ошибка тут должна, но по интернету перелазил и не помогло.

Могу ошибаться, но обычно такая ошибка выдается юзерспейсу когда не загружен нужный модуль ядра Linux. Возможно у в вашей сборке OpenWRT небыли собраны все нужные модули ядра.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this