# Cannot curl elasticsearch from outside network

**URL:** https://discuss.elastic.co/t/cannot-curl-elasticsearch-from-outside-network/66924
**Category:** Elasticsearch
**Created:** [November 23, 2016, 1:30am UTC](https://discuss.elastic.co/t/cannot-curl-elasticsearch-from-outside-network/66924 "2016-11-23T01:30:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zellduck](https://avatars.discourse-cdn.com/v4/letter/z/f07891/32.png) [@zellduck](https://discuss.elastic.co/u/zellduck)
#### Post date: [November 23, 2016, 1:30am UTC](https://discuss.elastic.co/t/cannot-curl-elasticsearch-from-outside-network/66924/1 "2016-11-23T01:30:34Z")

</div>

Hi guys,

I am new to elasticsearch and my company currently have a project that needs to use elasticsearch, so this issue is quite ... urgent

I have installed elasticsearch 5 via this document  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.0/rpm.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/rpm.html)

We are using centos 6.8, after installing elasticsearch, i have left configurations to the default, allow port 9200 and 9300 by command:

$ sudo iptables -A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT  
$ sudo iptables -A INPUT -p tcp -m tcp --dport 9300 -j ACCEPT  
$ sudo /etc/init.d/iptables save

then try to connect by curl -XGET 'server\_ip:9200/?pretty', it returns connection refused.

I have try to install elasticsearch on centos 7 and it works perfectly, but my company requires install on centos6.8

Any solutions or advises?

Very appreciate !

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [November 23, 2016, 5:22am UTC](https://discuss.elastic.co/t/cannot-curl-elasticsearch-from-outside-network/66924/2 "2016-11-23T05:22:38Z")

</div>

A few things you can try/check

- Use netstat to see which IP Elasticsearch binds to (127.0.0.1 or the server IP)
- Can you do curl on the server itself?
- Disable iptables completely and try again
- Does telnet to server\_ip 9200 work?

---

<div class="post-metadata">

### Author: ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)
#### Post date: [November 23, 2016, 11:18am UTC](https://discuss.elastic.co/t/cannot-curl-elasticsearch-from-outside-network/66924/3 "2016-11-23T11:18:58Z")

</div>

Apart from the suggested debugging above: Making ES publicly accessible generally is a very bad idea. For some background on the reasoning read here (though a bit older, most of the information is still valid and relevant):

> **[Securing Your Elasticsearch Cluster
	  	 | Elastic](https://www.elastic.co/blog/found-elasticsearch-security)**
>
> Elasticsearch does not perform authentication or authorization, leaving that as an exercise for the developer. This article gives an overview of things to keep in mind when you configure the security settings for your Elasticsearch cluster, providing...

Would you mind sharing your use case of why you need public access?

---

<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: [December 21, 2016, 11:18am UTC](https://discuss.elastic.co/t/cannot-curl-elasticsearch-from-outside-network/66924/4 "2016-12-21T11:18:58Z")

</div>

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