April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

allow NFS access on Centos 7 and RHEL 7

Enable NFS server

  systemctl enable nfs-lock.service
  systemctl enable nfs-server.service

  systemctl start  nfs-lock.service
  systemctl start  nfs-server.service

  cat >/etc/firewalld/services/mountd.xml <<EOD
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>mountd</short>
  <description>Mount Lock Daemon</description>
  <port protocol="tcp" port="20048"/>
  <port protocol="udp" port="20048"/>
</service>
EOD

  cat >/etc/firewalld/services/rpc-bind.xml <<EOD
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>rpc-bind</short>
  <description>Remote Procedure Call Bind</description>
  <port protocol="tcp" port="111"/>
  <port protocol="udp" port="111"/>
</service>
EOD

  restorecon /etc/firewalld/services

  firewall-cmd --permanent --zone public --add-service mountd
  firewall-cmd --permanent --zone public --add-service rpc-bind
  firewall-cmd --permanent --zone public --add-service nfs
  firewall-cmd --reload
  firewall-cmd --list-all

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>