Mounting remote share through nfs

Issues related to configuring your network
User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Mounting remote share through nfs

Post by TrevorH » 2020/05/18 10:32:59

Now I want to know how to modify iptables to solve this issue ? I am using CentOS 7- Minimal.
If this is the case then it's the rules on the NFS _server_ that need to be amended.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/18 11:01:39

nitinkumar wrote:
2020/05/16 09:55:28
In order to debug this problem I have disabled firewall on both the machines.
Is that still true?
nitinkumar wrote:
2020/05/18 10:11:29
message comes after about 180 -200 seconds after the mount command is given.
The REJECT would come instantly. The 180-200s sounds like TCP timeout.

MartinR has a good point.

nitinkumar
Posts: 19
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/19 08:56:00

the command with verbose option

# mount -t nfs 192.168.29.243:/nitin /mountpoint -v

gives following error ------

mount.nfs: trying text based options ' vers=4.1,addr=192.168.29.243,client addr=192.168.29.72'
mount.nfs: mount(2): no route to host

The above two sentences keep repeating on screen unless stopped by Ctrl-C

It is clearly evident that it is a network issue only with NFS. But both the machines are in the same network subnet and pinging.
I am unable to understand what more nfs is looking for. This is a simple connection between two local machines. Why firewall has
to interfere? I am not able to understand. "man nfs" also does not give any hint. /var/log/messages also do not indicate any error.

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/19 11:27:27

nitinkumar wrote:
2020/05/16 09:55:28
1) I am trying to mount a share on my centOS 7 Virtual machine from Red hat enterprise server 6
nitinkumar wrote:
2020/05/19 08:56:00
mount.nfs: trying text based options ' vers=4.1,addr=192.168.29.243,client addr=192.168.29.72'
mount.nfs: mount(2): no route to host
Does the server support 4.1? What does it support?

Does the server see the incoming request? I would listen there with tcpdump.

nitinkumar
Posts: 19
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/21 18:15:32

Hello friends i have solved the problem. It was firewall which was preventing mounting the share. I stopped the firewall
in CentOS 7 VM using command " # systemctl stop firewalld " and it worked.

Earlier, i had only disabled firewall on my windows PC on which CentOS 7 was loaded as a VM using VMware workstation. Since VM was created
in bridge mode, ( bridging physical PC interface to virtual interface) I thought disabling firewall in windows PC will suffice. But After stopping firewall
in CentOS it straight away worked.

Thank you guys for helping me out debugging the issue. Especially Martin's post gave me the clue. Thank you very much Mr. Martin.

I have another query regarding kickstart centOS 7 which I will be sending in another post.

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/22 05:05:27

Now you should configure your firewalls to allow the NFS traffic. The "stop firewall" is a bad option.

nitinkumar
Posts: 19
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/22 17:21:16

Certainly. I will have to configure firewall to allow nfs traffic. I will search NET to find out how to do it.

In case you have a short procedure to configure firewall on CentOS 7 you can share. If the procedure is very long, i will check on NET.

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/22 18:40:15

If the connection uses default zone, then:

Code: Select all

firewall-cmd --permanent --add-service=nfs
See https://access.redhat.com/documentation ... _firewalls

nitinkumar
Posts: 19
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/25 08:25:54

Ya. It worked after allowing nfs traffic through firewall. Thanks.

Post Reply