奇怪的是我无法检查 nfs 服务器的 showmount。但我可以连接到 nfs 客户端。 我可以从客户端在安装点读取和写入文件
# mounting in client
mount -t nfs 100.96.0.16:/delme /root/tmp
这是所有可能的配置
在服务器中:/etc/exports
/delme 100.96.0.0/12(rw,async,no_root_squash,insecure,anonuid=1000,anongid=1000)
服务器中的 ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 ****1 scopeid 0x20<link>
inet6 ****1 prefixlen 112 scopeid 0x0<global>
ether 00:16:3e:c1:29:a2 txqueuelen 1000 (Ethernet)
RX packets 16592 bytes 2976190 (2.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8357 bytes 1480084 (1.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 40 bytes 2716 (2.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 2716 (2.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
warp: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1400
inet 172.16.0.2 netmask 255.255.255.255 destination 172.16.0.2
inet6 2606:4700:110:8c25:8c68:2998:abd9:bb8e prefixlen 128 scopeid 0x0<global>
inet6 fe80::991c:c43c:5ac9:a519 prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 276 bytes 38332 (38.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 236 bytes 30651 (30.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
客户端中的 ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 ***2 prefixlen 64 scopeid 0x20<link>
inet6 ***2 prefixlen 112 scopeid 0x0<global>
ether 00:16:3e:02:e7:57 txqueuelen 1000 (Ethernet)
RX packets 14726 bytes 2491233 (2.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7028 bytes 1170140 (1.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 80 bytes 7360 (7.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 80 bytes 7360 (7.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
warp: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1400
inet 172.16.0.2 netmask 255.255.255.255 destination 172.16.0.2
inet6 2606:4700:110:8ec1:dda1:c327:5e42:f963 prefixlen 128 scopeid 0x0<global>
inet6 fe80::1101:189e:d0dc:edae prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 281 bytes 53356 (53.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 385 bytes 42565 (42.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
请注意,我正在使用VPN 零信任 Cloudflare
网络状态图grep 远程过程调用
tcp 0 0 0.0.0.0:41783 0.0.0.0:* LISTEN 3947/rpc.mountd
tcp 0 0 0.0.0.0:50045 0.0.0.0:* LISTEN 3947/rpc.mountd
tcp 0 0 0.0.0.0:56385 0.0.0.0:* LISTEN 3947/rpc.mountd
tcp6 0 0 :::53185 :::* LISTEN 3947/rpc.mountd
tcp6 0 0 :::55553 :::* LISTEN 3947/rpc.mountd
tcp6 0 0 :::41201 :::* LISTEN 3947/rpc.mountd
udp 0 0 0.0.0.0:40165 0.0.0.0:* 3947/rpc.mountd
udp 0 0 0.0.0.0:44333 0.0.0.0:* 3947/rpc.mountd
udp 0 0 0.0.0.0:42809 0.0.0.0:* 3947/rpc.mountd
udp6 0 0 :::53483 :::* 3947/rpc.mountd
udp6 0 0 :::49717 :::* 3947/rpc.mountd
udp6 0 0 :::44615 :::* 3947/rpc.mountd
奇怪的是,当我使用公共 IPv6 访问它时,它返回客户端中 showmount 的结果
root@client:~/tmp# showmount -e 100.96.0.16
rpc mount export: RPC: Unable to receive; errno = Connection refused
root@client:~/tmp# showmount -e <my server public ipv6>
Export list for <my server public ipv6>:
/delme 100.96.0.0/12
root@client:~/tmp# ls /root/tmp
this_file_was_generated_from_server
root@client:~/tmp# touch foo && ls /root/tmp
foo this_file_was_generated_from_server
root@client:~/tmp#
请注意,由于我在名为的接口中使用零信任经来自与相关的cloudflare172.16.0.2:
- 100.96.0.16是服务器的私有IP
- 100.96.0.17 是客户端的私有IP
因此我可以从客户端 ping 服务器:
root@client:~# ping 100.96.0.16 -I 172.16.0.2
PING 100.96.0.16 (100.96.0.16) 56(84) bytes of data.
64 bytes from 100.96.0.16: icmp_seq=1 ttl=62 time=19.6 ms
64 bytes from 100.96.0.16: icmp_seq=2 ttl=62 time=13.5 ms
64 bytes from 100.96.0.16: icmp_seq=3 ttl=62 time=13.6 ms
64 bytes from 100.96.0.16: icmp_seq=4 ttl=62 time=13.2 ms
客户端中的 RPC 信息
root@client:~/tmp# 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