Re: rmi application thru NAT




first off, I don't think you can not bind to an ip+port that is not on the local machine, at least I think so. Because it would undermine any local control of the machine/device.

In any case, correct me if I am wrong here, but it seems to me that you have misunderstood how NAT works. You are trying to bind an rmi server to the NATed networks public ip address? the problem is that the port is not open because you have to open it by opening a socket connection to an external server, only by doing this will the NAT device open an external port with which the remote server will try to respond through.

So in essence you can not forcibly open an external port on a NAT device by just binding to it, you have to first open a connection/port from the client, then you can try to use it. But that leaves you with one problem, you have to figure out what port the NAT will be using, which is an algorithmic problem that has not yet been solved.

So your solution is to get a range of static ip addresses to use on the devices instead of having a NATed network.

tom

polaris wrote:
I have rmi application which is running correctly
inside LAN where im starting the server using lan
address: 10.0.0.2 like the following:

RemoteInterface remoteReference = (RemoteInterface)
UnicastRemoteObject.exportObject(new Server());
System.getProperties().put("java.rmi.server.hostname", "10.0.0.2");
Naming.rebind("//10.0.0.2:"+1099+"/"+RemoteInterface.REGISTRY_NAME,
remoteReference);

with this command: java -Djava.rmi.server.hostname=10.0.0.2 remoteSever

but when it try to rebind using public IP (I get it from some web
sites) instead I get this error:

Exception in thread "main" java.lang.RuntimeException:
java.rmi.ConnectException: Connection refused to host:
***.***.***.***; nested exception is: java.net.ConnectException:
Connection timed out: connect

Is the problem from NAT setting where i need to
redirect the incomming traffic and how can i do that?

also i tried to bind server with 1099 port in the following code:

UnicastRemoteObject.exportObject(new Server(),1099);

but i get "Port already in use: 1099" error where i started
rmiregistry with this port.

i need to know the right way to bind remote server with specific
port (shoudl i use another port for rmiregistry e.g. 1500)
and what port i should use in client lookup: Server bind port or
rmiregistry started port?

Naming.lookup("//10.0.0.2:?/"+RemoteInterface.REGISTRY_NAME);

.



Relevant Pages

  • RE: Remote Web Workplace not completely working.
    ... In order to allow a remote desktop connection to a client computer through ... TS requests through a firewall on TCP port 4125, ... To open the port 4125 on ISA, we can re-run CEICW to confirm it. ... server certificate) and then click Next. ...
    (microsoft.public.windows.server.sbs)
  • Re: ISA Rule for Remote Desktop?
    ... My server has a private IP address on the WAN NIC. ... I've just had an opportunity to try testing Remote Desktop through RWW from ... attempts being made from the logging interface in ISA to port 4125 when I ... There are three connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Unable to Connect to Server/Client Desktop using RWW
    ... Please post the results of an ipconfig /all for the sbs server. ... I did another test after turning off the firewall on the remote. ... If port 4125 was not forwarded on the sbs machine, ...
    (microsoft.public.backoffice.smallbiz)
  • Re: Kazzaa- spyware
    ... > server, then file retrievals from your machine must be done with the ... >>- Allow all UDP for both direction, for local port 123 and remote port ... > But unfortunately RR is changing the DNS addresses all the time. ...
    (comp.security.firewalls)
  • Re: 1 NIC v. 2 NICS & remote access questions from beginner
    ... a remote user I would recommend using a secure VPN. ... VPN funcionality I`ll tend to use that, ... the firewall for each service to the SBS server. ... >> assigned to its LAN port. ...
    (microsoft.public.windows.server.sbs)