> For the complete documentation index, see [llms.txt](https://docs.pritunl.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pritunl.com/kb/vpn/users/port-forwarding.md).

# Port Forwarding

Forward ports to vpn users

Port forwarding allows forwarding a port from the server to a connected user this can be done in the users settings. Port forwarding can be enabled for a user at any time including while the user is connected. The changes to port forwarding will happen immediately and don't require the user to reconnect or the server to be restarted. Multiple ports can be forwarded using a comma separated list. Below are some examples of port forwarding options.

![](https://1783284711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhDA4eusSNQcv5QfappvI%2Fuploads%2FFlxyADIBpR1LrCsP1XcE%2Fport_forwarding.png?alt=media\&token=1b98a01e-fbd4-44bf-aa8a-2210cb89e257)

### Examples

| Setting         | Description                                                       |
| --------------- | ----------------------------------------------------------------- |
| `1024`          | Forward both tcp and udp port 1024                                |
| `80/tcp`        | Forward tcp port 80                                               |
| `1000-2000`     | Forward tcp and udp ports in range 1000 to 2000                   |
| `1000-2000/udp` | Forward udp ports in range 1000 to 2000                           |
| `1000:100`      | Forward tpc and udp port 1000 on the server to the users port 100 |
| `8000:80/tcp`   | Forward tcp port 8000 on the server to the users port 80          |


---

# 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://docs.pritunl.com/kb/vpn/users/port-forwarding.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.
