> For the complete documentation index, see [llms.txt](https://unknown-56-works.gitbook.io/luigiscreen/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unknown-56-works.gitbook.io/luigiscreen/network-guides/public-ip.md).

# Public IP and Port Forwarding

Use this setup when MediaMTX runs at home and OBS connects from outside your home network.

## Requirements

You need:

* A real public IPv4 address or working public DNS name
* Router access
* TCP port forwarding
* A stable LAN address for the MediaMTX computer

This does not work through carrier-grade NAT unless your ISP provides a public address.

## Generate configuration

Run:

```
/screen mediamtx internet
```

The wizard asks for:

1. The MediaMTX computer LAN address when it cannot detect one safely
2. Your public IPv4 address or DNS hostname
3. The public TCP port

## Router rule

Example:

```
Public TCP 40000 -> 192.168.1.50 TCP 55556
```

The public and local ports do not have to match.

## Firewall

Allow inbound TCP `55556` on the MediaMTX computer.

## Security

Do not expose an unauthenticated default MediaMTX configuration. Use the configuration generated by LuigiScreen.

## Test externally

Test from a different network, such as mobile data. Testing your public address from inside the same LAN can fail on routers without NAT loopback.


---

# 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://unknown-56-works.gitbook.io/luigiscreen/network-guides/public-ip.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.
