On Sun, 21 Feb 2021 at 12:46, Jerome Lille <jerome.lille@ownbay.net> wrote:
I tried to simply change type from nfs to nfs4 in the fstab in the
client. Unfortunately I then get the response

mount.nfs4: access denied by server while mounting ...

There is nothing in the server logs about this. And it is not the
firewall, because even when I turned it off, I get the same access
denied.

Anything else I have to change?

My exportfs is very simple, just
/path/to/export client(rw)

I haven't used CentOS7 for several years, so I was ignoring this
thread in the hope others could answer.

My not very trustworthy memory is that "/etc/exports" on
the server needs the "insecure" option for NFS4 to work, see:
https://access.redhat.com/solutions/3773891 for explanation
and some diagnostic tests.   My take on diagnostics is:

1) find the ports used for nfs4 tcp:
rpcinfo -p <server_IP> | awk '/ 4 /'          
    100000    4   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100003    4   tcp   2049  nfs
    100021    4   udp  35759  nlockmgr
    100021    4   tcp  38583  nlockmgr
2) use telnet on the client to verify that you can connect to ports
111 and 2049 on the server:
% telnet <server_IP> 111                    
Trying <server_IP> ...
Connected to <server_IP>. 
Escape character is '^]'.
^]
telnet> quit
Connection closed.
% telnet <server_IP> 2049                   
Trying <server_IP>...
Connected to <server_IP>.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
3. verify the exported filesystems:
% showmount -e <server_IP>
Export list for <server_IP>: /path/to/export client
Fedora 33 doesn't appear to need the "insecure" option.   For CentOS7, see
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-nfs.

--
George N. White III