# Unable to access opensearch cluster from external IP

**URL:** <https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083>\
**Category:** Security\
**Created:** [September 22, 2021, 1:12pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083 "2021-09-22T13:12:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonyab](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@antonyab](https://forum.opensearch.org/u/antonyab)\
**Post date:** [September 22, 2021, 1:12pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/1 "2021-09-22T13:12:34Z")

</div>

Hello everyone,

I am trying to set up an opensearch and opensearch dashboard installation.

I am using docker to create a cluster of two nodes.

The installation is up and running and I can access the dashboard graphic interface to create dashboards and interact with the opensearch api.

If I try to interact with the opensearch api (for example using curl) using any machine, I am receiving the result “Unautorized”. But If I do the same test from the machine where the cluster is installed it works without issues.

The server where the cluster is installed doesn’t have any firewall restrictions. Is there any configuration that I should do to allow the interaction with the opensearch API from an external IP?

Thank you in advance for the help.

Regards,

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [September 22, 2021, 2:03pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/2 "2021-09-22T14:03:04Z")

</div>

Moved to Security category.

You are sending along some sort of authentication, right?

---

<div class="post-metadata">

**Author:** ![antonyab](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@antonyab](https://forum.opensearch.org/u/antonyab)\
**Post date:** [September 22, 2021, 2:18pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/3 "2021-09-22T14:18:07Z")

</div>

Thank you for your quick reply.

I am using the default authentication.

So it is user/password authentication.

I didn’t change anything in the config files that were in the docker image.

If you want I can share the config files related to the authentication.

Thank you in advance.

Regards,

---

<div class="post-metadata">

**Author:** ![Anthony](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/anthony/32/9939_2.png) [@Anthony](https://forum.opensearch.org/u/Anthony)\
**Post date:** [September 22, 2021, 2:29pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/4 "2021-09-22T14:29:53Z")

</div>

@antonyab I’m not able to reproduce your issue.  
Can you share the curl request you use and also the opensearch.yml file, redact any sensitive details

---

<div class="post-metadata">

**Author:** ![antonyab](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@antonyab](https://forum.opensearch.org/u/antonyab)\
**Post date:** [September 22, 2021, 3:08pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/5 "2021-09-22T15:08:49Z")

</div>

Regarding the opensearch installation, I used docker-compose. You can find below the content :

**version: ‘3’**  
**services:**  
\*\* opensearch-node1:\*\*  
\*\* image: opensearchproject/opensearch:latest\*\*  
\*\* container\_name: opensearch-node1\*\*  
\*\* environment:\*\*  
\*\* - cluster.name=opensearch-cluster\*\*  
\*\* - node.name=opensearch-node1\*\*  
\*\* - discovery.seed\_hosts=opensearch-node1,opensearch-node2\*\*  
\*\* - cluster.initial\_master\_nodes=opensearch-node1,opensearch-node2\*\*  
\*\* - bootstrap.memory\_lock=true # along with the memlock settings below, disables swapping\*\*  
\*\* - “OPENSEARCH\_JAVA\_OPTS=-Xms512m -Xmx512m” # minimum and maximum Java heap size, recommend setting both to 50% of system RAM\*\*  
\*\* ulimits:\*\*  
\*\* memlock:\*\*  
\*\* soft: -1\*\*  
\*\* hard: -1\*\*  
\*\* nofile:\*\*  
\*\* soft: 262144 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems\*\*  
\*\* hard: 262144\*\*  
\*\* volumes:\*\*  
\*\* - opensearch-data1:/usr/share/opensearch/data\*\*  
\*\* ports:\*\*  
\*\* - 9200:9200\*\*  
\*\* - 9600:9600 # required for Performance Analyzer\*\*  
\*\* networks:\*\*  
\*\* - opensearch-net\*\*  
\*\* opensearch-node2:\*\*  
\*\* image: opensearchproject/opensearch:latest\*\*  
\*\* container\_name: opensearch-node2\*\*  
\*\* environment:\*\*  
\*\* - cluster.name=opensearch-cluster\*\*  
\*\* - node.name=opensearch-node2\*\*  
\*\* - discovery.seed\_hosts=opensearch-node1,opensearch-node2\*\*  
\*\* - cluster.initial\_master\_nodes=opensearch-node1,opensearch-node2\*\*  
\*\* - bootstrap.memory\_lock=true\*\*  
\*\* - “OPENSEARCH\_JAVA\_OPTS=-Xms512m -Xmx512m”\*\*  
\*\* ulimits:\*\*  
\*\* memlock:\*\*  
\*\* soft: -1\*\*  
\*\* hard: -1\*\*  
\*\* nofile:\*\*  
\*\* soft: 65536\*\*  
\*\* hard: 65536\*\*  
\*\* volumes:\*\*  
\*\* - opensearch-data2:/usr/share/opensearch/data\*\*  
\*\* networks:\*\*  
\*\* - opensearch-net\*\*  
\*\* opensearch-dashboards:\*\*  
\*\* image: opensearchproject/opensearch-dashboards:latest\*\*  
\*\* container\_name: opensearch-dashboards\*\*  
\*\* ports:\*\*  
\*\* - 5601:5601\*\*  
\*\* expose:\*\*  
\*\* - “5601”\*\*  
\*\* environment:\*\*  
\*\* OPENSEARCH\_HOSTS: ‘[“[https://opensearch-node1:9200](https://opensearch-node1:9200)”,“[https://opensearch-node2:9200](https://opensearch-node2:9200)”]’\*\*  
\*\* networks:\*\*  
\*\* - opensearch-net\*\*

**volumes:**  
\*\* opensearch-data1:\*\*  
\*\* opensearch-data2:\*\*

**networks:**  
\*\* opensearch-net:\*\*

Regarding the curl request, I tried this for example :  
curl -XGET https://IP\_ADDRESS:9200 -u ‘admin:admin’ --insecure

If I try this curl request locally on the machine where the cluster is installed, It works without issues.  
If I try it on any other machine, I have the response : Unauthorized

Thank in advance for the help really.

Regards,

---

<div class="post-metadata">

**Author:** ![Anthony](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/anthony/32/9939_2.png) [@Anthony](https://forum.opensearch.org/u/Anthony)\
**Post date:** [September 22, 2021, 3:56pm UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/6 "2021-09-22T15:56:57Z")

</div>

@antonyab  
I have just ran your docker-compose and accessed the cluster using IP address of the machine image is running on (192.168.x.x) and was able to get a response without issues.  
Therefore this would lead me to believe it’s a firewall issue

If I misunderstood your use case and you actually want to expose opensearch to public, then I would recommend reading [this](https://discuss.elastic.co/t/access-elasticsearch-from-public-ip-instead-of-lan-ipv4/248087) thread

---

<div class="post-metadata">

**Author:** ![antonyab](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@antonyab](https://forum.opensearch.org/u/antonyab)\
**Post date:** [September 23, 2021, 7:41am UTC](https://forum.opensearch.org/t/unable-to-access-opensearch-cluster-from-external-ip/7083/7 "2021-09-23T07:41:20Z")

</div>

Thank you for your answer.

I am running opensearch on a server online and not locally.

I don’t know if there is any difference for that.

I will check again my firewall config.

Thank you again.

Regards,
