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

Step 2: Configure IPTables

At this point, if you tried to run “rpcinfo -p server1″ or “showmount -e server1″ you’ll get errors

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

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 mount

The mount command, when successful, won’t output any messages.

[author] [author_image timthumb='on']http://mcdee.com.au/wp-content/uploads/2012/11/photo.jpg[/author_image] [author_info]Andrew McDonald is an IT Systems Admin and all round technology junkie. Absolutely a jack-of-all-trades and not one to shy away from a challenge.


[/author_info] [/author]

  205 comments

  1. Jahanzeb   •  

    Hello

    Thank you so much. it took me hell lot of time to find out this solution. As the solution is not easy to find on internet.

  2. anonymous   •  

    thanks :D

  3. Ricardo R   •  

    Gracias!

  4. Pingback: How to setup nfs server on centos 6 | GANGESH SHARMA(MCA,MCP,JCHNP)

  5. Diego Santana   •  

    Muito bom Andrew, funcionou perfeitamente, parabéns pelo tutorial!

  6. Absar   •  

    It is excellent article. Perhaps you may like to highlight use of 1 port 2049 only if NFS4 is to be supported only.

  7. Hadrian   •  

    Awesome solution. Thanks for sharing this!

  8. Mick   •  

    Clear & concise; excellent!

  9. Pingback: Centos Tutorials | Kuplux's

  10. Pingback: Centos Server Tutorial | Kuplux's

  11. Pingback: Резервное копирование в NFS хранилище в Proxmox | Diary of a madman

  12. Sergio Santos   •  

    Nice tutorial. Thanks for sharing

  13. David Schuler   •  

    A very helpful document to reference while setting up a virtual HPC cluster under VirtualBox for testing installation procedures.

  14. Pingback: datingnzcougar.info

  15. Pingback: levitra 20mg

  16. Pingback: cheap 20 mg levitra

  17. Pingback: 20mg levitra

  18. Pingback: superdrug viagra

  19. Pingback: cialis samples

  20. Pingback: buy levitra

  21. Pingback: buy tadalafil online

  22. Pingback: cialis for sale

  23. Pingback: generic cialis at walmart

  24. Pingback: buy sildenafil online

  25. Pingback: tedwap.me

  26. Pingback: buy viagra 100mg

  27. Pingback: viagra generic

  28. Pingback: online viagra

  29. Pingback: cheap generic viagra

  30. Pingback: generic viagra

  31. Pingback: viagra for men

  32. Pingback: viagra 100mg

  33. Pingback: buy viagra generic

  34. Pingback: red viagra online mail-order pharmacies

  35. Pingback: buy generic viagra

  36. Pingback: buy viagra online

  37. Pingback: viagra prices

  38. Pingback: viagra 50mg

  39. Pingback: generic viagra online mail-order pharmacies

  40. Pingback: viagra online paypal uk

  41. Pingback: sildenafil coupon

  42. Pingback: where to buy viagra

  43. Pingback: order viagra

  44. Pingback: viagra

  45. Pingback: cheap viagra 50 mg

  46. Pingback: 100 mg viagra

  47. Pingback: hard on viagra jelly online mail-order pharmacies

  48. Pingback: sildenafil prices

  49. Pingback: cheap viagra 50mg

  50. Pingback: cheap viagra generic

  51. Pingback: cheap 50 mg viagra

  52. Pingback: order viagra online

  53. Pingback: viagra samples

  54. Pingback: viagra super force online mail-order pharmacies

  55. Pingback: viagra soft tabs online mail-order pharmacies

  56. Pingback: sildenafil online

  57. Pingback: sildenafil buy

  58. Pingback: generic viagra online

  59. Pingback: sildenafil cost

  60. Pingback: viagra coupon

  61. Pingback: over the counter viagra

  62. Pingback: cheap viagra 100 mg

  63. Pingback: coupon sildenafil

  64. Pingback: buy viagra 50mg

  65. Pingback: pink viagra online mail-order pharmacies

  66. Pingback: viagra substitute

  67. Pingback: generic viagra available

  68. Pingback: 50mg viagra

  69. Pingback: viagra on line

  70. Pingback: viagra coupons

  71. Pingback: sildenafil citrate

  72. Pingback: viagra 50 mg

  73. Pingback: viagra uk

  74. Pingback: viagra 100 mg

  75. Pingback: womens viagra

  76. Pingback: viagra tablets

  77. Pingback: viagra professional online mail-order pharmacies

  78. Pingback: buy viagra

  79. Pingback: cheap viagra

  80. Pingback: cheap sildenafil online

  81. Pingback: viagra capsules online mail-order pharmacies

  82. Pingback: buy generic levitra

  83. Pingback: buy levitra 20 mg

  84. Pingback: buy levitra generic

  85. Pingback: buy levitra 10mg

  86. Pingback: buy vardenafil online

  87. Pingback: buy levitra online

  88. Pingback: buy 20 mg levitra

  89. Pingback: cheap levitra 20mg

  90. Pingback: cheap levitra 10 mg

  91. Pingback: levitra buy

  92. Pingback: levitra generic

  93. Pingback: buy 10mg levitra

  94. Pingback: levitra coupon

  95. Pingback: cheap generic levitra

  96. Pingback: vardenafil buy

  97. Pingback: buy 20mg levitra

  98. Pingback: generic levitra

  99. Pingback: levitra 20 mg

  100. Pingback: levitra

  101. Pingback: levitra rezeptfrei deutschland

  102. Pingback: 10 mg levitra

  103. Pingback: vardenafil cost

  104. Pingback: 10mg levitra

  105. Pingback: levitra 10mg

  106. Pingback: buy levitra 20mg

  107. Pingback: buy vardenafil

  108. Pingback: levitra prices

  109. Pingback: levitra 10 mg prezzo

  110. Pingback: vardenafil online

  111. Pingback: cheap 20mg levitra

  112. Pingback: coupon vardenafil

  113. Pingback: levitra 10 mg

  114. Pingback: vardenafil

  115. Pingback: buy generic cialis

  116. Pingback: cheap cialis

  117. Pingback: tadalafil 5mg

  118. Pingback: cialis online

  119. Pingback: cialis

  120. Pingback: tadalafil 20mg

  121. Pingback: cialis uk

  122. Pingback: cheap cialis 20mg

  123. Pingback: cialis pills

  124. Pingback: tadalafil online

  125. Pingback: buy cialis 20 mg

  126. Pingback: tadalafil 20 mg

  127. Pingback: cheap generic cialis

  128. Pingback: cheap 20mg cialis

  129. Pingback: interactions for cialis

  130. Pingback: buy cialis

  131. Pingback: cialis tablets 5mg-10mg or 20 mg

  132. Pingback: pfizer viagra

  133. Pingback: 50 mg viagra

  134. Pingback: female viagra

  135. Pingback: female viagra pills

  136. Pingback: viagra for women

  137. Pingback: natural viagra

  138. Pingback: viagra online

  139. Pingback: tesco viagra

  140. Pingback: buy viagra 100 mg

  141. Pingback: viagra over the counter

  142. Pingback: cheap viagra 100mg

  143. Pingback: gold viagra online mail-order pharmacies

  144. Pingback: pink female viagra online mail-order pharmacies

  145. Pingback: 10mg levitra

  146. Pingback: 10mg levitra

  147. Pingback: buy generic levitra

  148. Pingback: cheap generic levitra

  149. Pingback: buy levitra

  150. Pingback: buy levitra 20mg

  151. Pingback: buy generic levitra

  152. Pingback: buy 20 mg levitra

  153. Pingback: buy levitra 10 mg

  154. Pingback: vardenafil buy

  155. Pingback: cheap 20 mg levitra

  156. Pingback: coupon levitra

  157. Pingback: levitra online

  158. Pingback: tadalafil 20mg

  159. Pingback: buy generic cialis online

  160. Pingback: buy cheap cialis online

  161. Pingback: tadalafil 20mg

  162. Pingback: cialis generic

  163. Pingback: cialis 20mg

  164. Pingback: tadalafil 20mg

  165. Pingback: tadalafil 20mg

  166. Pingback: buy cialis online

  167. Pingback: tadalafil 20mg

  168. Pingback: cialis generic

  169. Pingback: buy cheap cialis online

  170. Pingback: cialis generic

  171. Pingback: tadalafil 20mg

  172. Pingback: cialis generic

  173. Pingback: cialis generic

  174. Pingback: buy generic cialis online

  175. Pingback: tadalafil generic cialis 20mg

  176. Pingback: buy cialis online

  177. Pingback: buy cialis

  178. Pingback: cialis online

  179. Pingback: generic cialis tadalafil

  180. Pingback: cialis online

  181. Pingback: cialis generic

  182. Pingback: generic cialis

  183. Pingback: cialis generic

  184. Pingback: tadalafil generic cialis 20mg

  185. Pingback: cialis online

  186. Pingback: tadalafil 20mg

  187. Pingback: buy cialis online

  188. Pingback: buy cheap cialis online

  189. Pingback: generic cialis tadalafil

  190. Pingback: tadalafil 20mg

  191. Pingback: buy cialis online

  192. Pingback: buy generic cialis online

  193. Pingback: generic cialis tadalafil

  194. Pingback: generic cialis

  195. Pingback: cialis generic

  196. Pingback: sildenafil 100mg

Leave a Reply to David Schuler Cancel reply

Your email address will not be published. Required fields are marked *


1 + = four

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">