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]
Edit the NFS port definitions file
Un-comment the following lines and save the file.
Now restart the NFS and RPC Bind services
Lets go about sticking 2 new rules at the beginning of the INPUT chain that allows our NFS and RPC services to work.
[box type=info] In some circumstances it is required to restart the NFS service after the firewall changes have been made.[/box]
Lets check those showmount and rcpinfo commands again
….looking good! Lets save our iptables config to make it persistent through reboots
The mount command, when successful, won’t output any messages.
http://gengwg.blogspot.com/
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
Step 2: Configure IPTables
At this point, if you tried to run “rpcinfo -p server1″ or “showmount -e server1″ you’ll get errorsLets check those showmount and rcpinfo commands again
Step 3: Mount the NFS Share
Now that all the hard stuff is out of the way, lets mount our NFS share. So from your client machine attempt to mounthttp://gengwg.blogspot.com/
Comments
Post a Comment
https://gengwg.blogspot.com/