22.2 Configuring the Ubuntu Firewall to Allow NFS Traffic
Next, the firewall needs to be configured to allow NFS traffic.
If the Uncomplicated Firewall is enabled, run the following command to add a rule to allow NFS traffic:
# ufw allow nfs
If, on the other hand, you are using firewalld, run the following firewall-cmd commands where <zone> is replaced by the appropriate zone for your firewall and system configuration:
# firewall-cmd --zone=<zone> --permanent --add-service=mountd
# firewall-cmd --zone=<zone> --permanent --add-service=nfs
# firewall-cmd --zone=<zone> --permanent --add-service=rpc-bind
# firewall-cmd --reload