為什麼這篇nfs server設定鄉民發文收入到精華區:因為在nfs server設定這個討論話題中,有許多相關的文章在討論,這篇最有參考價值!作者g03 (閒閒的研究生)看板Linux標題[問題] NFS 的防火牆設定時間Tue Jul 28...
我想在 Fedora 7 上想建立一個 NFS server
已經開啟 rpcbind nfs,但是在防火牆的設定方面有點問題:
在 client 端打 showmount -e (IP),如果我關閉防火牆,client端可以正常顯示,
如果防火牆開啟後,會出現
mount clntudp_create: RPC: Port mapper failure - RPC: Unable to receive
如果我打開 111:tcp 111:udp 2049:tcp 2049:udp 後,會出現
rpc mount export: RPC: Unable to receive; errno = No route to host
我搜尋了一些文章,有人提到 nfs 開啟的 port 是隨機的,
所以要到 /etc/sysconfig/nfs, 指定 nfs 使用的 TCP/UDP Port
但是rpcbind(或稱portmap)的功能不就是固定 port 為 111 嗎?
我不知道是什麼地方出錯了,請各位前輩指導一下,謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.214.118
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT esp -- anywhere anywhere
ACCEPT ah -- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT tcp -- anywhere anywhere tcp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:4067
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:sunrpc
ACCEPT udp -- anywhere anywhere state NEW udp dpt:sunrpc
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:nfs
ACCEPT udp -- anywhere anywhere state NEW udp dpt:nfs
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
謝謝
※ 編輯: g03 來自: 140.123.214.118 (07/28 21:36)
我大概了解問題了,開啟portmap後,NFS只是向portmap註冊其開啟的port,
讓client端可以連到這個port,所以跟防火牆是無關的,防火牆沒開一樣連不到。
兩個解決方是,一個就是限制NFS開啟的port,然後在防火牆設定把這個port打開,
另一個就是在防火牆的設定中把信任的client端的IP設為ACCEPT。
還有一個比較麻煩的是讓防火牆自動開啟NFS打開的port,我還不會設定。
※ 編輯: g03 來自: 140.123.214.118 (07/29 01:42)