# NAT Forwarding — Use Proxy from Anywhere

> For AI tools: this is the Markdown copy of https://xproxy.io/document/how-public-access-xproxy. Every XProxy guide has one at its URL + `.md`; the index of all guides is https://xproxy.io/llms.txt.

Open your router for the box with port forwarding or DMZ, and let the panel check it.

By default your proxies work only inside your home network. Open your router for them, and customers can use them from anywhere on the internet.

**You need:** your router's admin login, and a [fixed home address for the box](https://xproxy.io/document/how-static-ip-for-server). It takes about 20 minutes.

In short

**What you do**

Tell your router to pass the proxy ports to the box. The panel lists the ports for you.

**Lock it first**

Once the box is on the internet, anyone can knock. Set the dashboard and proxy logins before you open the router.

**The panel checks it**

It tests your ports from the internet and tells you which proxies customers can reach.

## Open your router for the box

**Step 1: Set a dashboard password**

Once the box is on the internet, anyone can try to open its dashboard. So lock it first.

1. In your panel, open **General Settings**, then **System Setting**. Click the **Security** tab.
2. Turn **Dashboard Auth** on.
3. Type a **Username** and a **Password**, then click **Save**.

![System Setting, Security tab: Dashboard Auth switched on, a username and password, and Save](https://media1.xproxy.io/docs/anywhere/nat-1-dash.webp)

> Pick a strong password and keep it safe. You need it every time you open the dashboard from outside.

**Step 2: Set a proxy login**

Do the same for your proxies, so only your customers can use them.

1. Open **Proxy Management**, then **Proxy Settings**. Click the **Login** tab.
2. Turn **Enable proxy authentication** on.
3. Type a **Username** and a **Password**, then click **Save** at the bottom.

This is the login you give to your customers.

![Proxy Settings, Login tab: Enable proxy authentication switched on, with a username and password](https://media1.xproxy.io/docs/anywhere/nat-2-proxylogin.webp)

**Step 3: Ask the panel which ports to open**

Your router must send the proxy ports to the box. The panel tells you which ones.

1. In **Proxy Management**, click the address button above the list.
2. Choose **Router**. The panel checks your ports from the internet.
3. It tells you how many proxies customers can reach.
4. Below, it lists the ports to forward to the box. Click **Copy** to keep the list.

![Proxy Management address menu, Router mode: 15 of 20 proxies reachable, and the list of ports to forward to the box, with a Copy button](https://media1.xproxy.io/docs/anywhere/nat-3-router.webp)

> **Public IP not detected** next to Router? The box has no internet yet, or cannot find its public IP. Fix that first.

**Step 4: Open the ports on your router**

Open your router's admin page, then the **Port forwarding** page. It may be called **Virtual Server** or **NAT**.

Add one rule for each range from the panel. Your ranges depend on your box: how many modems it has and the starting port you set. The ports in the pictures (4001 to 4010, 10 modems) are only an example.

1. Protocol: **TCP**.
2. External ports: the first and last port of the range.
3. Internal IP address: the local address of your box.
4. Internal ports: the same range.
5. Save.

Want the dashboard from outside too? Add a rule for the dashboard port (80 unless you changed it).

Customers who use SOCKS5 UDP (QUIC, games, calls)? You also need a UDP rule: see **Forward UDP for SOCKS5** below.

![Example router page, Port forwarding: TCP, the external ports, the box address and the internal ports of one rule, with Save](https://media1.xproxy.io/docs/anywhere/nat-router-forward.webp)

> **The quick way: DMZ.** Switch **DMZ** on and type your box address (second picture). The router then sends **everything** to the box, not only the proxy ports. Only use it when the two logins are set. No fixed address yet? First do [Static IP for the box](https://xproxy.io/document/how-static-ip-for-server).

**Step 5: Check from the internet**

Go back to the address menu in **Proxy Management**. Click **Re-check**.

You want every proxy reachable. Ports still closed? The panel lists them again. Fix the rules, then re-check.

Your public IP is the one next to **Router** in the menu. To open the dashboard from outside, use `http://&lt;public-ip>` and your dashboard login.

![Router mode in the address menu: the Re-check link and the number of reachable proxies](https://media1.xproxy.io/docs/anywhere/nat-3-router.webp)

> You can also measure speed here: **WAN speed**, **Test now**. Customers download over the upload of your home line, so a slow upload means slow proxies.

**Step 6: Forward UDP for SOCKS5 (optional)**

Only needed when customers use SOCKS5 UDP: QUIC, games, calls, WebRTC. Their app sends UDP to a new port of the box for each session, so the router must pass those ports too.

On the same **Port forwarding** page, add one more rule:

1. External ports **32768** to **60999**, protocol **UDP**, internal ports from **32768**.
2. Server IP address: the local address of your box, the same as for the TCP rule.
3. Save.

The first row of the picture is the TCP rule of the proxy ports. Keep your own range there, from the panel.

![Router Port forwarding page (Virtual Servers): the box address, a TCP rule for the proxy ports 4001 to 4010 and a UDP rule for ports 32768 to 60999](https://media1.xproxy.io/docs/udp-nat/nat-router-udp.webp)

> Router pages look different on every model. Look for the fields external port start and end, protocol, internal port and server (box) IP address. Some routers fill the internal end port by themselves.

**Step 7: Tell the box its public IP (optional)**

In its answer the box names the address the app sends its UDP to. Behind a router that is the box's LAN address by default, which the internet cannot reach. Tell the box to name your router's public IP instead:

1. Open **Proxy Management**, then **Proxy Settings**, tab **General**. Find the card **SOCKS5 UDP behind a router**.
2. Choose **Router public IP (auto)**, then click **Save** in the bar at the bottom. With a fixed public IP from your provider you can choose **Fixed IP** and type it.
3. The card shows the address internet clients get.

It applies at once, without restarting the proxies. The box checks your public IP every 10 seconds, so a new IP from your provider is picked up by itself. Devices in your LAN keep the LAN address, and clients that come through a VPS never get your home IP.

**Router public IP (auto)** and **Fixed IP** need the Basic plan or higher. **LAN address** works on every plan.

![Proxy Settings, General tab: the SOCKS5 UDP behind a router card, Router public IP (auto) selected and the note Internet clients get 203.0.113.45 (detected) (demo data)](https://media1.xproxy.io/docs/udp-nat/ps-socks5-udp-nat.webp)

> Test it from another network with the script in [SOCKS5 UDP](https://xproxy.io/document/socks5-udp-associate#test). It also checks for IP and DNS leaks. Your provider shares one IP between customers (CGNAT)? Then the card says so, and only [VPS forwarding](https://xproxy.io/document/vps-forwarding-to-use-difference-place) works.

**Step 8: Use a name instead of an IP (optional)**

Your home IP can change. With a name from [Dynamic DNS](https://xproxy.io/document/dynamic-dns-setup), customers never need a new address.

1. Open **Proxy Settings**, then **Address**. Choose **DDNS**, or **Custom** for your own domain.
2. Check the name and click **Save**.

The proxy list, Copy, Export, rotation links and the API now give out this name.

![Proxy Settings, Address tab: Source set to DDNS, the name it resolves to, and Save](https://media1.xproxy.io/docs/anywhere/ddns-address.webp)

**What's next?**

Give customers the proxy addresses and the proxy login. See [how to use the proxy format](https://xproxy.io/document/how-use-proxy-format-http-socks5).

Selling proxies? Continue with [Selling Platform](https://xproxy.io/document/how-use-selling-platform).

## Port forwarding or DMZ?

**Port forwarding (recommended)**

Only the proxy ports reach the box. Everything else stays closed. Use the list from the panel.

**DMZ (the quick way)**

One switch, and the router sends all internet traffic to the box. It is simple, but the whole box is open. Set both logins first.

## Something not working?

| You see | What to do |
| --- | --- |
| Router shows **Public IP not detected** | Check that the box has internet. Then open the menu again. |
| Only some proxies are reachable | The ports you did not forward are listed under **Forward these ports**. Add them, then **Re-check**. Added more modems later? Forward their ports too. |
| No proxy is reachable | Check each rule: protocol **TCP**, and the internal address is the one of your box. Did the box address change? Reserve it in your router (see [Static IP](https://xproxy.io/document/how-static-ip-for-server)). |
| Still closed, and the rules are right | Your internet provider may share one public IP between many customers. Then ports cannot be opened. Use [VPS forwarding](https://xproxy.io/document/vps-forwarding-to-use-difference-place) instead. |
| TCP works from outside, but SOCKS5 UDP apps (QUIC, games) get no answer | Forward **UDP 32768–60999** to the box, and set **SOCKS5 UDP behind a router** to **Router public IP (auto)** (Proxy Settings, General). Check with the [test script](https://xproxy.io/document/socks5-udp-associate#test). |
| SOCKS5 UDP works for some sessions, not for others | Run the [test script](https://xproxy.io/document/socks5-udp-associate#test) a few times and look at the relay port it prints. A port outside 32768–60999 means your box uses a wider port range: send the ports to support, or forward that range too. |
| Proxies are slow | Run **WAN speed**, **Test now**. Customers download over your home upload. Upgrade the upload speed of your internet plan. |
| The address changes every few days | Set up [Dynamic DNS](https://xproxy.io/document/dynamic-dns-setup) and give customers the name. |

---

Source: https://xproxy.io/document/how-public-access-xproxy
