> 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/help-articles/what-is-lan-routing.md).

# What is LAN routing?

LAN routing enables direct peer-to-peer communication over local or private network paths when available.

Netclient automatically detects whether two peers can reach each other via LAN (e.g., same subnet or VPC). If so, it prioritizes internal IP addresses instead of routing traffic through external (public) endpoints.

This is especially useful in cloud environments, where peers within the same VPC can communicate using private IPs without traversing the public internet.

***

#### Benefits of LAN Routing

* **Reduced latency**\
  Traffic remains within the local or cloud provider’s internal network, improving performance and responsiveness.
* **Cost optimization**\
  Avoids outbound data transfer charges imposed by cloud providers for public internet traffic.
* **Improved security**\
  Minimizes exposure to the public internet, reducing the attack surface and enhancing overall network security.

#### How to Enable LAN Routing

1. Log in to the Netmaker dashboard.
2. Navigate to **Settings** from the left sidebar.
3. Select **System Configuration**.
4. Enable the **LAN Routing** toggle.

<figure><img src="/files/QQ0qYhXi5yYOeHENrKb0" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
To ensure proper functionality, keep the TCP port of your host's listening port open for endpoint detection. Once this port is enabled, NetClient can identify the most suitable internal IP addresses for peers within the Netmaker network to connect. Utilizing private IPs enhances communication speed and security.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.netmaker.io/help-articles/what-is-lan-routing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
