[linux] Force mountd to use UDP

zanfur at zanfur.com zanfur at zanfur.com
Thu Dec 2 18:15:51 PST 2004



I've tried that one, and it's a Bad Idea (tm). NFS calls (and in general
all RPC calls) all go through the portmapper first, to ask what services
are available, what versions, and on what ports. When the nfs client asks
the nfs server's portmap daemon where the nfs server is (program 100003),
the poor portmap daemon that doesn't know any better happily responds with
the udp /and/ tcp port numbers. The client will then not-so-happily
attempt to connect to the tcp port, because for some reason it thinks tcp
is better and always takes tcp over udp when given the option (no, I don't
get it, either). This means you get tcp packet timeouts on every nfs
request ... and due to the nature of tcp retransmit timings, this is a
Very Long Time (on the order of minutes, and at the very least 30 seconds)
until the packet is actually dropped and udp is used instead, if it fails
over to udp at all.

Although, this would probably work if you were willing to put the string
"proto=udp" in the mount options on every client, forcing them to only
attempt udp.

Cheers!
-robin

On Thu, Dec 02, 2004 at 04:43:41PM -0800, Ed Mulligan wrote:

>

> hmmm ... assuming you are running iptables firewall on the server, I am

> wondering if a very simple solution to get the desired results (forcing

> nfs to be udp) would be to just set the appropriate ports of the server to

> be UDP only via the iptables firewall.

>

> ejm

>

> On Wed, 1 Dec 2004, Michal wrote:

>

> >I posted this question to comp.protocol.nfs this morning, but things

> >are slow there.. so I'm hoping someone here can chime in with a clue.

> >Thanks!

> >

> >---

> >

> >My goal is to configure a server to avoid exporting its files over

> >TCP. I want to force UDP.

> >

> >The server is Fedora Core 1, Linux kernel 2.4.22. On this server,

> >"/usr/sbin/rpcinfo -p | grep nfs" reports:

> >

> > 100003 2 udp 2049 nfs

> > 100003 3 udp 2049 nfs

> > 100003 2 tcp 2049 nfs

> > 100003 3 tcp 2049 nfs

> >

> >I modified the script /etc/init.d/nfs which starts NFS services such

> >that rpc.mountd is started with the "--no-tcp" argument. The

> >rpc.mountd documentation says this means "Don't advertise TCP for

> >mount." Yet, rpcinfo still reports NFS services for both UDP and TCP.

> >Mounting its exports on remote systems causes them to be mounted with

> >"proto=tcp".

> >

> >There is another NFS server with an older version of Linux (2.4.18)

> >running RedHat 7.3. Running "rpcinfo -p | grep nfs" on it reports:

> >

> > 100003 2 udp 2049 nfs

> > 100003 3 udp 2049 nfs

> >

> >Mounting its exports on remote systems causes them to be mounted with

> >"proto=udp".

> >

> >I don't know what else to try on the FC1 box to force it to stop

> >servicing NFS/TCP services.

> >

> >Can anyone help?

> >

> >-Michal

> >


--

Robin Battey
zanfur at zanfur.com

Messages from this address are signed with key 0x6A57B07D. Fingerprint:
3914 F63C A99C 8EC1 785B 8287 1D8B D2F3 6A57 B07D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mailman13.u.washington.edu/pipermail/linux/attachments/20041202/0223732d/attachment.sig>


More information about the Linux mailing list