Tutorial – Configure IPTables for NFS Server on CentOS 6

This tutorial will take you through configuring iptables to allow client connections to your NFS service.

Allowing access to your NFS shares isn’t as simple as opening up a single protocol/port combo. There’s a quite a number of different ports required utilizing both TCP and UDP. We also need to make our lives easier to statically setting the ports for some of the NFS related services.

[box type="info"] Just note that this document assumes CentOS 6 for all example code and references. Syntax, file locations and codes may vary based on your distribution.[/box]

Step 1: Configure NFS Ports

The NFS service uses the RPC Bind service to advertise the protocols/ports it’s using. To make our iptables config nice and clean, we’ll statically configure these ports rather than leave it up to the RPC God to decide.

Edit the NFS port definitions file

Un-comment the following lines and save the file.

Now restart the NFS and RPC Bind services

Continue reading…