# Enrolling a fixed IP server to a server behind a dynamic IP address and a home router with ports forwarded

**URL:** <https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393>\
**Category:** Elasticsearch\
**Created:** [June 28, 2022, 7:14pm UTC](https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393 "2022-06-28T19:14:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![K\_st\_rs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/k_st_rs/32/106788_2.png) [@K\_st\_rs](https://discuss.elastic.co/u/K_st_rs)\
**Post date:** [June 28, 2022, 7:14pm UTC](https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393/1 "2022-06-28T19:14:31Z")

</div>

I set up two elasticsearch nodes on two computers on my home network which is reachable from the outside via dynamic IP. They seem to see each other.

Ports are open in the router

Now I want to add a node on a fixed IP outside server

HOME = 2 nodes (behind 1 dynamic IP)  
INTERNET = 1 node (static IP)

What do I need to add to elasticsearch.yml

```auto

#network.host: 192.168.1.142,127.0.0.1,localhost
network.bind_host: 192.168.1.142, 127.0.0.1, localhost
network.publish_host: www.somename.com,192.168.1.142

```

when I add [www.somename.com](http://www.somename.com) to **network.host** it says it can't bind to the IP  
`org.elasticsearch.transport.BindTransportException: Failed to bind to 111.111.111.11:[9300-9399]`

Playing around with **network.bind\_host** and **network.publish\_host** restarting elasticsearch does not seem to be helpful.

I run on 1 home node  
`/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node`

then  
on the fixed server IP node  
I install, reinstall elasticsearch with apt remove --purge etc  
`

` /usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token <token from dynamic ip server>`

`  
The enrollment token seems to always point to 192.168.1.142

```auto
Unable to communicate with the node on https://192.168.1.142:9200/_security/enroll/node. Error was Connection timed out
ERROR: Aborting enrolling to cluster. Could not communicate with the node on any of the addresses from the enrollment token. All of [192.168.1.142:9200] were attempted.

```

I also tried 0.0.0.0 which seems also a nono.

I can **telnet** from the fixed IP Server to the home ip at 9200 and 9300

Ports are open from 9300-9399

How do I need to configure the server that the enrollment token doesn't always just point to the same internal address?

---

<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:** [June 28, 2022, 11:12pm UTC](https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393/2 "2022-06-28T23:12:45Z")

</div>

> [@K\_st\_rs](#):
>
> Now I want to add a node on a fixed IP outside server

That's not a recommended approach, as any network issues will cause cluster instability.

---

<div class="post-metadata">

**Author:** ![K\_st\_rs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/k_st_rs/32/106788_2.png) [@K\_st\_rs](https://discuss.elastic.co/u/K_st_rs)\
**Post date:** [June 29, 2022, 11:57am UTC](https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393/3 "2022-06-29T11:57:15Z")

</div>

Isn't that the selling point that the system can deal with stuff like this?

😕

Doesn't it also depend on the speed of the incoming information?

---

<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:** [June 29, 2022, 9:09pm UTC](https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393/4 "2022-06-29T21:09:00Z")

</div>

> [@K\_st\_rs](#):
>
> Isn't that the selling point that the system can deal with stuff like this?

It can deal with some of it, yes. But dealing with networks that are not directly connected is not one of them.

---

<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 27, 2022, 9:09pm UTC](https://discuss.elastic.co/t/enrolling-a-fixed-ip-server-to-a-server-behind-a-dynamic-ip-address-and-a-home-router-with-ports-forwarded/308393/5 "2022-07-27T21:09:45Z")

</div>

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