# Can I use internal IP to connect to kafka? (logstash-input-kafka)

**URL:** https://discuss.elastic.co/t/can-i-use-internal-ip-to-connect-to-kafka-logstash-input-kafka/123539
**Category:** Logstash
**Created:** [March 12, 2018, 11:45am UTC](https://discuss.elastic.co/t/can-i-use-internal-ip-to-connect-to-kafka-logstash-input-kafka/123539 "2018-03-12T11:45:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michaelcheung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelcheung/32/53285_2.png) [@michaelcheung](https://discuss.elastic.co/u/michaelcheung)
#### Post date: [March 12, 2018, 11:45am UTC](https://discuss.elastic.co/t/can-i-use-internal-ip-to-connect-to-kafka-logstash-input-kafka/123539/1 "2018-03-12T11:45:27Z")

</div>

I have both my kafka and logstash in same region on GCP, separating machine. When I check the bandwidth usage of kafka's machine (iftop -P), I found that a number of bandwidth is from logstash machine's external ip. But I have set an internal ip on `bootstrap_servers`.

Now I want my logstash to connect to kafka using internal network. Is this supported? Or is it my settings' issue?

Say, x.x.x.x is external ip of my kafka machine, y.y.y.y is its internal ip. Some key kafka configuration i'm using: (kafka version; 0.11.0.2)

```auto
inter.broker.listener.name: INTERNAL
advertised.listeners: EXTERNAL://x.x.x.x:9092,INTERNAL://y.y.y.y:19092
listeners: EXTERNAL://0.0.0.0:9092,INTERNAL://0.0.0.0:19092
listener.security.protocol.map: PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT

```

And the logstash input configuration: (logstash version: 5.6.2)

```auto
input {
    kafka {
        topics => ["test"] 
        bootstrap_servers => "y.y.y.y:9092"
    }
}

```

---

<div class="post-metadata">

### Author: ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)
#### Post date: [March 12, 2018, 12:09pm UTC](https://discuss.elastic.co/t/can-i-use-internal-ip-to-connect-to-kafka-logstash-input-kafka/123539/2 "2018-03-12T12:09:12Z")

</div>

Not with the current configured port, as per you config is internal port 19092 and not 9092

---

<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: [April 9, 2018, 12:09pm UTC](https://discuss.elastic.co/t/can-i-use-internal-ip-to-connect-to-kafka-logstash-input-kafka/123539/3 "2018-04-09T12:09:14Z")

</div>

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