> 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). Agents can also search and read this documentation through its [MCP server](https://learn.netmaker.io/~gitbook/mcp).

# 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="https://1465744049-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSqMcN3gvfPLhO0hh4agC%2Fuploads%2FTZOdUt9Zr2kKO0fWUOPr%2FScreenshot%20From%202026-05-05%2018-40-29.png?alt=media&amp;token=1a94fa9d-93ac-40db-af2c-4a3ba27a33ce" 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 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/help-articles/what-is-lan-routing.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.
