
동일한 네트워크에 없는 두 개의 머신 A와 B가 있는데 한 머신에서 다른 머신으로 nfs 공유를 내보내고 싶습니다.
중간에는 두 네트워크 모두에 있는 머신 M이 있습니다.
내 A의 공유를 M에 성공적으로 마운트했습니다. 이제 이 마운트를 B로 내보내고 싶습니다.
다음과 같이 M에서 내보내기를 만들었습니다.
/mnt/path/to/mountpoint/of/A's/nfsshare <B's IP address>(rw,insecure,secure,root_squash,wdelay,sync,no_subtree_check)
그리고 다음과 같이 B에 마운트하려고 했습니다.
<M's hostname>:/mnt/path/to/mountpoint/of/A's/nfsshare /some/empty/directory nfs auto,rw,rsize=65535 0 0
M의 내보내기를 마운트하려고 하면 B에서 다음 메시지가 나타납니다.
mount.nfs: vm-dc:/mnt/dcstore01/data02/formats_exploitation 실패, 서버에서 제공한 이유: 권한이 거부되었습니다.
그리고 M의 syslog에 다음 메시지가 표시됩니다.
Dec 6 13:53:05 vm-dc rpc.mountd[27916]: authenticated mount request from 10.0.0.1:773 for /mnt/dcstore01/data02/formats_exploitation (/mnt/dcstore01/data02)
Dec 6 13:53:05 vm-dc rpc.mountd[27916]: qword_eol: fflush failed: errno 22 (Invalid argument)
Dec 6 13:53:05 vm-dc rpc.mountd[27916]: Cannot export /mnt/dcstore01/data02, possibly unsupported filesystem or fsid= required
어떻게 해야 합니까?
답변1
이를 nfs 재수출이라고 하며 최신 Linux 커널/배포판에서는 허용되지 않습니다. 해결 방법으로 호스트 M:에서 포트 전달을 시도해 보십시오.
iptables -t nat -A PREROUTING -p tcp --dport 2049 -j DNAT --to-destination 10.10.10.10:2049
iptables -t nat -A POSTROUTING -p tcp --dport 2049 -j MASQUERADE
mountd에 대해서도 동일한 작업을 수행하지만 먼저 호스트 A의 /etc/sysconfig/nfs에서 mountd 포트를 수정하는 것이 좋습니다.
RPCMOUNTDOPTS="--port 2052"
mountd도 udp를 사용할 수 있다는 점을 명심하십시오.