# Deploying behind NAT and Firewall

**URL:** <https://discuss.elastic.co/t/deploying-behind-nat-and-firewall/164783>\
**Category:** Elasticsearch\
**Created:** [January 18, 2019, 11:58am UTC](https://discuss.elastic.co/t/deploying-behind-nat-and-firewall/164783 "2019-01-18T11:58:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikola\_Radovanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikola_radovanovic/32/39803_2.png) [@Nikola\_Radovanovic](https://discuss.elastic.co/u/Nikola_Radovanovic)\
**Post date:** [January 18, 2019, 11:58am UTC](https://discuss.elastic.co/t/deploying-behind-nat-and-firewall/164783/1 "2019-01-18T11:58:12Z")

</div>

Hi,  
I am not sure if this is the right place for this topic, so please move it if there is a better one.

My question is how Elasticsearch shall be deployed when behind NAT and Firewall? I created basic setup of Elasticsearch and able to access from other addresses in subnet, however I was unable to access it from the outside world. Tried to turn off ufw, set port forward - nothing helped.

Thank you kindly.

Best regards

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 19, 2019, 10:18am UTC](https://discuss.elastic.co/t/deploying-behind-nat-and-firewall/164783/2 "2019-01-19T10:18:47Z")

</div>

You normally use HTTP to talk to Elasticsearch; by default this uses TCP port 9200 but you can change the port number with the `http.port` setting. This works just fine behind a properly configured NAT device and/or firewall as long as it is set up to allow an incoming connection to end up at the right port to talk to Elasticsearch.

It sounds like your issue is with the configuration of your network. You have not given much detail in your question so it's hard to guess what might be wrong there. Perhaps you will receive more help if you share some more details of your setup (e.g. a description of your network, a copy of `elasticsearch.yml`, your NAT/firewall configuration, the kinds of error message that you're seeing, etc.).

---

<div class="post-metadata">

**Author:** ![Nikola\_Radovanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikola_radovanovic/32/39803_2.png) [@Nikola\_Radovanovic](https://discuss.elastic.co/u/Nikola_Radovanovic)\
**Post date:** [January 19, 2019, 11:30am UTC](https://discuss.elastic.co/t/deploying-behind-nat-and-firewall/164783/3 "2019-01-19T11:30:37Z")

</div>

Thank you! After you confirmed this setup should work, I did some trial-error testing and figure out that trouble is in my router: I just moved rule to another place in form and it worked?! Guess its poor firmware from my ISP.

Best regards and sorry for the disturbance!

---

<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:** [February 16, 2019, 11:30am UTC](https://discuss.elastic.co/t/deploying-behind-nat-and-firewall/164783/4 "2019-02-16T11:30:41Z")

</div>

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