Rpc remote system error connection refused

Problem: Client cannot mount nfs with firewall-cmd services enabled, nfs.conf

Problem: Client cannot mount nfs with firewall-cmd services enabled, nfs.conf

problem:
with firewalld enabled

Code: Select all

rpcinfo -p 192.168.122.1
rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused

with firewalld disabled

Code: Select all

[root@client ~]# rpcinfo -p 192.168.122.1
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  19904  status
    100024    1   tcp  19904  status
    100005    1   udp  19902  mountd
    100005    1   tcp  19902  mountd
    100005    2   udp  19902  mountd
    100005    2   tcp  19902  mountd
    100005    3   udp  19902  mountd
    100005    3   tcp  19902  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100021    1   udp  19901  nlockmgr
    100021    3   udp  19901  nlockmgr
    100021    4   udp  19901  nlockmgr
    100021    1   tcp  19900  nlockmgr
    100021    3   tcp  19900  nlockmgr
    100021    4   tcp  19900  nlockmgr

host details

Code: Select all

libvrtid/kvm vm host

7: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54 RETRACTED a:35 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever

Linux host.intranet 4.18.0-80.11.2.el8_0.x86_64 #1 SMP Tue Sep 24 11:32:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

[root@host ~]# cat /etc/os
os-release  ostree/     
[root@host ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

Client details

Code: Select all

libvrtid/kvm vm guest


2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:5 RETRACTED :9b:cc brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.9/24 brd 192.168.122.255 scope global noprefixroute dynamic eth0
       valid_lft 3104sec preferred_lft 3104sec
    inet6 RETRACTED scope link noprefixroute 
       valid_lft forever preferred_lft forever

Linux client.intranet 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

[root@client ~]# cat /etc/os-release 
anaconda-ks.cfg  .bash_profile    .pki/            tmp.txt
.bash_history    .bashrc          .ssh/            
.bash_logout     .cshrc           .tcshrc          
[root@client ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

host installed package

Code: Select all

[root@host ~]# dnf list all  | grep nfs
libnfsidmap.x86_64                                   1:2.3.3-14.el8_0.2                                      @BaseOS   
nfs-utils.x86_64                                     1:2.3.3-14.el8_0.2                                      @BaseOS   
pcp-pmda-nfsclient.x86_64                            4.3.0-3.el8                                             @AppStream
sssd-nfs-idmap.x86_64                                2.0.0-43.el8_0.3                                        @BaseOS   
libnfsidmap.i686                                     1:2.3.3-14.el8_0.2                                      BaseOS    
libstoragemgmt-nfs-plugin.noarch                     1.6.2-9.el8                                             BaseOS    
libstoragemgmt-nfs-plugin-clibs.i686                 1.6.2-9.el8                                             BaseOS    
libstoragemgmt-nfs-plugin-clibs.x86_64               1.6.2-9.el8                                             BaseOS    
nfs-utils.i686                                       1:2.3.3-14.el8_0                                        BaseOS    
nfs4-acl-tools.i686                                  0.3.5-0.el8                                             BaseOS    
nfs4-acl-tools.x86_64                                0.3.5-0.el8                                             BaseOS    
texlive-mfnfss.noarch                                7:20180414-13.el8                                       AppStream 
texlive-psnfss.noarch                                7:20180414-13.el8                                       AppStream 

Host services
https://access.redhat.com/documentation … nd-storage

enabled services

Code: Select all

systemctl enable firewalld
systemctl enable nfs-server.service 
systemctl enable nfs-idmapd.service 
systemctl enable rpc-gssd.service 
systemctl enable rpc-statd.service 

started/running

Code: Select all

systemctl start firewalld
systemctl start nfs-server.service 
systemctl start nfs-idmapd.service 
systemctl start rpc-gssd.service 
systemctl start rpc-statd.service 

Code: Select all

[root@host~]# systemctl | grep nfs
  proc-fs-nfsd.mount                                                                             loaded active mounted   NFSD configuration filesystem                                                                             
  var-lib-nfs-rpc_pipefs.mount                                                                   loaded active mounted   RPC Pipe File System                                                                                      
  nfs-idmapd.service                                                                             loaded active running   NFSv4 ID-name mapping service                                                                             
  nfs-mountd.service                                                                             loaded active running   NFS Mount Daemon                                                                                          
  nfs-server.service                                                                             loaded active exited    NFS server and services                                                                                   
  nfs-client.target                                                                              loaded active active    NFS client services  


[root@host ~]# systemctl | grep rpc
  var-lib-nfs-rpc_pipefs.mount                                                                   loaded active mounted   RPC Pipe File System                                                                                      
  rpc-statd-notify.service                                                                       loaded active exited    Notify NFS peers of a restart                                                                             
  rpc-statd.service                                                                              loaded active running   NFS status monitor for NFSv2/3 locking.                                                                   
  rpcbind.service                                                                                loaded active running   RPC Bind                                                                                                  
  rpcbind.socket                                                                                 loaded active running   RPCbind Server Activation Socket                                                                          
  rpc_pipefs.target                                                                              loaded active active    rpc_pipefs.target                                                                                         
  rpcbind.target                                                                                 loaded active active    RPC Port Mapper   

Configurations

vi /etc/nfs.conf

Code: Select all

#
# This is a general configuration for the
# NFS daemons and tools
#
[general]
# pipefs-directory=/var/lib/nfs/rpc_pipefs
#
[exportfs]
# debug=0
#
[gssd]
# use-memcache=0
# use-machine-creds=1
use-gss-proxy=1
# avoid-dns=1
# limit-to-legacy-enctypes=0
# context-timeout=0
# rpc-timeout=5
# keytab-file=/etc/krb5.keytab
# cred-cache-directory=
# preferred-realm=
#
[lockd]
 port=19900
#udp-port=19901
#
[mountd]
# debug=0
# manage_gids=n
# descriptors=0
port=19902
# threads=1
# reverse-lookup=n
# state-directory-path=/var/lib/nfs
# ha-callout=
#
[nfsdcltrack]
# debug=0
# storagedir=/var/lib/nfs/nfsdcltrack
#
[nfsd]
# debug=0
# threads=8
# host=
#port=19903
# grace-time=90
# lease-time=90
# tcp=y
# vers2=n
# vers3=y
# vers4=y
# vers4.0=y
# vers4.1=y
# vers4.2=y
# rdma=n
#
[statd]
# debug=0
port=19904
# outgoing-port=0
# name=
# state-directory-path=/var/lib/nfs/statd
# ha-callout=
# no-notify=0
#
[sm-notify]
# debug=0
# force=0
# retry-time=900
# outgoing-port=
# outgoing-addr=
# lift-grace=y
#

firewall configuration

Code: Select all

[root@host ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s25
  sources: 
  services: cockpit dhcpv6-client mountd nfs nfs3 nfsCustom rpc-bind ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

Code: Select all

vi /usr/lib/firewalld/services/nfsCustom.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>Customized NFS test</short>
  <description>open ports listed in rpcinfo -p</description>
  <port protocol="tcp" port="19900"/>
  <port protocol="udp" port="19901"/>
  <port protocol="tcp" port="19902"/>
  <port protocol="udp" port="19902"/>
  <port protocol="tcp" port="19903"/>
  <port protocol="tcp" port="19904"/>
  <port protocol="udp" port="19904"/>
</service>

sockets

Code: Select all

root@host ~]# ss -a | grep nfs
tcp               LISTEN              0                    64         0.0.0.0:nfs              0.0.0.0:*                  
tcp               LISTEN              0                    64           [::]:nfs     [::]:*                  
[root@host ~]#
 

selinux is set to permissive on both machines

i dont understand what i do wrong…

Содержание

  1. Maaz Anjum’s Blog
  2. Share this:
  3. Like this:
  4. Related
  5. 21 comments
  6. CentOS
  7. [SOLVED] NFS «Connection Refused» and «Permission Denied» issues
  8. [SOLVED] NFS «Connection Refused» and «Permission Denied» issues
  9. Unable to mount NFS share on Ubuntu
  10. Steven Scott
  11. SweetAndLow
  12. Steven Scott
  13. Contact US
  14. Come Join Us!
  15. Posting Guidelines
  16. how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  17. how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  18. how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  19. RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  20. RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  21. RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  22. RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  23. RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error
  24. Red Flag Submitted
  25. Reply To This Thread
  26. Posting in the Tek-Tips forums is a member-only feature.

Maaz Anjum’s Blog

While trying to setup NFS on an OVM 3.2 configuration on OEL 5.9, I followed the documentation to the letter but when time came to start the NFS daemon I kept getting the error above.

After a little googling, it turns out that RPCBind may not be running.

Perhaps I needed to update my NFS Utility packages?

Then I tried the RPC info command again, but no luck!

Portmap? Oh, that would explain a lot since NFS apparently requires port mapper service to run.

Try RPC info again. Aha, that did it!

Finally, restart the NFS Service and set it to autostart.

Hope this was helpful!

Like this:

I ran into the same issue for my rhel6 box. I followed your instructions. “portmap” service was not available in my service. Instead Rhel6 has rpcbind service. Once I started rpbcbind service <“service rpcbind start”], I was able to start the nfs service.
Thanks for such a detailed instruction.

I am glad the instructions were helpful and thank you for sharing your fix on RHEL6!

Thanks Maaz –
I ran into this same issue setting up Oracle VM Manager/Servers in virtualbox. I was following the documentation here: http://www.oracle.com/technetwork/server-storage/vm/ovm3-demo-vbox-1680215.pdf
Steve

I was working through the same document. Thanks for the mention on twitter 🙂

Yey! For CentOS 6.5 the service you start/enable before nfs is called “rpcbind”.

Thanks for sharing your experience on CentOS!

It’s hard to find your articles in google. I found it on 18 spot,
you should build quality backlinks , it will help you to increase traffic.
I know how to help you, just type in google – k2 seo tricks

Can confirm your fix worked on RHEL 5.10. It’s true that RHEL 6 has rpcbind instead. Thanks for the post!

I haven’t tried it on RHEL 5.10, but I’d be curious to know whether the solution is the same or different.

Glad it helped you in any case 🙂

RHEL 5.10 was identical. I Googled the error and saw your post. I checked portmap and saw it was off, started it and nfs fired right up. Rebooting would have fixed it since in my case portmap was set to “on” in checkconfig. I did a brief RCA and found that an installer script I had been running killed nfs processes as part of its logic. The script failed for an unrelated reason then exited without sending the init.d startup commands. All is well and work is flowing, thanks again.

Your Article helped me too. Thanks!

Glad it helped PK!

When iam restarting the nfs service it showing me

Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
[FAILED]
Starting NFS mountd: [FAILED]
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsd
===========================================
Even though ifollowed above step’s the portmap can’t restart even please can you help on this.

Mohan, what is your OS? Do you have iptables enabled?

Источник

CentOS

The Community ENTerprise Operating System

[SOLVED] NFS «Connection Refused» and «Permission Denied» issues

[SOLVED] NFS «Connection Refused» and «Permission Denied» issues

Post by louis731 » 2011/07/21 01:29:53

Greetings to all,

I’m trying to connect to my NFS server(192.168.2.183, running on Centos 5) and get these errors

On client (OSX 10.6):
$ sudo mount -t nfs 192.168.2.183:/testmount /Users/Shared
Cannot MNT RPC: RPC: Remote system error — Connection refused
Cannot MNT RPC: RPC: Remote system error — Connection refused
mount_nfs: can’t access /testmount: Permission denied

Here are the basic configs on the server:

]# cat /etc/exports
/testmount 192.168.2.180(ro,root_squash)

]# cat /etc/hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the ‘/usr/sbin/tcpd’ server.
#
portmap: 192.168.2.180

]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 950 status
100024 1 tcp 953 status
100011 1 udp 872 rquotad
100011 2 udp 872 rquotad
100011 1 tcp 875 rquotad
100011 2 tcp 875 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 34871 nlockmgr
100021 3 udp 34871 nlockmgr
100021 4 udp 34871 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 59642 nlockmgr
100021 3 tcp 59642 nlockmgr
100021 4 tcp 59642 nlockmgr
100005 1 udp 886 mountd
100005 1 tcp 889 mountd
100005 2 udp 886 mountd
100005 2 tcp 889 mountd
100005 3 udp 886 mountd
100005 3 tcp 889 mountd

]# showmount -e
Export list for CENTOS:
/testmount 192.168.2.180

both of the server and client are on the same network (192.168.2.0)

I’ve googled alot but still can’t get this solved, could someone tell me what am I missing there?

Источник

Steven Scott

Dabbler

I have FreeNAS 9.3.1 running on a computer with an NFS share. I am unable to mount this share via the mount command:
mount -t nfs 192.168.0.104:/mnt/NAS /mnt/test on Ubuntu 15.10. I also cannot do this on the FreeNAS box. On the FreeNAS box, I get a permission denied doing it through the Shell menu option. On the Ubuntu system, I get a timeout error. Adding the vers=3 to the fstab loading on the Ubuntu machine

FreeNAS
/etc/exports
/mnt/NAS -alldirs -mapall=mediactr:wheel freenas AMD6Core DellXPS

All the machines above can ping the FreeNAS box

Ubuntu /etc/fstab
192.168.0.104:/mnt/NAS /mnt/FreeNAS nfs async,auto,dev,exec,rw,nouser,vers=3 0 0[

Command Line fails as well:
mount -v -t nfs -o nfsvers=3 192.168.0.104:/mnt/NAS /mnt/FreeNAS

The command line gets a timeout, until I added the nfsvers, which now has the protocol unsupported.

The command liine attempt on the FreeNAS computer itself, gives and error of:
nfsd: RPCPROG_NFS: RPC: Remote system error — Connection
refused

SweetAndLow

Sweet’NASty

Steven Scott

Dabbler

I have installed it. The funny thing, is that this was all working until the previous weekend. My Ubuntu 15.04 stopped mounting this after a reboot. I have been unable to get it to mount the drive, so I upgraded it to Ubuntu 15.10. I cannot even load the share on the FreeNAS server either. I have the dump from my other computer (Ubuntu 15.10) which appears to be a routing problem, but ping works.

$ ping 192.168.0.104
PING 192.168.0.104 (192.168.0.104) 56(84) bytes of data.
64 bytes from 192.168.0.104: icmp_seq=1 ttl=64 time=0.214 ms
64 bytes from 192.168.0.104: icmp_seq=2 ttl=64 time=0.257 ms
64 bytes from 192.168.0.104: icmp_seq=3 ttl=64 time=0.252 ms
^C
— 192.168.0.104 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.214/0.241/0.257/0.019 ms

$ sudo mount -t nfs -o nfsvers=3 192.168.0.104:/mnt/NAS /mnt/test
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: portmap query failed: RPC: Remote system error — No route to host
mount.nfs: Connection timed out
mount.nfs: timeout set for Tue Nov 3 08:17:51 2015
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying text-based options ‘nfsvers=3,addr=192.168.0.4’
mount.nfs: prog 100003, trying vers=3, prot=6

This dump is from the Ubuntu attempting to mount the FreeNAS volume.

FreeNAS attempting to mount the same thing, gives an RPC routing error, then permission denied. I am using the shell option on FreeNAS to try to run the commands. The shell starts with a

#, but maybe I need the sudo there as well?

Источник

Thanks. We have received your request and will respond promptly.

Come Join Us!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It’s Free!

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Hi,
I am studying NFS of Linux. I set NFS in the server and want to access the server from a server. When I run «rpcinfo -p » command in the server and client, all damon, including portmap can be seen . But when I try to connect from client to server by using «rpcinfo -p 192.168.0.160″, I got the following error » rpcinfo: can’t contact portmapper: RPC: Remote system error — Connection refused «. 192.168.0.160 is my server’s IP address. I trid to mount, this error still jumped out again.
Can somebody tell me what wrong and how to fix it? Thanks in advance.

RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error

The «rpcinfo -p» command verifies that all necessary services are started on an NFS *server*. You don’t need the portmapper running on a client. If you are receiving this error from a client, and you are sure that the portmapper is running on the NFS server, I would check your firewall (iptables) rules (iptables -L) to ensure that ports 111, 745, 747, and 2049 are not being blocked.

To mount an NFS share from a client, use the mount command. Here’s an example.

mount -t nfs 192.168.0.160:/nfs/exports /mnt/nfs

RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error

Hi, fluid11,
Thank, I checked the command «iptables -l», and and I think you are right, maybe these ports have been blocked. The response was
«Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all — anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Lokkit-0-50-INPUT (1 references)
target prot opt source destination
ACCEPT udp — 192.168.0.1 anywhere udp spt:domain dpts:
1025:65535
ACCEPT tcp — anywhere anywhere tcp dpt:smtp flags:S
YN,RST,ACK/SYN
ACCEPT tcp — anywhere anywhere tcp dpt:http flags:S
YN,RST,ACK/SYN
ACCEPT tcp — anywhere anywhere tcp dpt:ftp flags:SY
N,RST,ACK/SYN
ACCEPT tcp — anywhere anywhere tcp dpt:ssh flags:SY
N,RST,ACK/SYN
ACCEPT tcp — anywhere anywhere tcp dpt:telnet flags
:SYN,RST,ACK/SYN
ACCEPT udp — anywhere anywhere udp spts:bootps:boot
pc dpts:bootps:bootpc
ACCEPT udp — anywhere anywhere udp spts:bootps:boot
pc dpts:bootps:bootpc
ACCEPT all — anywhere anywhere
REJECT tcp — anywhere anywhere tcp dpts:0:1023 flag
s:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT tcp — anywhere anywhere tcp dpt:nfs flags:SY
N,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT udp — anywhere anywhere udp dpts:0:1023 reje
ct-with icmp-port-unreachable
REJECT udp — anywhere anywhere udp dpt:nfs reject-w
ith icmp-port-unreachable
REJECT tcp — anywhere anywhere tcp dpts:x11:6009 fl
ags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT tcp — anywhere anywhere tcp dpt:xfs flags:SY
N,RST,ACK/SYN reject-with icmp-port-unreachable

Now can you tell me how to unblock these ports?

RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error

Most likely you installed the firewall during the Red Hat installation. You can easily modify your current rules using the «lokkit» utility. Run «lokkit», and enter «Medium» and then «Customize». Add this.

Or, if a firewall isn’t needed, you can just turn it off completely using lokkit.

RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error

Hi, fluid11
Thanks, I set my server accroding to your suggestion, and it works for the command
«rpcinfo -p 192.168.0.160
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 32768 status
100024 1 tcp 32768 status
391002 2 tcp 32769 sgi_fam
100011 1 udp 627 rquotad
100011 2 udp 627 rquotad
100011 1 tcp 630 rquotad
100011 2 tcp 630 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100005 1 udp 32771 mountd
100005 1 tcp 32770 mountd
100005 2 udp 32771 mountd
100005 2 tcp 32770 mountd
100005 3 udp 32771 mountd
100005 3 tcp 32770 mountd
«.But when I mounted from a client , the problem is «mount: RPC: Timed out». I set the folder in the server’s /etc/exports file.
Sorry, I am a new learner. Can you give me more suggetion or web site for this problem?

RE: how to solve «rpcinfo: can’t contact portmapper: RPC: » error

Try using «lokkit» to turn the firewall off, and then try to connect. If you can connect with the firewall off, then we’ll know for sure that its a firewall issue.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Источник

While trying to setup NFS on an OVM 3.2 configuration on OEL 5.9, I followed the documentation to the letter but when time came to start the NFS daemon I kept getting the error above.

[root@ovm /]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
[FAILED]
Starting NFS daemon: [FAILED]

After a little googling, it turns out that RPCBind may not be running.

[root@ovm /]# rpcinfo -p
rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused

Perhaps I needed to update my NFS Utility packages?

[root@ovm /]# yum install nfs-utils
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
You can use up2date --register to register.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.0.9-70.el5 set to be updated
--> Processing Dependency: initscripts >= 8.45.43 for package: nfs-utils
--> Running transaction check
---> Package initscripts.x86_64 0:8.45.44-3.0.1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Updating:
nfs-utils x86_64 1:1.0.9-70.el5 el5_latest 409 k
Updating for dependencies:
initscripts x86_64 8.45.44-3.0.1.el5 el5_latest 1.6 M

Transaction Summary
=============================================================================================================================================================
Install 0 Package(s)
Upgrade 2 Package(s)

Total download size: 2.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): nfs-utils-1.0.9-70.el5.x86_64.rpm | 409 kB 00:00 
(2/2): initscripts-8.45.44-3.0.1.el5.x86_64.rpm | 1.6 MB 00:01 
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 598 kB/s | 2.0 MB 00:03 
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : initscripts 1/4 
warning: /etc/sysctl.conf created as /etc/sysctl.conf.rpmnew
Updating : nfs-utils 2/4 
Cleanup : nfs-utils 3/4 
Cleanup : initscripts 4/4

Updated:
nfs-utils.x86_64 1:1.0.9-70.el5

Dependency Updated:
initscripts.x86_64 0:8.45.44-3.0.1.el5

Complete!

Then I tried the RPC info command again, but no luck!

[root@ovm /]# rpcinfo -p
rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused

Portmap? Oh, that would explain a lot since NFS apparently requires port mapper service to run.

[root@ovm /]# chkconfig portmap on
[root@ovm yum.repos.d]# service portmap start

Try RPC info again. Aha, that did it!

[root@ovm yum.repos.d]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper

Finally, restart the NFS Service and set it to autostart.

[root@ovm /]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@ovm /]# chkconfig nfs on

Hope this was helpful!

Cheers!

I’m writing a Python script which lets local Ubuntu machine connecting to a remote linux machine(on the same local network) by Paramiko, and then uses exec_command() to execute mount -t nfs -o tcp,nolock <local machine ip>:/path/to/local/directory /path/to/remote/directory command.

However, when I run my script, it will hang at the mount command for a while, and stderr return by exec_command() shows the following error:

mount: RPC: Remote system error - Connection refused
mount: mounting <local machine ip>:/path/to/local/directory on /path/to/remote/directory failed: Bad file descriptor

I’ve googled for several possibilities and they are all checked:

  1. my /etc/exports includes the remote machine’s address, in which I add the line:
    /path/to/local/directory 192.168.2.0/24(rw,nohide,no_subtree_check,no_root_squash)
  2. when normally ssh to the remote machine, I can use the same command to mount the local directory on the remote machine.
  3. rpcinfo -p shows portmapper and nfs running normally

I also log in to the remote machine, and use ps to check if the command is received correctly:

 1894 root      1380 S    sh -c mount -t nfs -o tcp,nolock ...
 1895 root      1376 S    mount -t nfs -o tcp,nolock ...
 1901 root      1372 S    sleep 180
 1902 root      1376 R    ps

Finally, following is my code:

def executeCMD(sshC, setupCMD, hostCMD, scpCMD, cleanCMD):
    confirm = ''
    for cmd in setupCMD:
        if cmd.startswith('rm -r'):
            while confirm not in ['y', 'n']:
                confirm = (
                           input('Command to execute: "{}" Are you sure?(y/n) '.format(cmd))
                                .strip()
                                .lower()
                          )
            if confirm == 'y':
                stdin, stdout, stderr = sshC.exec_command(cmd)
                logger.info('{} (Recv: {})'.format(cmd,
                                                   stderr.read().decode()))
                for cmd in hostCMD:
                    cmdOut = subprocess.Popen(cmd,
                                              stdin=subprocess.PIPE,
                                              stdout=subprocess.PIPE,
                                              stderr=subprocess.STDOUT,
                                              shell=True)
                    out = cmdOut.stdout.read().decode()
                    logger.info('{}'.format(out))
                for cmd in scpCMD:
                    scpC = SCPClient(sshC.get_transport())
                    scpC.put(*cmd)
            elif confirm == 'n':
                for cmd in cleanCMD:
                    stdin, stdout, stderr = sshC.exec_command(cmd)
                    logger.info('{} (Recv: {})'.format(cmd,
                                                       stderr.read().decode()))
                return 1
        else:
            stdin, stdout, stderr = sshC.exec_command(cmd)
            logger.info('{} (Recv: {})'.format(cmd,
                                               stderr.read().decode()))
    return 0

I’m wondering if anyone has the same problem?

I’m trying to setup a NFS client on a new CentOS 6.6 server to an existing NFS server and am having problems that I cannot figure out. When starting rpcbind/nfs I get:

# /etc/init.d/rpcbind start
# /etc/init.d/nfs start
    Starting NFS services:                                     [  OK  ]
    Starting NFS quotas: Cannot register service: 
         RPC: Unable to receive; errno = Connection refused
         rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
                                                               [FAILED]
    Starting NFS mountd:                                       [  OK  ]
    Starting NFS daemon:                                       [  OK  ]

rpcinfo -p works fine

# rpcinfo -p
program vers proto   port  service
100000    4   tcp    111  portmapper
    .. snip
100021    4   tcp  47627  nlockmgr

but rpcinfo -p 127.0.0.1 (or localhost) returns an error:

# rpcinfo -p 127.0.0.1
rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused

Checking the ports with (netstat -an) it seems the portmap/rpcbind is not listening on port 111. Nothing is listening on port 111 and rpcbind is listening on port 3421 (edit: not random like I originally thought).

Things I’ve checked or tried include:

  • Disabling selinux (was not enabled)
  • Clearing /etc/hosts.deny
  • Clearing iptables (it had no rules to start)
  • Check logs (found nothing relevant)
  • Restarted server (no effect)
  • Checked on CentOS 5 servers (portmap is listening there on port 111)
  • Checked Google: A lot of similar error messages but nothing specifically about rpcbind not listening on port 111 (and none the solutions worked anyways).
  • ‘telnet’ to port 111 (timed out which confirms that nothing is listening there)
  • Checked 127.0.0.1/localhost settings (they work fine)

At this point I don’t really have any options or things left to check and need some ideas. I’ll pretty much try anything at this point as the server is relatively useless without NFS.

Update 1:

Running rpcinfo -s localhost on the client works but rpcinfo -s server does not work. I’m wondering if there is an issue with having the client be CentOS 6 and the server be CentOS 5.

Update 2:

Output from showmount is identical on the new client and the NFS server:

# showmount -e 10.2.212.10
Export list for 10.2.212.10:
/shared/uesp/maps           67.205.112.104
/shared/uesp/skins          67.205.112.104
/shared/phpsessions         10.2.212.30,[...snip...],10.2.212.11
/shared/uesp/filecache      10.2.212.30,[...snip...],10.2.212.11
/shared/uesp/wikiimages     10.2.212.30,[...snip...],10.2.212.11
/shared/eqwiki/filecache    10.2.212.30,[...snip...],10.2.212.11
/shared/eqwiki/wikiimages   10.2.212.30,[...snip...],10.2.212.11
/shared/davewiki/filecache  10.2.212.30,[...snip...],10.2.212.11
/shared/davewiki/wikiimages 10.2.212.30,[...snip...],10.2.212.11

I’ve snipped the long list of IPs, but 10.2.212.30 is the new client. Trying to mount a NFS share on the new client results in this:

# mount -v 10.2.212.10:/shared/phpsessions /mnt/phpsessions
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Thu Jan 15 18:53:43 2015
mount.nfs: trying text-based options 'vers=4,addr=10.2.212.10,clientaddr=10.2.212.30'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'addr=10.2.212.10'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Unable to receive
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Unable to receive - Connection refused
mount.nfs: trying text-based options 'vers=4,addr=10.2.212.10,clientaddr=10.2.212.30'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'addr=10.2.212.10'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Unable to receive
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Unable to receive - Connection refused
...

The last few lines repeat until it times out.

Update 3:

So if I use iptables to redirect port 111 to the port rpcbind is using on the client then I can get rpcinfo -p localhost to work on the client. However, this doesn’t do anything with the mount issues. I’ve tried forcing the NFS to use v2 like:

# mount -v -t nfs -o nfsvers=3 10.2.212.10:/shared/phpsessions /mnt/phpsessions

but that results in the same error message as above. The fact that when I run on the client I get:

# rpcinfo -s server
rpcinfo: can't contact rpcbind: : RPC: Unable to receive; errno = Connection refused

which is the same error message from mount. I’m guessing that mount on the CentOS 6 client is trying to use the «new» rpcbind on the CentOS 5 server which is running the «old» portmap so it is failing. I would assume it should be possible to mix CentOS versions like this somehow.

Update 4:

I created a test NFS share on the client and was able to successfully mount it on the server. This seems to match the theory that it is something to do with a portmap/rpcbind mismatch. The client can act as a NFS server as rpcbind (rpc v3/4) is backwards compatible with portmap (rpc v2) but portmap is not forwards compatible with rpcbind.

Update 5 (Possible Solution)

Looking at the client more carefully I noticed rpcbind seems to always be on port 3421 (I thought it was random initially). On the server I used iptables to forward port 3421 to port 111. After this I was able to successfully mount the a NFS share from the server on the client. This may be a valid solution since I’ll only have a mix of CentOS 5/6 servers for a few weeks as I upgrade all servers to CentOS 6.

Unless a better answer comes up I’ll answer my own question in a few days.

  1. HellO…
    #mount 192.168.0.111:/home /home/laptop/
    mount: RPC: Remote system error — Connection refused
    Help…where to fix this …my /etc/exports look like that
    /home 192.168.0.0/255.255.255.0(rw)
    and i hashed (#) all lines in (hosts.allow/deny)
    i tried everything i know ..even local mount (nfs) wont work too
    #mount -t nfs Ziox:/home/ /mnt/laptop/
    mount: Ziox:/home/ failed, reason given by server: Permission denied
    #and by the way my host name Ziox highlighted in /etc/hosts
    but in the same time
    # hostname
    Ziox ……normal no problems
    /etc/hostes (Ziox highlighted every where)
    127.0.0.1 Ziox localhost.localdomain localhost
    127.0.0.1 localhost.localdomain localhost
    127.0.0.1 Ziox
    192.168.0.111 Master
    192.168.0.11 Ziox

    Helllllllllllllllllllllllllp

    Last edited by ziox; 05-26-2004 at 05:54 AM.


  2. Re: NFS

    Originally posted by ziox

    i tried everything i know ..even local mount (nfs) wont work too
    #mount -t nfs Ziox:/home/ /mnt/laptop/
    mount: Ziox:/home/ failed, reason given by server: Permission denied
    #and by the way my host name Ziox highlighted in /etc/hosts

    Okay.

    Do you have portmap, nfsd, mountd, statd, etc running on the server? mountd and statd on the client?

    In /etc/hosts.allow, you need to specify what machines can access these specific programs.

    Check the troubleshooting section of the NFS howto, it’s very useful.


    Helllllllllllllllllllllllllp

    Please don’t do that.

    ~psi42


  3. i’ve all that stuff…………


  4. Please post

    /etc/hosts
    /etc/hosts.allow
    /etc/hosts.deny
    /etc/exports

    ~psi42


  5. The /etc/exports is important, that is where security for the share is listed (and the shares themselves )

    Mine looks like (on my server)

    /home/icarus 10.1.1.3(rw,sync)
    /test 10.1.0.0/16(rw,sync)

    This gives my home directory to me only (if my IP is 10.1.1.13) and everyone get’s read/write to /test


  6. Make sure the port mapper is running on the client.
    If you could, please paste the output of «/usr/sbin/rpcinfo -p» from both the client and the server, along with the other files requested by Icarus and psi42.

    -goon12


  7. all my files are correct i just missed to stop [ iptables ]
    this message—->[…………………-Connection refused] sent by the firewall i think
    thank you every One


Понравилась статья? Поделить с друзьями:
  • Rpc failed http 413 curl 22 the requested url returned error 413
  • Rpc executor service threw an error что делать
  • Rpc error unable to receive
  • Rpc error program not registered
  • Rpc error no cluster leader