100227 3 tcp 2049 nfs_acl
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100227 3 udp 2049 nfs_acl
100021 1 udp 31206 nlockmgr
100021 3 udp 31206 nlockmgr
100021 4 udp 31206 nlockmgr
100021 1 tcp 31241 nlockmgr
100021 3 tcp 31241 nlockmgr
100021 4 tcp 31241 nlockmgr
客户端iptables配置策略如下(需要开放的端口请参考以上查询到的rpc进程信息)
iptables -I INPUT -p tcp -s x.x.x.x --dport 111 -j ACCEPT(x.x.x.x为服务端ip地址) iptables -I INPUT -p udp -s x.x.x.x --dport 111 -j ACCEPT iptables -I INPUT -p tcp -s x.x.x.x --dport 2049 -j ACCEPT iptables -I INPUT -p udp -s x.x.x.x --dport 2049 -j ACCEPT
iptables -I INPUT -p tcp -s x.x.x.x --dport 20048 -j ACCEPT iptables -I INPUT -p udp -s x.x.x.x --dport 20048 -j ACCEPT iptables -I INPUT -p tcp -s x.x.x.x --dport 31206 -j ACCEPT iptables -I INPUT -p udp -s x.x.x.x --dport 31206 -j ACCEPT
挂载命令:mount -t nfs 服务端ip地址:/home/nfs /home/nfs
执行df -h查询目录是否挂载成功
如系统版本较高导致挂载失败问题可以参考如下:
https://blog.csdn.net/qq_30951423/article/details/85890581
Ubuntu 18.04 nfs 默认为协议3和协议4,但是默认启动的是协议2的形式 如:/data/sharestore *(insecure,rw,no_root_squash,no_all_squash,async) 若想要求 nfs 支持协议2,就在/etc/default/nfs-kernel-server末尾加一句: RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"
vim /etc/default/nfs-kernel-server RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"
|