-2
$ rpcinfo 
   program version netid     address                service    owner
    100000    4    tcp6      ::.0.111               portmapper superuser
    100000    3    tcp6      ::.0.111               portmapper superuser
    100000    4    udp6      ::.0.111               portmapper superuser
    100000    3    udp6      ::.0.111               portmapper superuser
    100000    4    tcp       0.0.0.0.0.111          portmapper superuser
    100000    3    tcp       0.0.0.0.0.111          portmapper superuser
    100000    2    tcp       0.0.0.0.0.111          portmapper superuser
    100000    4    udp       0.0.0.0.0.111          portmapper superuser
    100000    3    udp       0.0.0.0.0.111          portmapper superuser
    100000    2    udp       0.0.0.0.0.111          portmapper superuser
    100000    4    local     /run/rpcbind.sock      portmapper superuser
    100000    3    local     /run/rpcbind.sock      portmapper superuser

I think "address" shows the IPv6 address of a RPC service, according to https://unix.stackexchange.com/a/234158/674.

Does rpcinfo list the port number of a RPC service? How can I find it out?

2

This version of rpcinfo seems to be a bit hasty implementation, as the port number is displayed as two individual bytes instead of a single 16-bit number.

The portmapper service is always expected to be in port 111, since it's used to find all the other RPC services, whose port numbers might vary. (Since the ONC RPC protocol was developed before firewalls were so common, modern implementations are increasingly using static port numbers; e.g. NFS is now expected to be in port 2049 as standard.)

On the IPv6 side this is most clearly visible: the all-zeroes IPv6 address is displayed as :: and then the port number is represented as .0.111 after it. In this case, it means the most significant byte of the port number is 0 and the least significant byte is 111.

The same syntax is used on the IPv4 side of things: the address field has the all-zeroes IPv4 address (INADDR_ANY) 0.0.0.0and the two-byte representation of the port number .0.111 concatenated together.

You can get the actual port number by multiplying the MSB of the port number by 256 and then adding the value of the LSB to it. So, for example, port number 2049 would be displayed as .8.1 in this syntax (8 * 256 + 1 = 2049)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.