Menu Close
Red Hat Training
A Red Hat training course is available for RHEL 8
3.3.4. NFS 服务器的防火墙配置
要保护 NFS 服务器上的防火墙,请仅开放所需的端口。为 NFS 连接指定的端口号不得被任何其他服务使用。
-
Red Hat Enterprise Linux 8 默认支持 NFSv4。防火墙必须为 NFSv4 流量打开 TCP 端口
2049
。 在 RHEL 8 中使用 NFSv3 时,您需要打开四个额外的端口,如下所示:
rpcbind
服务动态分配 NFS 端口,这可能会在创建防火墙规则时导致问题。要简化此过程,请使用/etc/nfs.conf
文件来指定要使用的端口:-
mountd
(rpc.mountd
)的 TCP 和 UDP 端口- 在[mountd]
部分中设置port=<value>
。 -
statd
(rpc.statd
) 的 TCP 和 UDP 端口 - 在[statd]
部分中设置port=<value>
。
-
在 Red Hat Enterprise Linux 8 中,对
/etc/nfs.conf
文件中为 NFS 锁定管理器(nlockmgr
)设置 TCP 和 UDP 端口:-
nlockmgr
(rpc.statd
)的 TCP 端口 - 在[lockd]
部分中设置port=value
。它的效果与/etc/modprobe.d/lockd.conf
文件中的nlm_tcpport
选项相同。 -
nlockmgr
(rpc.statd
)的 UDP 端口 - 在[lockd]
部分中设置udp-port=value
。它的效果与/etc/modprobe.d/lockd.conf
文件中的nlm_udpport
选项相同。
-
注意
要验证 NFS 服务器上正在使用哪些端口和 RPC 程序,请使用 -p
参数执行 rpcinfo
命令。
其它资源
- 支持并行 NFS(pNFS)
-
使用
mount
命令 - 使用红帽身份管理时 使用 Kerberos 保护 NFS
-
exports(5)
和nfs(5)
手册页