# How to Change / Rotate IP of Proxy

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

Rotate the IP with one click, on a timer, or from your script. Includes the status and rotation API.

Get a new mobile IP when you want one: with one click, on a timer, or from your own script.

**You need:** a Basic plan or higher (the Free plan has no IP rotation) and a modem that is online in **Proxy Management**.

In short

**What it does**

The modem reconnects and the carrier gives it a new IP. Your proxy port stays the same.

**Three ways**

Click **Rotate**, set a **timer**, or call a **link** from your bot. Pick one below.

**A few seconds**

It depends on the modem and the carrier. Scripts should check the status, not wait a fixed time.

## Change the IP

**Step 1: Click Rotate (Click)**

Open **Proxy Management**. On the row of your proxy, click **Rotate**.

To change every modem at once, click **Rotate All**.

![Proxy Management with the Rotate button on a proxy row and the Rotate All button marked (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-1-list-v2.webp)

> **Nothing happens?** The Free plan has no IP rotation. Rotation needs a Basic plan or higher.

**Step 2: Check the new IP (Click)**

Wait a few seconds. The **Public IP** of that proxy changes. **Last Rotate** shows when it happened.

Your proxy port stays the same, so nothing changes in your tool. Connections that were open drop for a moment while the modem reconnects.

![Proxy Management row with the Public IP marked (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-1b-ip-v2.webp)

> Same IP as before? Some carriers hand the same IP back. See [Still the same IP?](#same-ip)

**Step 3: Open Schedule Rotation (Timer)**

Click the arrow next to **Rotate**, then **Schedule Rotation**.

Want the same timer on many proxies? Tick their boxes in the first column, click **Batch** in the toolbar and choose **Schedule Rotation**.

![Row menu opened with the arrow next to Rotate and the Schedule Rotation item marked (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-2-menu-v2.webp)

> Every rotation is saved. To see them, open **IP Rotation Log** in the same menu.

**Step 4: Set the time and save (Timer)**

1. Under **Run on every**, type a number and pick **seconds**, **minutes** or **hours**. For example `5` and **minutes**.
2. Pick **Forever** to rotate all day, or **Time range** to rotate only between two times.
3. Click **Add Job**.

The job shows in **Active Jobs**. Remove one there, or click **Remove all jobs**.

![Schedule Rotation window: Run on every 5 minutes, Forever, Add Job (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-3-schedule-v2.webp)

> Not sure what your timer does? Click **Estimate Time Run** to see the next 100 times it will run.

**Step 5: Copy the rotation link (Link)**

In **Proxy Management**, click **LINK** in the **Rotation** column of your proxy. The link is copied.

Opening that link makes the modem reconnect and get a new IP. Paste it into your bot, script or anti-detect browser.

![Proxy Management row with the LINK button in the Rotation column marked (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-4-link-v2.webp)

> The link looks like `http://192.168.1.10/reset?proxy=p:4001`. Treat it like a password: whoever can open it can rotate that proxy.

**Step 6: Use your own address (optional) (Link)**

Until you set a public address, the link starts with your box's local address. It then works only inside your network.

To use it from anywhere: open **Proxy Settings → Address**. Pick a **Source** (Public IP, DDNS, VPS relay or Custom). For **Custom**, type your domain or IP in **Domain or IP**.

Want a different domain for links only? Fill **Links &amp; API**. Add `https://` only if that domain serves HTTPS.

![Proxy Settings, Address tab: Source, Domain or IP and Links &amp; API fields marked (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-5-address-v1.webp)

> Reaching your box from outside needs [VPS Forwarding](https://xproxy.io/document/vps-forwarding-to-use-difference-place) or [NAT Forwarding](https://xproxy.io/document/how-public-access-xproxy).

**Step 7: Call the link from your tool (Link)**

Open the link with any HTTP GET. It answers at once, and the new IP follows a few seconds later:

Terminal

```
curl "http://192.168.1.10/reset?proxy=p:4001"
# {"status": true, "msg": "command_sent"}
```

To wait for the new IP in a script, see the [Developer API](#developer-api).

> Using AdsPower, GoLogin or another browser? They can call the link for you. Paste it in the proxy profile (see the integration guides).

## How long does a rotation take?

There is no single number. The panel answers at once, then the modem reconnects. The time depends on the kind of modem and on the carrier.

| Modem | What to expect |
| --- | --- |
| **Android phone** (NextGen app) | About 5 to 6 seconds on our test phones: the airplane-mode time (3 seconds by default) plus about 2 seconds to reconnect. A shorter airplane time is faster, but some carriers then keep the same IP. |
| **XH22 dongle** | **Method 1 · Fast &amp; stable** is the quickest. Methods 2 to 4 are slower. **Method 5 · Offline hold** keeps the modem off for a time you set (150 seconds by default) and your proxy is offline for that time. |
| **Other dongles and routers** | It depends on the model and on the method you pick in **Rotation Methods**. |

To change these: **Proxy Management → Rotation Settings** sets the delays, and **General Settings → Rotation Methods** picks the method for each kind of dongle.

![Rotation Settings window, General tab: Delay before rotation and Prevent rotation marked (demo data)](https://media1.xproxy.io/docs/use-proxies/rot-6-settings-v1.webp)

Rotation Settings → General: ① Delay before rotation · ② Prevent rotation (the shortest time between two rotations of one port). The **Dongle** and **Phone** tabs have **Delay during rotation**.

## Still the same IP?

| You see | What to do |
| --- | --- |
| The IP did not change | Some carriers hand back the same IP when the modem reconnects fast. Open **Rotation Settings → Duplicate IP** and turn on **Rotate if same IP**: the proxy then rotates again by itself. |
| Still the same IP on an XH22 dongle | In **General Settings → Rotation Methods**, try **Method 5 · Offline hold**. The carrier then gives a new IP after a longer offline time. |
| A rotation does not run right after another one | **Prevent rotation** sets the shortest time between two rotations of the same port. Lower it in **Rotation Settings → General**. |
| `need_upgrade` | Your plan has no IP rotation. See [Manage your subscription](https://xproxy.io/document/how-upgrade-subscription). |
| `modem_resetting` | A rotation is already running on that modem. Wait for it to end. |
| A link from outside your network does not open | The link still has your local address. Set a public address in **Proxy Settings → Address**. |

## Let your customers rotate

Selling proxies on the Business plan? Every customer proxy has its own token. The customer rotates their own proxy without your panel login:

```
curl "http://your-proxy-host/selling/rotate?token=TOKEN"
```

Per-port logins and the other customer links are in [How to use the Selling Platform](https://xproxy.io/document/how-use-selling-platform) and in [HTTP &amp; SOCKS5 proxy setup](https://xproxy.io/document/how-use-proxy-format-http-socks5).

## Developer API

The same calls the panel uses. The base URL is the address of your XProxy box, for example `http://192.168.1.100` or `http://myproxy.duckdns.org`.

**Rotate**

```bash
# by proxy (host:port)
curl 'http://192.168.1.100/api/v1/rotate_ip/proxy/localhost:4001'

# by position (1 = first modem)
curl 'http://192.168.1.100/api/v1/rotate_ip/position/1'

# the same call as the rotation link
curl 'http://192.168.1.100/reset?proxy=192.168.1.100:4001'

# every call answers at once:
# {"status": true, "msg": "command_sent"}
```

`msg` can also be `need_upgrade` (Free plan), `modem_resetting` (a rotation is already running) or `slot_not_found`.

**Status**

```bash
# the same for status: by proxy or by position
curl 'http://192.168.1.100/status?proxy=192.168.1.100:4001'
curl 'http://192.168.1.100/api/v1/status/proxy/localhost:4001'
curl 'http://192.168.1.100/api/v1/status/position/1'

# {
#   "status": true,
#   "public_ip": "203.0.113.25",
#   "public_ip_v6": null,
#   "last_public_ip": "198.51.100.7",
#   "msg": "MODEM_READY"
# }
```

Codes in `msg`: `MODEM_READY` ready · `MODEM_RESETTING` rotating now · `MODEM_NOT_FOUND` no modem on that port · `MODEM_DISCONNECTED` modem is off or unplugged · `COLLISION_IP` same IP as before the rotation (only when **IP unchanged detect** is on).

**Rotate and wait**

```
HOST=192.168.1.100
PROXY=$HOST:4001

OLD=$(curl -s "http://$HOST/status?proxy=$PROXY" | jq -r '.public_ip')
curl -s "http://$HOST/reset?proxy=$PROXY" > /dev/null

# wait up to 60 s for a ready modem with a different IP
for i in $(seq 1 60); do
  NEW=$(curl -s "http://$HOST/status?proxy=$PROXY" | jq -r 'select(.msg == "MODEM_READY") | .public_ip')
  if [ -n "$NEW" ] && [ "$NEW" != "$OLD" ]; then break; fi
  sleep 1
done
echo "$OLD -> $NEW"
```

Checking the status is better than a fixed sleep: the time a rotation takes depends on the modem and the carrier.

**Schedules**

```bash
# add a timer: every 5 minutes, all day, for the modem at position 1
curl 'http://192.168.1.100/v2/schedule/rotation_add_job' \
  --header 'Content-Type: application/json' \
  --data '{
    "run_per_day": "forever",
    "positions": [1],
    "interval": 5,
    "unit": "minutes",
    "specific_time": "00:00",
    "start_time": null,
    "end_time": null
  }'
# {"status": true, "msg": "Schedule rotation added successfully!"}

# list the timers of position 1
curl 'http://192.168.1.100/v2/schedule/rotation_jobs' \
  --header 'Content-Type: application/json' \
  --data '{"positions": [1], "page": 1, "limit": 5}'
```

The `/v2/schedule/…` calls need your panel login when you call them from outside your local network.

**Login:** the rotation and status calls work without a login unless **Force API Auth** is on (*General Settings → System Setting*). Then add your panel login, for example `curl -u USER:PASS …`.

The HTTP, SOCKS5, VLESS and VPN ports of one modem share its IP. A rotation changes the IP for all of them.

## What next?

Tools that call the link for you, and how to read the proxy list.

[HTTP &amp; SOCKS5 setup →](https://xproxy.io/document/how-use-proxy-format-http-socks5) [Proxy protocols →](https://xproxy.io/document/proxy-protocols-overview)

---

Source: https://xproxy.io/document/how-change-rotate-ip
