# Curl: (7) Failed to connect to 172.16.128.208 port 9200: Connection refused

**URL:** https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067
**Category:** Elasticsearch
**Created:** [December 9, 2020, 3:23am UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067 "2020-12-09T03:23:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![danker00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danker00/32/78221_2.png) [@danker00](https://discuss.elastic.co/u/danker00)
#### Post date: [December 9, 2020, 3:23am UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067/1 "2020-12-09T03:23:12Z")

</div>

Hi Everyone,  
I am installing elasticsearch on a VM (vmware workstation - NIC: bridged) Host machine (Windows Server) I am getting an error after trying to curl to the IP address of the machine running elasticsearch. I was hoping to get some direction.

After installing using the directions on [https://www.elastic.co/guide/en/elasticsearch/reference/7.10/setup.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/setup.html)  
I tested using curl. locally on the machine and noticed that I was able to get a response just fine. I switched over to another host on the same subnet and I was able to ping but `curl 172.16.128.208:9200`fails

I have tried several modifications to the elasticsearch.yml file and have had no luck so far.  
I have the logs and current .yml config in a pastebin if anyone would like to check it out. (forgive me for the logs... I have been here for a couple of hours, researching and modifying settings)

/var/Log/elasticsearch.log: [https://pastebin.com/Gm8xLCG3](https://pastebin.com/Gm8xLCG3)  
Elasticsearch.yml: [https://pastebin.com/yEDNcrwP](https://pastebin.com/yEDNcrwP)

---

<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: [December 9, 2020, 3:38am UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067/2 "2020-12-09T03:38:39Z")

</div>

Welcome to our community! 😃

```auto
[2020-12-08T17:10:13,611][INFO][o.e.t.TransportService] [ubuntu] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}

```

That's why, it's only listening on loopback. Try setting `network.host` in your config to `0.0.0.0` to listen to _all_ interfaces on the host.

---

<div class="post-metadata">

### Author: ![danker00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danker00/32/78221_2.png) [@danker00](https://discuss.elastic.co/u/danker00)
#### Post date: [December 9, 2020, 5:47pm UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067/3 "2020-12-09T17:47:10Z")

</div>

Hi!  
Thank you for the welcome and reaching out. I checked the elasticsearch.yml and I confirmed that the network.host is configured to 0.0.0.0

```auto
    Network.host: 0.0.0.0
    http.port: 9200
    Default list of host is: ["127.0.0.1","[::1]" ]
    discovery.seed_hosts: ["172.16.128.208"]

```

---

<div class="post-metadata">

### Author: ![danker00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danker00/32/78221_2.png) [@danker00](https://discuss.elastic.co/u/danker00)
#### Post date: [December 9, 2020, 9:01pm UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067/4 "2020-12-09T21:01:02Z")

</div>

Update: I found out what I was doing wrong...  
I was not removing the comment from the yml file. haha 😂

---

<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: [January 6, 2021, 9:01pm UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-172-16-128-208-port-9200-connection-refused/258067/5 "2021-01-06T21:01:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
