# How can I create a transport client via vpn?

**URL:** <https://discuss.elastic.co/t/how-can-i-create-a-transport-client-via-vpn/88082>\
**Category:** Elasticsearch\
**Created:** [June 2, 2017, 12:19pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-transport-client-via-vpn/88082 "2017-06-02T12:19:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfasun](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tfasun](https://discuss.elastic.co/u/tfasun)\
**Post date:** [June 2, 2017, 12:19pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-transport-client-via-vpn/88082/1 "2017-06-02T12:19:08Z")

</div>

I want to run my elasticsearch server behind vpn.  
I have a elasticsearch and vpn server.I want to create a transport client via vpn in my [server.My](http://server.My) server is not connected to vpn.I want to only create a transport client.  
Vpn IP is added to ES security group.VPN server has a public port.

My server will create a transport client via [VPN.Is](http://VPN.Is) it possible?

Now My transport client code is below.I change host and port with my vpn host and port?  
But not connected. How can i configure?

Settings settings = Settings.settingsBuilder().put(ElasticSearchReservedWords.CLUSTER\_NAME.getText(), LogHandlerConstants.CLUSTER\_NAME)  
.put(ElasticSearchReservedWords.LISTENER\_TRANSPORT\_SNIFF.getText(), true).build();  
Client transportClient = TransportClient.builder().settings(settings).build()  
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(elasticsearch\_host), Integer.valueOf(9300)))  
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(elasticsearch\_host), Integer.valueOf(9301)));

---

<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:** [June 30, 2017, 12:19pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-transport-client-via-vpn/88082/2 "2017-06-30T12:19:51Z")

</div>

Closed on June 30, 2017, 12:19pm UTC

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