Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有人成功穿透挂载过nfs吗 #512

Open
Layty opened this issue Apr 18, 2020 · 1 comment
Open

有人成功穿透挂载过nfs吗 #512

Layty opened this issue Apr 18, 2020 · 1 comment

Comments

@Layty
Copy link

Layty commented Apr 18, 2020

nfs内网穿透失败记录

修改nfs的固定端口

sudo vim /etc/sysctl.conf

fs.nfs.nlm_udpport=30104
fs.nfs.nlm_tcpport=30105

sudo vim   /etc/services
mountd 30100/tcp
mountd 30101/udp
rquotad 30102/tcp
rquotad 30103/udp

重启服务

sudo /etc/init.d/rpcbind restart 
sudo /etc/init.d/nfs-kernel-server restart

端口查看

vmuser@ubuntu:~$ rpcinfo -p
   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  30101  mountd
    100005    1   tcp  30100  mountd
    100005    2   udp  30101  mountd
    100005    2   tcp  30100  mountd
    100005    3   udp  30101  mountd
    100005    3   tcp  30100  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049
    100003    3   udp   2049  nfs
    100227    3   udp   2049
    100021    1   udp  30104  nlockmgr
    100021    3   udp  30104  nlockmgr
    100021    4   udp  30104  nlockmgr
    100021    1   tcp  30105  nlockmgr
    100021    3   tcp  30105  nlockmgr
    100021    4   tcp  30105  nlockmgr

端口映射

31 6 tcp 32049 0.0.0.0:2049 open open online
32 6 tcp 31111 0.0.0.0:1111 open open online
33 6 tcp 30100 0.0.0.0:30100 open open online
34 6 tcp 30101 0.0.0.0:30101 open open online
35 6 tcp 30102 0.0.0.0:30102 open open online
36 6 tcp 30103 0.0.0.0:30102 open open online
37 6 tcp 30104 0.0.0.0:30104 open open online
38 6 tcp 30105 0.0.0.0:30105 open open online
40 6 tcp 111 0.0.0.0:111 open open online
41 6 udp 111 0.0.0.0:111 open open online
43 6 udp 30101 0.0.0.0:30101 open open online
46 6 udp 32049 0.0.0.0:2049 open open online
47 6 udp 30104 0.0.0.0:30104 open open online

本地挂载成功


	
本地挂载成功	
vmuser@ubuntu:~/work$ sudo mount -v  -t nfs  -o mountport=30101 -o port=2049  192.168.1.153:/work ./test
mount.nfs: timeout set for Fri Apr 17 19:46:15 2020
mount.nfs: trying text-based options 'mountport=30101,port=2049,vers=4.2,addr=192.168.1.153,clientaddr=192.168.1.170'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'mountport=30101,port=2049,addr=192.168.1.153'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.153 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.1.153 prog 100005 vers 3 prot UDP port 30101

远程还是失败了

远程挂载
vmuser@ubuntu:~/work$ sudo mount -v  -t nfs  -o mountport=30101 -o port=2049  我的ip:/work ./my/
mount.nfs: timeout set for Fri Apr 17 20:04:01 2020
mount.nfs: trying text-based options 'mountport=30101,port=2049,vers=4.2,addr=我的ip,clientaddr=192.168.1.170'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'mountport=30101,port=2049,addr=101.37.20.75'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 我的ip prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 我的ip prog 100005 vers 3 prot UDP port 30101
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 我的ip.xyz:111/work

@Layty Layty added the bug Something isn't working label Apr 18, 2020
@ffdfgdfg ffdfgdfg removed the bug Something isn't working label May 7, 2020
@zsio
Copy link

zsio commented Jul 16, 2020

是否可以尝试使用 ssh隧道进行端口影射,然后连接本地端口?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants