LinuxCommandLibrary

rpcinfo

Report RPC information

TLDR

Show full table of all RPC services registered on localhost

$ rpcinfo
copy

Show concise table of all RPC services registered on localhost
$ rpcinfo -s [localhost]
copy

Display table of statistics of rpcbind operations on localhost
$ rpcinfo -m
copy

Display list of entries of given service name (mountd) and version number (2) on a remote nfs share
$ rpcinfo -l [remote_nfs_server_ip] [mountd] [2]
copy

Delete the registration for version 1 of the mountd service for all transports
$ rpcinfo -d [mountd] [1]
copy

SYNOPSIS

rpcinfo [options] [host]
rpcinfo [-p] [host]
rpcinfo [-T transport] host program version
rpcinfo [-T transport] [-u] [-t] [-n portnum] host program version
rpcinfo [-T transport] [-b] [-s] [-l] program version

PARAMETERS

-p
    Probes the rpcbind service on the specified host and prints a list of all registered RPC programs, their versions, protocols, and port numbers. This is often the first command used to inspect RPC services.

-T transport
    Specifies the transport protocol to use for the RPC call. Common values include udp, tcp, rdma, unix. If omitted, rpcinfo typically tries tcp then udp.

-u
    Forces the RPC call to use UDP (User Datagram Protocol) as the transport. Useful for explicitly testing UDP-based RPC services.

-t
    Forces the RPC call to use TCP (Transmission Control Protocol) as the transport. Useful for explicitly testing TCP-based RPC services.

-n portnum
    Uses portnum as the RPC port number for the specified program and version instead of querying rpcbind for it. Useful when rpcbind is unavailable or for testing specific port configurations.

-b
    Makes an RPC broadcast to all hosts on the local network. This option requires a program and version argument and is used to find all servers offering a specific RPC service.

-s
    Displays a concise, human-readable summary of the RPC services registered with rpcbind on the target host.

host
    The hostname or IP address of the machine to query. If omitted for some operations (like -p), it defaults to localhost.

program
    The RPC program number or name (e.g., nfs, mountd) to query. Required for specific RPC calls or broadcasts.

version
    The version number of the RPC program to query. Required when specifying a program.

DESCRIPTION

The rpcinfo command is a command-line utility used to query the rpcbind (or portmap on older systems) service on a specified host. It displays a list of registered RPC (Remote Procedure Call) programs and their versions, protocols (TCP/UDP), and port numbers.

This tool is invaluable for system administrators to diagnose and troubleshoot issues related to RPC-based services like NFS (Network File System) and NIS (Network Information Service). By using rpcinfo, one can verify which RPC services are running and accessible on a remote server, determine their associated port numbers, and even make specific RPC calls to test connectivity or query program details, ensuring proper functioning of distributed services.

CAVEATS

rpcinfo relies on the rpcbind (or older portmap) service running on the target host; if rpcbind is not running or accessible, rpcinfo will fail. Firewall rules frequently block RPC communication, leading to connection timeouts or failures. The -b (broadcast) option can generate significant network traffic. The -d option for deleting RPC registrations requires root privileges and should be used with extreme caution as it can disrupt services.

COMMON USAGE EXAMPLES

Here are some common ways to use rpcinfo:
List all services on local machine:
rpcinfo -p localhost
This command probes the local rpcbind and displays all registered RPC programs.

Test if NFS version 3 is available via TCP on a remote host:
rpcinfo -t remote_host nfs 3
This attempts an RPC call to the NFS program, version 3, using TCP.

Check if mountd is running via UDP on a remote host:
rpcinfo -u remote_host mountd
This checks the availability of the mountd service using UDP.

Get a summary of RPC services on a remote host:
rpcinfo -s remote_host
Provides a more concise summary than -p.

HISTORY

rpcinfo has been a fundamental utility in Unix-like operating systems since the early days of SunRPC (later ONC RPC), serving as a primary tool for diagnosing and verifying RPC-based services. Its core functionality has remained remarkably consistent, adapting from interactions with portmap to the more modern rpcbind, but always focused on providing insights into the availability and configuration of distributed RPC programs.

SEE ALSO

rpcbind(8), portmap(8), nfsstat(8), showmount(8)

Copied to clipboard