> For the complete documentation index, see [llms.txt](https://learn.netmaker.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.netmaker.io/how-to-guides/nat-traversal.md).

# NAT Traversal

Netmaker makes it easy to create secure, peer-to-peer networks over the internet — even when nodes are behind NAT (Network Address Translation). This guide walks you through ensuring that your VPN network is taking advantage of the NAT Traversal functionalities of Netmaker.

NAT (Network Address Translation) traversal is a technique that allows devices behind NAT firewalls to establish direct connections with each other or with devices on the public internet. Netmaker leverages WireGuard, STUN, and TURN servers to achieve this when direct connections aren't possible.

### Use Gateways

{% content-ref url="/pages/8023dcd81897c9bc7f43477add0ae990e6caf0ac" %}
[Gateways](https://learn.netmaker.io/features/gateways.md)
{% endcontent-ref %}

### Ensure STUN Servers are Running

As of v0.18.0, Netmaker uses a STUN server (Session Traversal Utilities for NAT). STUN helps communications protocols detect and traverse NATs that are between two endpoints. By default, Netmaker uses publicly available STUN servers. You may set up your own STUN servers to augment or replace the public ones by updating the STUN\_LIST to include the STUN servers you want to use.

Two resources for installing your own STUN/TURN server:

* <https://github.com/coturn/coturn>
* <https://ourcodeworld.com/articles/read/1175/how-to-create-and-configure-your-own-stun-turn-server-with-coturn-in-ubuntu-18-04>
* <https://cloudkul.com/blog/how-to-install-turn-stun-server-on-aws-ubuntu-20-04/>

### References and Other Sources

* <https://learn.netmaker.io/how-to-guides/integrating-non-native-devices>
* <https://learn.netmaker.io/how-to-guides/how-to-setup-a-full-mesh-site-to-site-vpn-with-netmaker>
* <https://learn.netmaker.io/getting-started/server-and-client-management/client-installation/netclient-installation/stabilize-netclient-connections-behind-nat>
* <https://learn.netmaker.io/how-to-guides/securely-interconnecting-ec2-instances-across-private-amazon-vpc-subnets-using-netmaker>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.netmaker.io/how-to-guides/nat-traversal.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
