<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>NFS and Firewall - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=NFS_and_Firewall&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.40.0</generator>
		<lastBuildDate>Wed, 08 Apr 2026 12:51:21 GMT</lastBuildDate>
		<item>
			<title>Erik: Copy from old</title>
			<link>https://www.slackwiki.com/index.php?title=NFS_and_Firewall&amp;diff=144&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=NFS_and_Firewall&amp;diff=144&amp;oldid=prev</guid>
			<description>&lt;p&gt;Copy from old&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The most recent version of this document can always be found at:&lt;br /&gt;
http://rlworkman.net/howtos/NFS_Firewall_HOWTO&lt;br /&gt;
--rworkman&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is intended to give you detailed steps for making NFS bind to&lt;br /&gt;
user-specified ports instead of random ports assigned by the portmapper.&lt;br /&gt;
This makes it *much* easier to run a firewall on the NFS server, as you don't&lt;br /&gt;
have to kludge something to find the NFS ports at each boot to open them with &lt;br /&gt;
iptables.&lt;br /&gt;
&lt;br /&gt;
First, you'll want (it's not necessary, but handy to have for later) to make&lt;br /&gt;
sure all of this is in /etc/services.  I made sure &amp;quot;NFS&amp;quot; is in all of what I&lt;br /&gt;
added or modified so that I can easily remove them (or just find them) if I &lt;br /&gt;
need them later.&lt;br /&gt;
&lt;br /&gt;
 bash-3.00# grep NFS /etc/services &lt;br /&gt;
 sunrpc          111/tcp    rpcbind      # SUN Remote Procedure Call&lt;br /&gt;
 sunrpc          111/udp    rpcbind      # SUN Remote Procedure Call &lt;br /&gt;
 mountd          861/udp                 # NFS mountd&lt;br /&gt;
 mountd          861/udp                 # NFS mountd&lt;br /&gt;
 rquotad         863/udp                 # NFS rquotad&lt;br /&gt;
 rquotad         863/tcp                 # NFS rquotad&lt;br /&gt;
 status          865/udp                 # NFS status (listen)&lt;br /&gt;
 status          865/tcp                 # NFS status (listen)&lt;br /&gt;
 status          866/udp                 # NFS status (send)&lt;br /&gt;
 status          866/tcp                 # NFS status (send)&lt;br /&gt;
 nfsd            2049/tcp                # NFS server daemon&lt;br /&gt;
 nfsd            2049/udp                # NFS server daemon&lt;br /&gt;
 lockd           4045/udp                # NFS lock daemon/manager&lt;br /&gt;
 lockd		4045/tcp		# NFS lock daemon/manager&lt;br /&gt;
&lt;br /&gt;
Next, you'll need to modify your /etc/rc.d/rc.nfsd script accordingly:&lt;br /&gt;
For other linux distributions, find the script that starts these&lt;br /&gt;
daemons and add the needed flags.&lt;br /&gt;
* Make the quota daemon listen on port 863&lt;br /&gt;
  if [ -x /usr/sbin/rpc.rquotad ]; then&lt;br /&gt;
    echo &amp;quot;  /usr/sbin/rpc.rquotad -p 863&amp;quot;&lt;br /&gt;
    /usr/sbin/rpc.rquotad -p 863&lt;br /&gt;
  fi&lt;br /&gt;
* Make the mount daemon listen on port 861&lt;br /&gt;
  if [ -x /usr/sbin/rpc.mountd ]; then&lt;br /&gt;
    echo &amp;quot;  /usr/sbin/rpc.mountd -p 861&amp;quot;&lt;br /&gt;
    /usr/sbin/rpc.mountd -p 861&lt;br /&gt;
  fi&lt;br /&gt;
Now modify the /etc/rc.d/rc.rpc script (again, for other linux distros,&lt;br /&gt;
find the script that starts this daemon and add the needed flags).&lt;br /&gt;
On older versions (less than 11.0) of Slackware, rpc.statd is started&lt;br /&gt;
in rc.nfsd, so look there instead.&lt;br /&gt;
*Make the status daemon listen on port 865 and talk on port 866 - note that you'll have to open port 866 on the NFS clients&lt;br /&gt;
  if ! ps axc | grep -q rpc.statd ; then&lt;br /&gt;
    echo &amp;quot;Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd -p 865 -o 866&amp;quot;&lt;br /&gt;
    /sbin/rpc.statd -p 865 -o 866&lt;br /&gt;
  fi&lt;br /&gt;
Finally, make the lock daemon listen on port 4045 only - note that this requires &lt;br /&gt;
setting module loading parameters in /etc/modules.conf (for 2.4 kernels) &lt;br /&gt;
or /etc/modprobe.conf (for 2.6 kernels) or /etc/modprobe.d/options (for &lt;br /&gt;
newer 2.6 kernels with module-init-tools &amp;gt;=3.2.2; create this file if it doesn't &lt;br /&gt;
already exist) - it won't hurt to set it in all of them.&lt;br /&gt;
You'll need to add this line to the files referenced above.&lt;br /&gt;
  options lockd nlm_udpport=4045 nlm_tcpport=4045&lt;br /&gt;
&lt;br /&gt;
Good luck - talk to me on IRC if you have trouble.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</description>
			<pubDate>Thu, 04 Jun 2009 05:26:18 GMT</pubDate>
			<dc:creator>Erik</dc:creator>
			<comments>https://www.slackwiki.com/Talk:NFS_and_Firewall</comments>
		</item>
</channel></rss>