NFS does not open port 2049

Asked by ealthuis

These questions all pertain to the following:

n the past weeks you have already opened four questions about your nfs problem:
https://answers.launchpad.net/ubuntu/+source/seahorse/+question/677386
https://answers.launchpad.net/ubuntu/+question/677442
https://answers.launchpad.net/ubuntu/+question/677659
https://answers.launchpad.net/ubuntu/+question/677806

After many days of searching and errors (most of m y making) I have come to the conclusion is that port 2049 on the clients remains stubbornly closed thus no contact with the server which is listening on port 2049 only.

NFFS4 listens to port 2049 and no others, Therefor nfs-common on the clients should do the same but it appears that this is not the case. That can be fixed in one of two ways #1 add the port to nfs-common or #2 add the port number to the client script that gets the correct files mounted on the client.

I do not have the source code for nfs-common, nor would i be able to add the port open statement

I do have the script (autonfs.sh) that i could update with the port 2049 info if I had the syntax.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

This seems to be a wrong assumption.
The clients do not need having port 2049 open.
The clients contact the server, so the server has to have an active port
Hopefully nobody tries to contact the clients, and they do not need the port for incoming nfs requests open (and for security purposes they shouldn't).

Revision history for this message
ealthuis (ealthuis) said :
#2

So what is the problem now as I have cleared the "authentication' problem. This eventually times out as there appears to be no route to host.

ea@azura:~$ sudo mount -v -t nfs -o proto=tcp,port=2049 192.168.0.12:/export/mass /media/mass
[sudo] password for ea:
mount.nfs: timeout set for Thu Jan 24 11:27:34 2019
mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=4.2,addr=192.168.0.12,clientaddr=192.168.0.13'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'proto=tcp,port=2049,addr=192.168.0.12'
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 192.168.0.12 prog 100005 vers 3 prot TCP port 50209

mount.nfs: portmap query failed: RPC: Remote system error - No route to host

mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=4.2,addr=192.168.0.12,clientaddr=192.168.0.13'

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Do you have portmap and/or iptables running on the server?
If yes, are they correctly configured to allow nfs access from the clients?

Revision history for this message
ealthuis (ealthuis) said :
#4

I have yet to find portmap
I do have firewalld running and as far as I know all clients have access, as NFS service s set on port 2049 as well as zone is set to home with a listing of all IP's.
Similarly on the clients.

I now after some digging end up with stale file handles

I shall try to find out about portmap.

Revision history for this message
ealthuis (ealthuis) said :
#5

Just checked again and portmap is running and showing port 2049 available with tcp

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

What are the contents of hosts.allow and hosts.deny?

cat /etc/hosts.deny
cat /etc/hosts.allow

Revision history for this message
ealthuis (ealthuis) said :
#7

ea@discovery:~$ cat /etc/hosts.allow
# /etc/hosts.allow: list of hosts that are allowed to access the system.
# See the manual pages hosts_access(5) and hosts_options(5).
#
# Example: ALL: LOCAL @some_netgroup
# ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
# next line added for NFS usage
#rcpbind mountd nfsd statd lockd rquotad :
 127.0.0.1 192.168.0.11 192.168.0.12 192.168.0.13 192.168.0.10

ea@discovery:~$ cat /etc/hosts.deny
# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
# See the manual pages hosts_access(5) and hosts_options(5).
#
# Example: ALL: some.host.name, .some.domain
# ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
#
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
ALL:PARANOID

ea@discovery:~$
  I also discovered there were no iptables rules on discovery (the server) , so I entered rules :

sudo iptables -A INPUT -s 192.168.0.10 -j ACCEPT

for all four comouters and saved them by entering : sudo /sbin/iptables-save

also : sudo iptables INPUT -p tcp -m tcp --dport 2049 -j ACCEPT

Revision history for this message
ealthuis (ealthuis) said :
#8

  I also make quite a few typing errors, the contents of /sbin/iptables-save
:
ea@discovery:~$ sudo iptables -L line-numbers
[sudo] password for ea:
iptables: No chain/target/match by that name.
ea@discovery:~$ sudo iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- vostro.hitronhub.home anywhere
2 ACCEPT all -- seanix.hitronhub.home anywhere
3 ACCEPT all -- discovery.hitronhub.home anywhere
4 ACCEPT all -- azura.hitronhub.home anywhere
5 tcp -- anywhere anywhere tcp dpt:nfs

Chain FORWARD (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- discovery.hitronhub.home anywhere
2 tcp -- anywhere anywhere tcp dpt:nfs
ea@discovery:~$

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

I assume that the contents of you /etc/hosts.allow are wrong with the consequence that they block ALL access from the clients to the server.

Revision history for this message
ealthuis (ealthuis) said :
#10

If the syntax is correct, then the IP's are also correct.

I have a new modem/router which assigned the new IP's as 192.168.0.10 etc to 13
My old D-Link modem had IP's from 192.168.0.101 through 106

I started reading a new document about NFS4: "NFSv4 Enjancements and Best Practices Guide"

It shows a lot of differences between nfs3 and 4, some of which might be part of my problem.

I shall study it in detail and see what specifically applies to my setup.

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

In my opinion the syntax in /etc/host.allow is wrong.
It needs pairs
daemon_list : client_list
I cannot see this in your file.

see http://manpages.ubuntu.com/manpages/bionic/en/man5/hosts.allow.5.html

Revision history for this message
ealthuis (ealthuis) said :
#12

Of course my problem is not solved, I will study the hosts.allow document as well as the NFSv4 document and then formulate a plan that will make NFS4 work for me.

I will report on that in a new thread.

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

Why are you spreading the information over several different question?
You make life for the supporters harder than necessary.

Revision history for this message
ealthuis (ealthuis) said :
#14

We have spent most of this month on this and I am just about ready to give up, go back to NFSv3 and get things working without the troubles I have now caused... If all of the questions and answers were in one document, it would be very difficult to read it all and to make any sense out of it.

I sincerely thank you for your help and suggestions, I do appreciate it.

Reading the NFSv4 Enhancements and Best Practices guide tells me to stop trying to fix this and that and to start fresh making a plan of attack first.

Can you help with this problem?

Provide an answer of your own, or ask ealthuis for more information if necessary.

To post a message you must log in.