Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27502

cannot access host from outside with Private IP and Public IP in java

X-Received by 10.50.88.100 with SMTP id bf4mr2246468igb.1.1392330946566; Thu, 13 Feb 2014 14:35:46 -0800 (PST)
X-Received by 10.182.28.129 with SMTP id b1mr28397obh.37.1392330946440; Thu, 13 Feb 2014 14:35:46 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!uq10no19475897igb.0!news-out.google.com!h8ni3igy.0!nntp.google.com!c10no21004546igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Thu, 13 Feb 2014 14:35:46 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=85.244.31.200; posting-account=IKHdJQoAAABz_0Q3gk1ShAWN2geJ79T8
NNTP-Posting-Host 85.244.31.200
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <eab539eb-e7f1-4a7c-8d89-404136ec2d65@googlegroups.com> (permalink)
Subject cannot access host from outside with Private IP and Public IP in java
From xeon Mailinglist <xeonmailinglist@gmail.com>
Injection-Date Thu, 13 Feb 2014 22:35:46 +0000
Content-Type text/plain; charset=ISO-8859-1
X-Received-Bytes 2178
X-Received-Body-CRC 1111890191
Xref csiph.com comp.lang.java.programmer:27502

Show key headers only | View raw


n a Linux OS, when a program get the IP address with "getHostAddress()". it gets the first IP address available. 
In a host with 2 interfaces, eth0 and eth1, the method will get the eth0 IP address by default. 

I have a host that is behind a NAT, and I cannot change the host IP addresses, or the order of the interfaces. 
In the host, eth0 is a private address, and in eth1 is an address that NAT knows. 
If I want to reach the host from outside, I connect to an IP that NAT will translate into the address of eth1. 

I need to use the private IP address to run a java service (Hadoop MapReduce) correctly, and not the eth1 address. 
I tried to set Hadoop with the eth1 address but the service won't run giving me a not allowed exception. 

1 - Now I want to contact the Hadoop service that is running behind the NAT from the internet, and the service is registered with the private address. Is it possible to reach that node? 

2 - If I could bind eth1 to the java service, I could reach the host from outside? 

3 - If I could update the NAT table with the private address of the host, I could already reach the host from outside? 

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

cannot access host from outside with Private IP and Public IP in java xeon Mailinglist <xeonmailinglist@gmail.com> - 2014-02-13 14:35 -0800
  Re: cannot access host from outside with Private IP and Public IP in java Joerg Meier <joergmmeier@arcor.de> - 2014-02-14 00:53 +0100
  Re: cannot access host from outside with Private IP and Public IP in java Arne Vajhøj <arne@vajhoej.dk> - 2014-02-13 20:59 -0500
    Re: cannot access host from outside with Private IP and Public IP in java Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2014-02-14 14:40 +0000

csiph-web