{"id":9518,"date":"2026-10-07T09:55:33","date_gmt":"2026-10-07T09:55:33","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=9518"},"modified":"2026-10-11T13:34:27","modified_gmt":"2026-10-11T13:34:27","slug":"setting-nfs-ports","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/","title":{"rendered":"Setting NFS ports"},"content":{"rendered":"\r\n<h1><strong><b>How to Set Fixed NFS Ports for Firewalls on Linux<\/b><\/strong><\/h1>\r\n<p class=\"wp-block-paragraph\">The Network File System, usually called NFS, lets one Linux machine share a folder that other machines mount as if it were local. It is widely used for shared storage on servers, and it works well until a firewall gets in the way. Then you discover that NFS is not one service listening on one port.<\/p>\r\n<p>The core service, nfsd, uses port 2049, and the port mapper uses port 111. But older NFS versions also depend on helper services for mounting, file locking and crash recovery, and by default these pick random ports each time they start. A firewall cannot allow ports it cannot predict. The fix is to pin each helper service to a fixed port, then allow exactly those ports and nothing else.<\/p>\r\n<p>This guide shows you how to do that on a Debian or Ubuntu style server. We start with which NFS version you are using, because that decides whether you need this at all. Then we pin the statd, lockd and mountd ports, verify the result, and open the matching firewall rule in Google Cloud. All the original screenshots stay in place, followed by common mistakes and a short FAQ.<\/p>\r\n<h2><strong><b>Do You Need Fixed Ports? NFSv3 and NFSv4<\/b><\/strong><\/h2>\r\n<p>Before you change anything, check which NFS version your clients use. It changes the amount of work enormously.<\/p>\r\n<div style=\"width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px;\">\r\n<table style=\"width: 100%; min-width: 600px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.5; color: #1f2937;\"><caption style=\"caption-side: top; text-align: left; padding: 12px 14px; font-size: 18px; font-weight: bold; color: #0f2a4a;\">NFSv4 vs NFSv3 firewall requirements<\/caption>\r\n<thead>\r\n<tr style=\"background: #0f2a4a;\">\r\n<th style=\"padding: 12px 14px; text-align: left; color: #ffffff; font-weight: bold; border-bottom: 2px solid #0b1f38; width: 24%;\" scope=\"col\">Point<\/th>\r\n<th style=\"padding: 12px 14px; text-align: left; color: #ffffff; font-weight: bold; border-bottom: 2px solid #0b1f38; width: 38%;\" scope=\"col\">NFSv4<\/th>\r\n<th style=\"padding: 12px 14px; text-align: left; color: #ffffff; font-weight: bold; border-bottom: 2px solid #0b1f38;\" scope=\"col\">NFSv3<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr style=\"background: #ffffff;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top; border-bottom: 1px solid #e5e9f0;\" scope=\"row\">Ports needed<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">TCP 2049 for normal use<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">111, 2049, plus mountd, statd and lockd<\/td>\r\n<\/tr>\r\n<tr style=\"background: #f5f8fc;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top; border-bottom: 1px solid #e5e9f0;\" scope=\"row\">Helper services<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Built in, no separate ports<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Separate services on random ports by default<\/td>\r\n<\/tr>\r\n<tr style=\"background: #ffffff;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top; border-bottom: 1px solid #e5e9f0;\" scope=\"row\">Fixed port setup<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Not needed<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Needed for firewalls<\/td>\r\n<\/tr>\r\n<tr style=\"background: #f5f8fc;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top;\" scope=\"row\">Firewall rule<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top;\">One port<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top;\">Several ports<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\n<p><strong><b>My advice:<\/b><\/strong>\u00a0if your clients can use NFSv4, use it and open only port 2049. Everything below is for the case where you must keep NFSv3, for example for older clients or software that requires it.<\/p>\r\n<p>Prerequisites:<\/p>\r\n<ul>\r\n<li>A Linux VM acting as the NFS server, on Debian or Ubuntu. The paths below follow that layout.<\/li>\r\n<li>The NFS server packages installed and the share already working without a firewall.<\/li>\r\n<li>SSH access to the server and a user who can run sudo.<\/li>\r\n<li>Permission to create firewall rules in your Google Cloud project.<\/li>\r\n<li>A scratch machine to test on first. Changing NFS ports on a live server drops active mounts.<\/li>\r\n<\/ul>\r\n<p>Run every command in this guide on the NFS server itself, not in Cloud Shell. Cloud Shell is a separate machine, so editing its files has no effect on your server.<\/p>\r\n<h2>Step by Step Process on How to Set Fixed NFS Ports<\/h2>\r\n<h3><strong><b>Step 1: Set the statd Port<\/b><\/strong><\/h3>\r\n<p>The statd service tracks which clients have mounted the share, so that locks can be recovered after a restart. First look at its current options:<\/p>\r\n<p>cat \/etc\/default\/nfs-common<\/p>\r\n<p>Find the line that sets STATDOPTS. If it is empty, statd chooses a random port.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9524\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png\" alt=\"\" width=\"823\" height=\"404\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png 628w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24-300x148.png 300w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Open the file for editing:<\/strong><\/p>\r\n<p>sudo nano \/etc\/default\/nfs-common<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9525\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-25.png\" alt=\"\" width=\"1120\" height=\"83\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-25.png 591w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-25-300x22.png 300w\" sizes=\"auto, (max-width: 1120px) 100vw, 1120px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Set the option so statd always listens on port 2046:<\/strong><\/p>\r\n<p>STATDOPTS=&#8221;-p 2046&#8243;<\/p>\r\n<p>Save with Ctrl and X, then Y, then Enter.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9526\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-26.png\" alt=\"\" width=\"839\" height=\"414\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-26.png 628w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-26-300x148.png 300w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/figure>\r\n\r\n\r\n\r\n<h3><strong><b>Step 2: Set the lockd Ports<\/b><\/strong><\/h3>\r\n<p class=\"wp-block-paragraph\">The lockd service handles file locking. It is part of the kernel, so its ports are set through module options. First check whether the options file already exists:<\/p>\r\n<p>cat \/etc\/modprobe.d\/lock.conf<\/p>\r\n<p>If you see No such file or directory, the file does not exist yet, and you will create it in the next command.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9527\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-27.png\" alt=\"\" width=\"975\" height=\"111\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-27.png 567w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-27-300x34.png 300w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\r\n\r\n\r\n\r\n<p><strong>Create or edit the file:<\/strong><\/p>\r\n<p>sudo nano \/etc\/modprobe.d\/lock.conf<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9528\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-28.png\" alt=\"\" width=\"1160\" height=\"83\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-28.png 610w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-28-300x22.png 300w\" sizes=\"auto, (max-width: 1160px) 100vw, 1160px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Add these two lines, then save the file:<\/p>\r\n<p>options lockd nlm_tcpport=4045<\/p>\r\n<p>options lockd nlm_udpport=4045<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9530\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-30.png\" alt=\"\" width=\"993\" height=\"149\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-30.png 593w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-30-300x45.png 300w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Module options are read when the lockd module loads. That means a reboot, or at least a full NFS restart with the module reloaded, is needed before the new ports take effect.<\/p>\r\n<h3><strong><b>Step 3: Verify Both Files<\/b><\/strong><\/h3>\r\n<p>Run the two cat commands again and confirm the values stuck:<\/p>\r\n<p>cat \/etc\/default\/nfs-common<\/p>\r\n<p>cat \/etc\/modprobe.d\/lock.conf<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9531\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-31.png\" alt=\"\" width=\"783\" height=\"368\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-31.png 628w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-31-300x141.png 300w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Open<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$\u00a0\u00a0\u00a0\u00a0 cat \/etc\/modprobe.d\/lock.conf<\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It\u2019ll display the updated lock.conf file<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9532\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-32.png\" alt=\"\" width=\"1021\" height=\"150\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-32.png 561w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-32-300x44.png 300w\" sizes=\"auto, (max-width: 1021px) 100vw, 1021px\" \/><\/figure>\r\n<h3><strong><b>Step 4: Pin the mountd Port\u00a0<\/b><\/strong><\/h3>\r\n<p>The mountd service handles the initial mount request, and it is the third helper that picks a random port. Pin it in the NFS server defaults file:<\/p>\r\n<p>sudo nano \/etc\/default\/nfs-kernel-server<\/p>\r\n<p>Set the option to a fixed port that does not clash with the others:<\/p>\r\n<p>RPCMOUNTDOPTS=&#8221;&#8211;port 4046&#8243;<\/p>\r\n<p>Without this step, one of your four ports is still unpredictable and the firewall rule will break mounts.<\/p>\r\n<h3><strong><b>Step 5: Restart and Confirm the Ports<\/b><\/strong><\/h3>\r\n<p>Restart the services, or reboot so the lockd module options apply:<\/p>\r\n<p>sudo systemctl restart nfs-kernel-server rpcbind<\/p>\r\n<p>Then ask the port mapper which ports each service is using:<\/p>\r\n<p>rpcinfo -p<\/p>\r\n<p>You should see the ports you chose listed against the status, lock manager and mount services. If any show a random high port, that service did not pick up its setting. Newer distributions can also read these values from the file \/etc\/nfs.conf, so check your release notes if a setting seems ignored.<\/p>\r\n<h2><strong><b>Open the Ports in a Google Cloud Firewall Rule<\/b><\/strong><\/h2>\r\n<p>Fixed ports are only useful if the firewall allows them. In Google Cloud, create an ingress rule that allows the NFS ports, and limit the source to your own network instead of the whole internet:<\/p>\r\n<p>gcloud compute firewall-rules create allow-nfs &#8211;network=default &#8211;direction=INGRESS &#8211;action=allow &#8211;rules=tcp:111,udp:111,tcp:2049,udp:2049,tcp:2046,udp:2046,tcp:4045,udp:4045,tcp:4046,udp:4046 &#8211;source-ranges=10.128.0.0\/9 &#8211;target-tags=nfs-server<\/p>\r\n<p>Then add the nfs-server network tag to your NFS server VM. The source range above is the usual range for the default network. Replace it with the range of your own subnet. Never use 0.0.0.0\/0 for NFS, because NFS was not designed to face the public internet.<\/p>\r\n<p>If you only need NFSv4, the rule shrinks to a single port:<\/p>\r\n<p>gcloud compute firewall-rules create allow-nfsv4 &#8211;network=default &#8211;direction=INGRESS &#8211;action=allow &#8211;rules=tcp:2049 &#8211;source-ranges=10.128.0.0\/9 &#8211;target-tags=nfs-server<\/p>\r\n<h2><strong><b>Common Mistakes to Avoid<\/b><\/strong><\/h2>\r\n<ul>\r\n<li><b><\/b><strong><b>Editing the files in Cloud Shell.<\/b><\/strong>Run the commands on the NFS server VM.<\/li>\r\n<li><b><\/b><strong><b>Forgetting mountd.<\/b><\/strong>The original only pins two services, so one random port is left.<\/li>\r\n<li><b><\/b><strong><b>Not restarting or rebooting.<\/b><\/strong>Module options for lockd apply only when the module loads.<\/li>\r\n<li><b><\/b><strong><b>Choosing clashing ports.<\/b><\/strong>Each service needs its own port number, and none should collide with something already listening.<\/li>\r\n<li><b><\/b><strong><b>Opening NFS to the whole internet.<\/b><\/strong>Limit the source range to your private network.<\/li>\r\n<li><b><\/b><strong><b>Copying commands with curly quotes or a long dash.<\/b><\/strong>Pasting from a web page can change quote marks in the option lines. Paste into a plain text editor first.<\/li>\r\n<\/ul>\r\n<p>With statd, lockd and mountd pinned, your NFS firewall rule can be short and exact. Test a mount from a client, confirm with rpcinfo, and then tighten the source range to only the machines that need access.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>How to Set Fixed NFS Ports for Firewalls on Linux The Network File System, usually called NFS, lets one Linux machine share a folder that other machines mount as if it were local. It is widely used for shared storage on servers, and it works well until a firewall gets in the way. Then you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,1640],"tags":[605,699,700,984,617,683,684,685,611,1400,692,1542],"class_list":["post-9518","post","type-post","status-publish","format-standard","hentry","category-google-cloud-platform","category-networking","tag-gcp","tag-gcp-certification","tag-gcp-cloud-console","tag-gcp-course","tag-google-cloud","tag-google-cloud-certification","tag-google-cloud-console","tag-google-cloud-courses","tag-google-cloud-platform","tag-google-cloud-platform-tutorial","tag-google-cloud-training","tag-nfs-ports"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set Fixed NFS Ports for Firewalls on Linux - Prwatech<\/title>\n<meta name=\"description\" content=\"Pin the NFS statd, lockd and mountd ports to fixed numbers, open them in a Google Cloud firewall rule, and learn why NFSv4 needs only port 2049.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Fixed NFS Ports for Firewalls on Linux - Prwatech\" \/>\n<meta property=\"og:description\" content=\"Pin the NFS statd, lockd and mountd ports to fixed numbers, open them in a Google Cloud firewall rule, and learn why NFSv4 needs only port 2049.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T09:55:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-11T13:34:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png\" \/>\n\t<meta property=\"og:image:width\" content=\"628\" \/>\n\t<meta property=\"og:image:height\" content=\"309\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/\",\"url\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/\",\"name\":\"How to Set Fixed NFS Ports for Firewalls on Linux - Prwatech\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png\",\"datePublished\":\"2026-10-07T09:55:33+00:00\",\"dateModified\":\"2026-10-11T13:34:27+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Pin the NFS statd, lockd and mountd ports to fixed numbers, open them in a Google Cloud firewall rule, and learn why NFSv4 needs only port 2049.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png\",\"width\":628,\"height\":309},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting NFS ports\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Fixed NFS Ports for Firewalls on Linux - Prwatech","description":"Pin the NFS statd, lockd and mountd ports to fixed numbers, open them in a Google Cloud firewall rule, and learn why NFSv4 needs only port 2049.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Fixed NFS Ports for Firewalls on Linux - Prwatech","og_description":"Pin the NFS statd, lockd and mountd ports to fixed numbers, open them in a Google Cloud firewall rule, and learn why NFSv4 needs only port 2049.","og_url":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2026-10-07T09:55:33+00:00","article_modified_time":"2026-10-11T13:34:27+00:00","og_image":[{"width":628,"height":309,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png","type":"image\/png"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/","url":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/","name":"How to Set Fixed NFS Ports for Firewalls on Linux - Prwatech","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png","datePublished":"2026-10-07T09:55:33+00:00","dateModified":"2026-10-11T13:34:27+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Pin the NFS statd, lockd and mountd ports to fixed numbers, open them in a Google Cloud firewall rule, and learn why NFSv4 needs only port 2049.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/07\/image-24.png","width":628,"height":309},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/setting-nfs-ports\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Setting NFS ports"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/9518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=9518"}],"version-history":[{"count":9,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/9518\/revisions"}],"predecessor-version":[{"id":11941,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/9518\/revisions\/11941"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=9518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=9518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=9518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}