• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 592
  • Last Modified:

RPC Ports

I am having a dilema with RPC. I have 2 systems separated by a firewall. Lets say system A is outside and system B is inside. Port 111 is open from system A to B. Port 32000 is also open from system A to B. B is running a program which registers port 32000 with RPC, and it changes everytime the program restarts. System A is unable to communicate to system B once the program restarts and registeres port 32345 and the firewall needs to be reconfigured.

My question is:

How would I force my RPC program to listen on a specific port such as the NFS process? It always gets port 2049 and I'd like to have my program always get port 32000 from the portmapper.
1 Solution
RPC is based on random ports >32000 not much one can do about that.
snickherAuthor Commented:
How does NFS do it?
NFS doesn't really use the portmapper (aka rpcbind), rather for historcial reasons NFS is fixed to port 2049.

If you don't have the source code to the app in question, you're pretty much hosed.

If you have access to the source of the RPC program in question, you can use some of the lower layer functions of RPC. Instead of just registering your service and let RPC choose the port, you can use svc_fd_create() to create an RPC service on a previously opened and bound socket.

Another option would be to use an intelligent Firewall, that knows about RPC. e.g. the Sun Screen firewall can be configured to allow certain RPC programs, regardless of what port it will be dynamically assigned
Fixed the -1 problem on this question.
Escrow points corrected.

Community Support Moderator
Experts Exchange

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now