NFS 服务器 IP 为 192.168.0.70,NFS 客户端 IP 为 192.168.0.84。
我的/etc/exports
文件是这样的:
/my/share/dir 192.168.0.84(ro,sync,no_subtree_check)
我使用下面的推荐来安装:
sudo mount -t nfs 192.168.0.70:/my/share/dir /mnt/my_mount
错误信息是:
username@client84:~$ sudo mount -t nfs 192.168.0.70:/src_dir/ /home/username/mount_point/
mount.nfs: Connection timed out
NFS serverm 的状态为:
username@server70:~$ systemctl status nfs-kernel-server.service
● nfs-kernel-server.service - LSB: Kernel NFS server support
Loaded: loaded (/etc/init.d/nfs-kernel-server)
Active: active (exited) since Wed 2020-01-08 15:04:49 CST; 19h ago
Process: 7199 ExecStop=/etc/init.d/nfs-kernel-server stop (code=exited, status=0/SUCCESS)
Process: 7209 ExecStart=/etc/init.d/nfs-kernel-server start (code=exited, status=0/SUCCESS)
我在 NFS 服务器上尝试了捕获包,这就是我得到的:
15:09:43.563798 IP (tos 0x0, ttl 64, id 54562, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.760 > 192.168.0.70.2049: Flags [S], cksum 0x794a (correct), seq 1313175943, win 29200, options [mss 1460,sackOK,TS val 3280514213 ecr 0,nop,wscale 7], length 0
15:09:43.563826 IP (tos 0x0, ttl 64, id 24797, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.760: Flags [R.], cksum 0xc358 (correct), seq 0, ack 1313175944, win 0, length 0
15:09:44.564453 IP (tos 0x0, ttl 64, id 3109, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.926 > 192.168.0.70.2049: Flags [S], cksum 0xdeea (correct), seq 3201409466, win 29200, options [mss 1460,sackOK,TS val 3280514463 ecr 0,nop,wscale 7], length 0
15:09:44.564485 IP (tos 0x0, ttl 64, id 24971, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.926: Flags [R.], cksum 0x29f3 (correct), seq 0, ack 3201409467, win 0, length 0
15:09:46.565080 IP (tos 0x0, ttl 64, id 20545, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.979 > 192.168.0.70.2049: Flags [S], cksum 0xef6c (correct), seq 1309605842, win 29200, options [mss 1460,sackOK,TS val 3280514963 ecr 0,nop,wscale 7], length 0
15:09:46.565101 IP (tos 0x0, ttl 64, id 25141, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.979: Flags [R.], cksum 0x3c69 (correct), seq 0, ack 1309605843, win 0, length 0
15:09:48.565600 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.70 tell 192.168.0.84, length 46
15:09:48.565630 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.0.70 is-at aa:bb:cc:dd:ee:ff, length 28
15:09:50.565751 IP (tos 0x0, ttl 64, id 27321, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.861 > 192.168.0.70.2049: Flags [S], cksum 0x3093 (correct), seq 797104581, win 29200, options [mss 1460,sackOK,TS val 3280515964 ecr 0,nop,wscale 7], length 0
15:09:50.565779 IP (tos 0x0, ttl 64, id 25423, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.861: Flags [R.], cksumARP 0x8178 (correct), seq 0, ack 797104582, win 0, length 0
15:09:55.579799 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.84 tell 192.168.0.70, length 28
15:09:55.580001 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.0.84 is-at aa:bb:cc:dd:ee:ff, length 46
15:09:58.566416 IP (tos 0x0, ttl 64, id 36260, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.959 > 192.168.0.70.2049: Flags [S], cksum 0x15eb (correct), seq 3839178472, win 29200, options [mss 1460,sackOK,TS val 3280517964 ecr 0,nop,wscale 7], length 0
15:09:58.566449 IP (tos 0x0, ttl 64, id 26424, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.959: Flags [R.], cksum 0x6ea0 (correct), seq 0, ack 3839178473, win 0, length 0
15:10:08.567151 IP (tos 0x0, ttl 64, id 40969, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.889 > 192.168.0.70.2049: Flags [S], cksum 0x067e (correct), seq 3163776281, win 29200, options [mss 1460,sackOK,TS val 3280520464 ecr 0,nop,wscale 7], length 0
15:10:08.567203 IP (tos 0x0, ttl 64, id 26636, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.889: Flags [R.], cksum 0x68f7 (correct), seq 0, ack 3163776282, win 0, length 0
15:10:18.567873 IP (tos 0x0, ttl 64, id 4325, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.671 > 192.168.0.70.2049: Flags [S], cksum 0xf5c0 (correct), seq 1263459889, win 29200, options [mss 1460,sackOK,TS val 3280522964 ecr 0,nop,wscale 7], length 0
15:10:18.567897 IP (tos 0x0, ttl 64, id 27229, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.671: Flags [R.], cksum 0x61fe (correct), seq 0, ack 1263459890, win 0, length 0
15:10:28.568630 IP (tos 0x0, ttl 64, id 38694, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.853 > 192.168.0.70.2049: Flags [S], cksum 0x9aff (correct), seq 705253310, win 29200, options [mss 1460,sackOK,TS val 3280525464 ecr 0,nop,wscale 7], length 0
15:10:28.568665 IP (tos 0x0, ttl 64, id 29520, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.853: Flags [R.], cksum 0x1101 (correct), seq 0, ack 705253311, win 0, length 0
15:10:38.569313 IP (tos 0x0, ttl 64, id 40959, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.929 > 192.168.0.70.2049: Flags [S], cksum 0x8924 (correct), seq 66026915, win 29200, options [mss 1460,sackOK,TS val 3280527964 ecr 0,nop,wscale 7], length 0
15:10:38.569343 IP (tos 0x0, ttl 64, id 31363, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.929: Flags [R.], cksum 0x08ea (correct), seq 0, ack 66026916, win 0, length 0
15:10:43.573606 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.70 tell 192.168.0.84, length 46
15:10:43.573620 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.0.70 is-at aa:bb:cc:dd:ee:ff, length 28
15:10:48.570034 IP (tos 0x0, ttl 64, id 25891, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.722 > 192.168.0.70.2049: Flags [S], cksum 0x687f (correct), seq 272599298, win 29200, options [mss 1460,sackOK,TS val 3280530465 ecr 0,nop,wscale 7], length 0
15:10:48.570077 IP (tos 0x0, ttl 64, id 32321, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.722: Flags [R.], cksum 0xf209 (correct), seq 0, ack 272599299, win 0, length 0
15:10:53.579804 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.84 tell 192.168.0.70, length 28
15:10:53.580011 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.0.84 is-at aa:bb:cc:dd:ee:ff, length 46
15:10:58.570709 IP (tos 0x0, ttl 64, id 41869, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.749 > 192.168.0.70.2049: Flags [S], cksum 0x7edd (correct), seq 580671080, win 29200, options [mss 1460,sackOK,TS val 3280532965 ecr 0,nop,wscale 7], length 0
15:10:58.570731 IP (tos 0x0, ttl 64, id 32668, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.749: Flags [R.], cksum 0x122c (correct), seq 0, ack 580671081, win 0, length 0
15:11:08.571380 IP (tos 0x0, ttl 64, id 3221, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.817 > 192.168.0.70.2049: Flags [S], cksum 0xf10d (correct), seq 160428860, win 29200, options [mss 1460,sackOK,TS val 3280535465 ecr 0,nop,wscale 7], length 0
15:11:08.571416 IP (tos 0x0, ttl 64, id 33817, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.817: Flags [R.], cksum 0x8e20 (correct), seq 0, ack 160428861, win 0, length 0
15:11:18.572069 IP (tos 0x0, ttl 64, id 47816, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.753 > 192.168.0.70.2049: Flags [S], cksum 0xb122 (correct), seq 2139992997, win 29200, options [mss 1460,sackOK,TS val 3280537965 ecr 0,nop,wscale 7], length 0
15:11:18.572107 IP (tos 0x0, ttl 64, id 34217, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.753: Flags [R.], cksum 0x57f9 (correct), seq 0, ack 2139992998, win 0, length 0
15:11:28.572748 IP (tos 0x0, ttl 64, id 64308, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.867 > 192.168.0.70.2049: Flags [S], cksum 0x9ade (correct), seq 1463543813, win 29200, options [mss 1460,sackOK,TS val 3280540465 ecr 0,nop,wscale 7], length 0
15:11:28.572775 IP (tos 0x0, ttl 64, id 36325, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.867: Flags [R.], cksum 0x4b79 (correct), seq 0, ack 1463543814, win 0, length 0
15:11:33.579799 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.84 tell 192.168.0.70, length 28
15:11:33.580030 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.0.84 is-at aa:bb:cc:dd:ee:ff, length 46
15:11:38.573414 IP (tos 0x0, ttl 64, id 63669, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.920 > 192.168.0.70.2049: Flags [S], cksum 0xf76b (correct), seq 4101628992, win 29200, options [mss 1460,sackOK,TS val 3280542965 ecr 0,nop,wscale 7], length 0
15:11:38.573440 IP (tos 0x0, ttl 64, id 38585, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.920: Flags [R.], cksum 0xb1ca (correct), seq 0, ack 4101628993, win 0, length 0
15:11:48.574103 IP (tos 0x0, ttl 64, id 28920, offset 0, flags [DF], proto TCP (6), length 60)
192.168.0.84.769 > 192.168.0.70.2049: Flags [S], cksum 0xb826 (correct), seq 3096401474, win 29200, options [mss 1460,sackOK,TS val 3280545466 ecr 0,nop,wscale 7], length 0
15:11:48.574137 IP (tos 0x0, ttl 64, id 38789, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.70.2049 > 192.168.0.84.769: Flags [R.], cksum 0x7c4a (correct), seq 0, ack 3096401475, win 0, length 0
请给我一些建议,提前谢谢你。
总结一下问题的解决方法:
systemctl status nfs-kernel-server.service
ps aux | grep -i nfsd