Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a application that binds to 127.0.0.1:9000. I can't access from other nodes on the network due to this. I want it to appear as my-machine-name:9000 instead.
How can I do this in Ubuntu. Iptables / forwarding maybe?
Can you tell us what application? There may be settings to change the IP address to something else like you private network (i.e. 192.168.0.0). iptables is used to forward packets from one machine to another, not to redirect a local server LISTEN to the world.
Thanks, its Hadoop, HDFS. I already set the following in core-site.xml file: <property> <name>fs.defaultFS</name> <value>my-machine-name:9000/</value> </property>
Used both my-machine-name and IP address in core-site.xml. Both show 127.0.0.1:9000 when run netstat -pln. Still not able to connect from another node. That was why I wanted to try IP tables as a fix, maybe?
You need to use your private network IP address. You should see it when you do ifconfig. Usually the first entry, it has been called eth0, although now a day, that changes so much... That's the IP address you need to use.
iptables
is used to forward packets from one machine to another, not to redirect a local server LISTEN to the world.<property> <name>fs.defaultFS</name> <value>my-machine-name:9000/</value> </property>
my-machine-name
andIP
address incore-site.xml
. Both show127.0.0.1:9000
when runnetstat -pln
. Still not able to connect from another node. That was why I wanted to try IP tables as a fix, maybe?ifconfig
. Usually the first entry, it has been calledeth0
, although now a day, that changes so much... That's the IP address you need to use.