Security – UnknownHostException for server through java client code

firewalljavanetworkingSecurity

I am not able to connect to an remote known server through Java code; java.net.NoRouteToHostException: No route to host exception occurs when connection is tried.

But strangely, I am able to connect to same server through ssh.

Details:
Simple Java client when tries to establish connection with Java standalone server, while conneting the exception occurs at following statement:

Socket socket = new Socket(ServerIP ServerPort);

The port needed is open on server so that externally request can come in.

Again the following is returns false

InetAddress.getByName(SERVER_IP).isReachable(1000)

The Server is running on Fedora, Java 5.

FYI: Java cannot resolve DNS address from AIX: UnknownHostException is almost same to my question, but somehow this is neither AIX nor dns related; moreover I feel the issue to be more of Network or firewall issue.

Please guide me.

Best Answer

This is the error you'd expect from a host being firewalled. Can you telnet to the same port on that IP?