# IP filtering

**URL:** <https://discuss.elastic.co/t/ip-filtering/37675>\
**Category:** Elasticsearch\
**Created:** [December 21, 2015, 9:36am UTC](https://discuss.elastic.co/t/ip-filtering/37675 "2015-12-21T09:36:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tybreizh29190](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tybreizh29190](https://discuss.elastic.co/u/tybreizh29190)\
**Post date:** [December 21, 2015, 9:36am UTC](https://discuss.elastic.co/t/ip-filtering/37675/1 "2015-12-21T09:36:50Z")

</div>

Hi  
I want to limit access to my Elasticsearch to 4 machines.  
My server is Leila (not Leia 😕 i always thought is was Leila but in real it's Leia 😖).  
All others are just here to post data in it.  
Below is my elasticsearch.yml file, and there is no IP filtering with it.I can access http on any machine

> network.host: leila  
> shield.transport.filter.enabled: true  
> shield.transport.filter.allow: ["leila", "localhost"]  
> shield.transport.filter.deny: \_all

> transport.profiles.client.shield.filter.enabled: true  
> transport.profiles.client.shield.filter.allow: ["leila", "localhost"]  
> transport.profiles.client.shield.filter.deny: \_all

> shield.http.filter.enabled: true  
> shield.http.filter.allow: ["leila", "yoda", "darkvador", "amidala", "localhost"]  
> shield.http.filter.deny: \_all

I tried with

> network.host: 127.0.0.1

but then no one can access E.S. with http.  
what's wrong ?  
thanks for your help.  
marc

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 21, 2015, 10:15am UTC](https://discuss.elastic.co/t/ip-filtering/37675/2 "2015-12-21T10:15:06Z")

</div>

If you define network.host to 127.0.0.1, you'll be able to access your instance only using 127.0.0.1 address, which means only access locally.

Try to change that to the network card IP address.

---

<div class="post-metadata">

**Author:** ![tybreizh29190](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tybreizh29190](https://discuss.elastic.co/u/tybreizh29190)\
**Post date:** [December 21, 2015, 6:48pm UTC](https://discuss.elastic.co/t/ip-filtering/37675/3 "2015-12-21T18:48:13Z")

</div>

I already tried that.

> [@tybreizh29190](#):
>
> network.host: leila

that's what I did, but it's world open when i do that.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 21, 2015, 7:41pm UTC](https://discuss.elastic.co/t/ip-filtering/37675/4 "2015-12-21T19:41:18Z")

</div>

But Shield will then filter allowed IP addresses, right?

---

<div class="post-metadata">

**Author:** ![tybreizh29190](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tybreizh29190](https://discuss.elastic.co/u/tybreizh29190)\
**Post date:** [December 22, 2015, 7:39am UTC](https://discuss.elastic.co/t/ip-filtering/37675/5 "2015-12-22T07:39:30Z")

</div>

changing network.host:localhost to network.host:leila disable the localhost only access.  
but what i was expecting from

> shield.http.filter.enabled: true  
> shield.http.filter.allow: ["leila", "yoda", "darkvador", "amidala", "localhost"]  
> shield.http.filter.deny: \_all

was to disable all http access except for the 4 machines in the allow line.

in real, the 4 machines are allowed, but also any other machine on the Internet, that's not expected.

---

<div class="post-metadata">

**Author:** ![tybreizh29190](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tybreizh29190](https://discuss.elastic.co/u/tybreizh29190)\
**Post date:** [December 22, 2015, 10:03am UTC](https://discuss.elastic.co/t/ip-filtering/37675/6 "2015-12-22T10:03:55Z")

</div>

ok, shame on me 😕

to use shield, install shield BEFORE ...

bin/plugin install license  
bin/plugin install shield

i need some holidays ...

---

<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 5, 2017, 11:29pm UTC](https://discuss.elastic.co/t/ip-filtering/37675/7 "2017-07-05T23:29:21Z")

</div>


