# Elasticsearch - Binding to Public IP

**URL:** <https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668>\
**Category:** Elasticsearch\
**Created:** [March 29, 2016, 9:33am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668 "2016-03-29T09:33:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 29, 2016, 9:33am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/1 "2016-03-29T09:33:59Z")

</div>

Hello!

I wish to make the Elasticsearch running on my localhost open to public access (within my college). Therefore I wish to bind it to an IP address of my choice. However, I followed the instructions on this link [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html) and changed the 'network.host' parameter in the config file. It has still not gone public.

Any idea what else I need to do?

Thanks!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 29, 2016, 9:44am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/2 "2016-03-29T09:44:29Z")

</div>

You changed it to what?

---

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 29, 2016, 9:47am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/3 "2016-03-29T09:47:01Z")

</div>

Changed the following parameters in the config file.

network.host: 172.25.3.31

http.port: 9201

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 29, 2016, 10:59am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/4 "2016-03-29T10:59:11Z")

</div>

172.25.3.31 is still in the private RFC1928 range, but perhaps all of your college is NATed? If so, what exactly does "not gone public" mean?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [March 29, 2016, 11:36am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/5 "2016-03-29T11:36:41Z")

</div>

Did you restart Elasticsearch after you changed it? Elasticsearch logs which port it is binding to on startup. Once for its internal "transport" protocol and once for REST.

---

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 29, 2016, 11:44am UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/6 "2016-03-29T11:44:43Z")

</div>

Magnus - It is an internal college IP. I am, however, unable to access it even after changing the config which means the hosting failed for some reason.

Nik - Yes, I did restart it. And yet, there is no difference.

---

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 29, 2016, 2:01pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/7 "2016-03-29T14:01:29Z")

</div>

Please note that I've managed to successfully host Kibana on the same IP on port 5601 by altering its configuration. Cannot fathom why it isn't happening for Elasticsearch.

---

<div class="post-metadata">

**Author:** ![unknownunknown](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unknownunknown](https://discuss.elastic.co/u/unknownunknown)\
**Post date:** [March 29, 2016, 2:12pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/8 "2016-03-29T14:12:54Z")

</div>

Have you validated it's running and listening? (`netstat -tnlp`, look for java on 9300)

Could a firewall be impeding the connection? Try running netcat (or an echo server) as a listener on tcp/9300 and see if you can connect to it instead.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [March 29, 2016, 2:13pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/9 "2016-03-29T14:13:36Z")

</div>

> [@Sameer\_Dharur](#):
>
> Nik - Yes, I did restart it. And yet, there is no difference.

Do any config changes take effect? Like, what if you just put a syntax error in elasticsearch.yaml?

---

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 29, 2016, 3:10pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/10 "2016-03-29T15:10:05Z")

</div>

Update - my config has the HTTP port set to 9200 and the transport TCP port set to 9300. The host is set to 172.25.3.31 as eariler.

However, the binding still hasn't happened on either of the ports.

Here's a screenshot of the netstat -tnlp command on Ubuntu. Not very indicative, I think.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/8d91f962a44f93a32e70c3698689573f8a16d8be.png)

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [March 29, 2016, 3:16pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/11 "2016-03-29T15:16:38Z")

</div>

Can you past here your log ?

Exemple in my config :

`network.host: ["10.90.213.132", "172.16.50.12"]`

I have in my log :

```
[2016-03-29 16:08:36,035][INFO][transport] [es-dev-node-integration] publish_address {10.90.213.132:9300}, bound_addresses {172.16.50.12:9300}, {10.90.213.132:9300}
[2016-03-29 16:08:39,064][INFO][http] [es-dev-node-integration] publish_address {10.90.213.132:9200}, bound_addresses {172.16.50.12:9200}, {10.90.213.132:9200}
```

---

<div class="post-metadata">

**Author:** ![unknownunknown](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unknownunknown](https://discuss.elastic.co/u/unknownunknown)\
**Post date:** [March 29, 2016, 3:22pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/12 "2016-03-29T15:22:15Z")

</div>

If you can, you may want to re-run the netstat as root just to confirm that it's ES running on 9200.

That said, it looks like something is listening on :9200, but only on localhost. This may be an indication that the bind\_host and/or network\_host is only set to localhost/127.0.0.1. For it to listen on your outward facing interface it will either show 0.0.0.0:9200 or :::9200 and/or your $BIND\_HOST:9200.

---

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 29, 2016, 3:24pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/13 "2016-03-29T15:24:08Z")

</div>

Problem resolved. Now hosting successfully. Turns out it was a very silly error - I had to remove the # at the beginning of the operative lines in the config file where I'd mentioned the IP addresses and the port numbers.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:04pm UTC](https://discuss.elastic.co/t/elasticsearch-binding-to-public-ip/45668/14 "2017-07-05T23:04:22Z")

</div>


