1833174 Members
2914 Online
110051 Solutions
New Discussion

Re: Force NFS to use TCP

 
SOLVED
Go to solution
Gillian Craigie_1
Occasional Advisor

Force NFS to use TCP

Hi,

We have been asked by auditors to ensure that any NFS connections use TCP rather than UDP. We have 2 machines, one running 11.i and one running 11.0.

We are able to connect from the 11.0 machine to the 11.i machine using TCP as I believe TCP is the default on 11.i. However I am having trouble connecting to the 11.0 machine using TCP. I have added NFS_TCP=1 into the /etc/rc.config.d/nfsconf file and the machine has been rebooted since. I am using the command

# mount -o proto=tcp spms-l20:/disk3/optima /disk3

and this mounts the filesystem. But when I run nfsstat -m the results indicate that the filesystem has been mounted using UDP.

How can I ensure that all NFS connections are using TCP and not UDP?

Thanks.

10 REPLIES 10
RAC_1
Honored Contributor

Re: Force NFS to use TCP

On the system, you have problem with, modify /etc/rc.config.d/nfsconf.

Check mountd_options setting. Should look like follows.

MOUNTD_OPTIONS="-o proto=tcp"

Restart nfs.client, nfs.core and nfs.server
This should do it.

Anil
There is no substitute to HARDWORK
Sudeesh
Respected Contributor

Re: Force NFS to use TCP

Hi,
To use tcp for NFS you need to have the following....

On NFS Server:

1.check /etc/services to verify TCP is available on server through port 2049. Entry should look like->

nfsd 2049/tcp #NFS remote file system

2.Set the NFS_TCP environment variable
to 1 in the /etc/rc.config.d/nfsconf configuration file in order to
support the TCP transport.

3.To specify protocol type while starting nfsd:
/usr/sbin/nfsd -p , where is either
TCP or UDP.

/usr/sbin/nfsd -p TCP

On NFS Client:

You can tell NFS to establish ONLY a TCP connection using the following command: mount -o proto=tcp

Hope this helps

Sudeesh
The most predictable thing in life is its unpredictability
Ermin Borovac
Honored Contributor

Re: Force NFS to use TCP

Can you check with rpcinfo to see if NFS v3 is available on 11.00 server?

$ rpcinfo <11.00_server> | grep nfs
100003 2 udp 0.0.0.0.8.1 nfs superuser
100003 3 udp 0.0.0.0.8.1 nfs superuser
100003 2 tcp 0.0.0.0.8.1 nfs superuser
100003 3 tcp 0.0.0.0.8.1 nfs superuser

The output indicates that NFS is available over UDP and TCP (3rd column) and versions 2 and 3 are available (2nd column).
Gillian Craigie_1
Occasional Advisor

Re: Force NFS to use TCP

Thanks for all your responses.

Sudeesh - I have tried all of your suggestions but the filesystem was still being mounted with UDP.

Gillian Craigie_1
Occasional Advisor

Re: Force NFS to use TCP

Ermin,

The output of the rpcinfo command is as follows:

21349 rpcinfo|grep nfs
100003 2 tcp 0.0.0.0.8.1 nfs superuser
100003 3 tcp 0.0.0.0.8.1 nfs superuser
100003 2 udp 0.0.0.0.8.1 nfs superuser
100003 3 udp 0.0.0.0.8.1 nfs superuser
150001 1 udp 0.0.0.0.2.234 pcnfsd superuser
150001 2 udp 0.0.0.0.2.234 pcnfsd superuser
150001 1 tcp 0.0.0.0.2.235 pcnfsd superuser
150001 2 tcp 0.0.0.0.2.235 pcnfsd superuser

Does this mean that NFS over TCP should be available?

Thanks,

Gillian.
Gillian Craigie_1
Occasional Advisor

Re: Force NFS to use TCP

Anil,

The MOUNTD_OPTONS was not set so I have now set this.

Can you please tell me what order the restart of NFS.client, core and server should be?

I'm guessing it is in the following order but please correct me if I am wrong:

nfs.client stop
nfs.server stop
nfs.core stop
nfs.core start
nfs.server start
nfs.client start

Thanks,

Gillian.
Sudeesh
Respected Contributor
Solution

Re: Force NFS to use TCP

Did u restart the nfs services ie nfs.core, nfs.client and nfs.server on both servers after making my changes?


Sudeesh
The most predictable thing in life is its unpredictability
Sudeesh
Respected Contributor

Re: Force NFS to use TCP

I belive the order should be

nfs.server stop
nfs.client stop
nfs.core stop

nfs.core start
nfs.client start
nfs.server start


Sudeesh
The most predictable thing in life is its unpredictability
Gillian Craigie_1
Occasional Advisor

Re: Force NFS to use TCP

Thanks Sudeesh, I will try this later on today.
Gillian Craigie_1
Occasional Advisor

Re: Force NFS to use TCP

Hi,

After rebooting the machine for the second time this problem has been resolved. I am unsure why the changes did not take effect before, but thanks for all your responses.

Gillian.