> For the complete documentation index, see [llms.txt](https://pentesting.mrw0l05zyn.cl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pentesting.mrw0l05zyn.cl/post-explotacion/pivoting/port-forwarding.md).

# Port forwarding

## Windows

### Netsh (Network Shell) <a href="#windows-netsh-network-shell" id="windows-netsh-network-shell"></a>

{% hint style="info" %}
En Windows XP se recomiendo habilitar IPv6 para la utilización de port forwarding con Netsh (Network Shell).

`netsh interface ipv6 install`
{% endhint %}

Visualizar port forwarding configurados.

```
netsh interface portproxy show all
```

Agregar port forwarding.

```bash
netsh interface portproxy add v4tov4 listenaddress=<listen-IP-address> listenport=<listen-local-port> connectaddress=<destination-IP-address> connectport=<destination-port>
```

* add = agregar port forwarding.
* v4tov4 = dirección IPv4 a dirección IPv4.
* \<listen-IP-address> = dirección IP de la máquina local que realiza el port forwarding. Es posible utilizar la dirección IP `0.0.0.0` para indicar que es indiferente a la interfaz de red por la cual llegue la conexión.
* \<listen-local-port> = puerto local de la máquina que realiza el port forwarding.
* \<destination-IP-address> = dirección IP de la máquina de destino.
* \<destination-port> = puerto de la máquina de destino.

Eliminar port forwarding.

```bash
netsh interface portproxy delete v4tov4 listenaddress=<listen-IP-address> listenport=<listen-local-port>
```

* delete = eliminar port forwarding.
* v4tov4 = dirección IPv4 a dirección IPv4.
* \<listen-IP-address> = dirección IP de la máquina local que realiza el port forwarding.
* \<listen-local-port> = puerto local de la máquina que realiza el port forwarding.


---

# 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://pentesting.mrw0l05zyn.cl/post-explotacion/pivoting/port-forwarding.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.
