---
title: "Why Brokers Ask for a Primary and Secondary IP"
description: "Where the primary and secondary static IP slots on Indian broker APIs come from, how to use them for failover, the weekly change limits, and what one IP breaks."
canonical: https://fixedmark.com/blog/why-brokers-ask-for-primary-and-secondary-ip
updated: 2026-11-10
source: Fixedmark (https://fixedmark.com), BitMask LLP
---

Algo trading · 10 min read

# Why Brokers Ask for a Primary and Secondary IP

NSE's implementation standards for retail algo trading let a client register one primary static IP and an optional secondary IP for connectivity redundancy, so brokers built two slots. Use the second slot as a backup exit for the same bot on a separate failure domain, because each slot can change only about once a week.

## Where the two slots come from

The slots are not a broker invention. NSE circular [NSE/INVG/67858](https://nsearchives.nseindia.com/content/circulars/INVG67858.pdf), dated May 5, 2025, sets the implementation standards for SEBI's February 4, 2025 retail algo circular. Its API access section says a client must give the broker a static IP to get API access. The next line says the client may give only one static IP (primary), or add a secondary static IP "for the purpose of connectivity redundancy".

The same section sets three more rules that shape how you use the slots.

- Clients can update their mapped static IPs as needed, but not more than once a calendar week. A client who has already used the week's change can ask the broker for an exception in extenuating circumstances.
- A static IP can be mapped to only one client at a time. Clients can share one only within a family as SEBI defines it, after a written or 2FA-validated request to the broker.
- A client with several API keys can map every key to the same primary and secondary pair, or give each key its own pair.

So the secondary slot exists for one reason in the rules, which is redundancy. It is not a second seat for another person, and it is not meant as a spare you can rewrite every day. For the wider rules (the 10 orders per second threshold, algo registration, and the April 1, 2026 date), see [SEBI's algo trading static IP rules](https://fixedmark.com/blog/sebi-algo-trading-static-ip-rules).

## What each broker console accepts

The brokers below follow the NSE wording, with small differences that matter when you plan a change. The table lists what each broker's own pages state as of November 2026.

_Static IP slots and change limits by broker_

| Broker                                                                                                                             | Slots                                                 | Change limit                                                                                              | Worth knowing                                                                                                             |
| ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [Zerodha Kite Connect](https://support.zerodha.com/category/trading-and-markets/general-kite/kite-api/articles/static-ip)          | One primary (required), one optional secondary        | One modification per calendar week                                                                        | Only order placement is IP-checked. WebSocket data, the order book, and positions work from any IP.                       |
| [Upstox](https://upstox.com/developer/api-documentation/appendix/my-apps-support-for-algo-trading-circular/)                       | Primary (required) and secondary (optional), per user | Once per calendar week                                                                                    | A change invalidates existing access tokens. The API rejects a secondary equal to the primary.                            |
| [Angel One SmartAPI](https://www.angelone.in/news/market-updates/what-s-changing-in-angel-one-s-smartapi-access-from-april-1-2026) | Primary, plus an optional secondary for redundancy    | Not more than once a calendar week                                                                        | [IPv4 only for now](https://smartapi.angelone.in/smartapi/forum/post/18513) . Order and GTT endpoints need the static IP. |
| [Kotak Neo](https://www.kotakneo.com/platform/kotak-neo-trade-api/static-ip-details/)                                              | Two at most, primary and secondary                    | Once every 7 days                                                                                         | The session is bound to the IP that created it. IPv4 for now.                                                             |
| [Dhan](https://dhanhq.co/docs/v2/authentication/)                                                                                  | One primary, one secondary                            | 7 days after an IP is set, tracked per slot                                                               | IPv4 or IPv6 in either slot. Only order placement needs the whitelisted IP.                                               |
| [ICICI Direct Breeze](https://www.icicidirect.com/faqs/fno/how-many-static-ips-can-i-provide)                                      | One primary (required), one or more secondaries       | [Once per calendar week](https://www.icicidirect.com/faqs/fno/can-i-update-change-my-static-ip-if-needed) | Urgent exceptions go to the email address on the FAQ page.                                                                |

Two details stand out. Dhan's `getIP` response returns a separate `modifyDatePrimary` and `modifyDateSecondary`, so each slot carries its own cooldown. Upstox sets both addresses in one API call and returns `primary_ip_updated_at` and `secondary_ip_updated_at`. Calendar week and 7 days are also different rules, so read your broker's wording before you count days. Step-by-step console instructions are in the [broker guides](https://fixedmark.com/docs/brokers).

## Two slots for one bot, not two bots

The tempting setup is to run one strategy on a home machine registered as primary and another on a VPS registered as secondary. The broker will usually accept that. Kotak Neo states that orders can come from two sessions at once, one created from each IP. A Zerodha team reply on the [Z-Connect post about the NSE circular](https://zerodha.com/z-connect/general/a-comprehensive-overview-of-nses-circular-on-the-new-retail-algo-trading-framework) also answered yes when asked whether the primary and backup could run at the same time.

It works, but you have spent the redundancy. Each bot now has exactly one registered exit. If the VPS host has an outage, the VPS bot stops placing orders, and the home machine cannot pick up its positions without code to do so. You then need a third IP, and the weekly change limit means you may wait days to register it.

The pattern the rules have in mind is one bot with two ways out. The bot sends orders through the primary IP. If that path fails before the order leaves, it sends the same order through the secondary IP. The two paths should fail for different reasons, so put them in different failure domains.

- Two VMs at two different providers, each with its own static IP, one running your bot and the other running a small forward proxy.
- One VM with a floating IP as primary, plus a VM elsewhere as secondary. AWS describes an [Elastic IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) as a way to mask an instance failure by remapping the address to another instance. An Elastic IP is tied to one AWS Region, so the secondary should live outside that Region.
- A VM or home static IP as primary, plus a static IP proxy as secondary.
- A static IP pair from one provider that runs the two addresses on separate nodes and moves an address when its node fails.

Two addresses on the same machine, or two addresses from the same home connection, do not count. They fail together. The general case for pairs outside trading is in [static IP pairs and failover](https://fixedmark.com/blog/static-ip-pairs-and-failover).

## Wire the secondary as a failover path

Start by proving that each path leaves from the address you registered. Run the check from the same machine and with the same proxy settings your bot uses. The examples below use `api.ipify.org`, which [answers over IPv4 only](https://www.ipify.org/), so it also catches a path that cannot reach the internet over IPv4.

**Terminal**

```bash
# Each command must print the IP in the matching broker slot.
curl -s --proxy "$EGRESS_PRIMARY_PROXY" https://api.ipify.org; echo
curl -s --proxy "$EGRESS_SECONDARY_PROXY" https://api.ipify.org; echo
```

Failover for orders has one hard rule. Retry on the other path only when you know the first attempt never reached the broker. A proxy that refuses the connection, or a connect timeout, happens before the order request is written. A read timeout or a reset after sending is different. The broker may have accepted the order and the reply was lost. Retrying blindly can place it twice.

For the unclear case, tag every order and look it up before you retry. Kite Connect's [orders API](https://kite.trade/docs/connect/v3/orders/) takes an optional alphanumeric `tag` of up to 20 characters and returns it in `GET /orders`, and Zerodha does not IP-check the order book. The sketch below uses Python `requests` with one session per path.

**orders.py**

```python
import os
import uuid

import requests

KITE = "https://api.kite.trade"
HEADERS = {
    "X-Kite-Version": "3",
    "Authorization": f"token {os.environ['KITE_API_KEY']}:{os.environ['KITE_ACCESS_TOKEN']}",
}

# Each path is a proxy that leaves from one registered static IP.
PATHS = {
    "primary": os.environ["EGRESS_PRIMARY_PROXY"],
    "secondary": os.environ["EGRESS_SECONDARY_PROXY"],
}

# Raised before the order request is sent, so a retry cannot duplicate it.
NOT_SENT = (requests.exceptions.ProxyError, requests.exceptions.ConnectTimeout)

def make_session(proxy_url: str) -> requests.Session:
    s = requests.Session()
    s.trust_env = False  # ignore HTTPS_PROXY so each session uses only its path
    s.proxies = {"https": proxy_url}
    s.headers.update(HEADERS)
    return s

SESSIONS = {name: make_session(url) for name, url in PATHS.items()}

def orders_with_tag(tag: str) -> list[dict]:
    for s in SESSIONS.values():
        try:
            r = s.get(f"{KITE}/orders", timeout=(3, 10))
            r.raise_for_status()
            return [o for o in r.json()["data"] if o.get("tag") == tag]
        except requests.RequestException:
            continue
    raise RuntimeError("order book unreachable on both paths")

def place_order(params: dict) -> str:
    tag = uuid.uuid4().hex[:20]
    body = {**params, "tag": tag}
    for name, s in SESSIONS.items():
        try:
            r = s.post(f"{KITE}/orders/regular", data=body, timeout=(3, 10))
        except NOT_SENT:
            print(f"{name} path down before sending, trying the next one")
            continue
        except requests.RequestException:
            # The request may have reached the broker. Look before retrying.
            found = orders_with_tag(tag)
            if found:
                return found[0]["order_id"]
            raise
        r.raise_for_status()
        return r.json()["data"]["order_id"]
    raise RuntimeError("both paths failed before sending")
```

If the lookup finds nothing, the code raises instead of resending. An order can take a moment to appear, so a missing tag is not proof that the order failed. Alert yourself and decide by hand, or poll the order book for a few seconds before you try again. Kite also states that a successful placement response means the order reached its order management system, not that it executed, so confirm status by `order_id` either way.

This is general technical information, not legal or investment advice. Test failover outside market hours, and with the smallest order size your strategy allows, before you rely on it.

## Plan IP changes around the weekly limit

Two slots also let you move to a new provider without a gap. Change one slot, move traffic, then change the other slot after the cooldown. At every point one registered address keeps working.

1. 1

   **Bring up the new egress first** Start the new VM or proxy and confirm its address with the curl check above. Do not touch the broker yet.
2. 2

   **Week one, replace the secondary** Put the new address in the secondary slot and keep the old primary. Do it after market hours, because Upstox invalidates access tokens on a change and Kotak Neo needs a new session.
3. 3

   **Move order traffic to the new address** Point the bot's primary path at the new egress and keep the old one as the fallback. Watch a few sessions of real orders.
4. 4

   **Week two, replace the primary** Once the cooldown has passed, put the second new address in the primary slot. Retire the old machine only after this change shows up in the console.

On Upstox you can make the change with the [Update Static IPs API](https://upstox.com/developer/api-documentation/update-app-static-ips/). It takes both addresses in one request, so send the unchanged primary with the new secondary. The response includes `access_tokens_invalidated`, and when it is `true` you must repeat the login flow. The examples use documentation addresses from 203.0.113.0/24 and 198.51.100.0/24.

**Terminal**

```bash
curl -X PUT https://api.upstox.com/v2/user/ip \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $UPSTOX_ACCESS_TOKEN" \
  -d '{"primary_ip": "203.0.113.10", "secondary_ip": "198.51.100.20"}'
```

On Dhan, read each slot's next change date before you plan. The `getIP` endpoint returns `primaryIP`, `secondaryIP`, `modifyDatePrimary`, and `modifyDateSecondary`. Changes go through `modifyIP` with an `ipFlag` of `PRIMARY` or `SECONDARY`, and only inside the allowed window.

**Terminal**

```bash
curl https://api.dhan.co/v2/ip/getIP \
  -H "Accept: application/json" \
  -H "access-token: $DHAN_ACCESS_TOKEN"
```

If you burn the week's change and then lose the new address, the NSE standards allow the broker to grant an exception in extenuating circumstances. ICICI Direct names an email address for urgent exceptions. Treat that as a last resort, not a plan.

## What breaks when both slots hold one IP

Some traders type the same address into both fields to make the form look complete. Upstox will not take it. Its Update Static IPs API returns `UDAPI1184` when `primary_ip` and `secondary_ip` are the same. Where a console does accept it, you have one IP with extra steps.

- One outage stops all orders. A host failure, an ISP fault, or a provider incident at that address leaves the bot with no registered exit.
- Recovery waits on the cooldown. The replacement address needs a slot change, and if you already changed this week, you are asking support for an exception during market hours.
- An address you do not control is worse than an empty slot. A dynamic home IP in the secondary slot stops matching when the router reconnects, and NSE rules map an IP to one client at a time, so a reassigned address can belong to someone else.
- Reusing your address on a second account fails. A user on the [SmartAPI forum](https://smartapi.angelone.in/smartapi/forum/post/18513) reported the error `Primary Static IP is already associated with another app` when registering the same IP for a family member's account. Family sharing needs the broker's formal process.

Two more failures look like slot problems but are not. If your machine prefers IPv6 and both slots hold IPv4 addresses, orders leave from an address the broker never saw. Angel One and Kotak Neo accept only IPv4 for now, so force IPv4 in the order client. See [IPv6 egress and IPv4-only allowlists](https://fixedmark.com/blog/ipv6-egress-and-ipv4-only-allowlists).

The second is session binding. Kotak Neo binds the API session to the IP that created it and rejects an order from another IP with `stCode` 1037 and the message `session ip doesnt match with reqest ip` (spelled that way on its page). If your egress can switch between the two addresses mid-session, create the session on the path that sends the orders, and log in again on that path after a failover. For other rejection messages, see [fixing IP not whitelisted errors](https://fixedmark.com/blog/fixing-ip-not-whitelisted-errors-on-broker-apis).

## Doing this with Fixedmark

Fixedmark gives an account a dedicated pair of static IPv4 addresses in a region, including Mumbai. You register the first address as primary and the second as secondary. Each region runs at least two proxy nodes with one address on each. When a node fails, the other node takes over its address, so both registered addresses keep working without client-side path switching. How that works is in [IP pairs and high availability](https://fixedmark.com/docs/concepts#ip-pairs).

Two things follow from that design. First, each new connection can leave from either address, so register both or some orders will fail. Second, open connections on a failed node drop. The reconcile-before-retry rule above still applies, because a reset after sending is exactly the unclear case.

Because requests are spread across the pair, a broker that binds sessions to one IP needs care. Kotak Neo needs the session created from the IP that sends the orders, and a new connection after login can leave from the other address. The Fixedmark docs do not describe a way to pin a connection to one address, so ask [Fixedmark support](https://fixedmark.com/docs/support) before you rely on the pair with Kotak Neo.

Fixedmark is in early access and not generally available. The planned India Trader plan includes a dedicated Mumbai pair. See [planned India pricing](https://fixedmark.com/india/algo-trading-static-ip). Setup per broker is in the [broker guides](https://fixedmark.com/docs/brokers). Before you register anything, [verify your egress IP](https://fixedmark.com/docs/verify-egress-ip). One check shows one address, and seeing only one after several is fine. Register both anyway.

## Sources

Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

- [NSE circular NSE/INVG/67858: implementation standards for retail algo trading](https://nsearchives.nseindia.com/content/circulars/INVG67858.pdf)
- [Zerodha support: static IP for Kite Connect](https://support.zerodha.com/category/trading-and-markets/general-kite/kite-api/articles/static-ip)
- [Zerodha Z-Connect: overview of NSE's retail algo circular](https://zerodha.com/z-connect/general/a-comprehensive-overview-of-nses-circular-on-the-new-retail-algo-trading-framework)
- [Upstox developer docs: My Apps support for the algo trading circular](https://upstox.com/developer/api-documentation/appendix/my-apps-support-for-algo-trading-circular/)
- [Upstox developer docs: Update Static IPs API](https://upstox.com/developer/api-documentation/update-app-static-ips/)
- [Kotak Neo: static IP details for the Trade API](https://www.kotakneo.com/platform/kotak-neo-trade-api/static-ip-details/)
- [DhanHQ API v2: authentication and static IP](https://dhanhq.co/docs/v2/authentication/)
- [Angel One: what's changing in SmartAPI access from April 1, 2026](https://www.angelone.in/news/market-updates/what-s-changing-in-angel-one-s-smartapi-access-from-april-1-2026)
- [SmartAPI forum: static IP updates](https://smartapi.angelone.in/smartapi/forum/post/18513)
- [ICICI Direct FAQ: how many static IPs can I provide?](https://www.icicidirect.com/faqs/fno/how-many-static-ips-can-i-provide)
- [ICICI Direct FAQ: can I change my static IP?](https://www.icicidirect.com/faqs/fno/can-i-update-change-my-static-ip-if-needed)
- [Kite Connect v3: orders API](https://kite.trade/docs/connect/v3/orders/)
- [AWS: Elastic IP addresses](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)

Keep reading

## Related guides

- [Guide Static IP for algo trading A dedicated Mumbai IPv4 pair for your broker's primary and secondary slots.](https://fixedmark.com/india/algo-trading-static-ip)
- [Tool What's my IP Check the address your machine or proxy actually leaves from.](https://fixedmark.com/tools/whats-my-ip)
- [Guide Regions Mumbai, Singapore, and US regions for static IP pairs.](https://fixedmark.com/regions)
- [Integration Railway A dedicated IP pair for Railway services when shared static IPs are not enough.](https://fixedmark.com/integrations/railway)
- [Integration AWS Lambda A fixed IP for Lambda without VPC, subnets, and two NAT Gateways.](https://fixedmark.com/integrations/aws-lambda)

## Frequently asked questions

### Is the secondary static IP mandatory?

No. NSE's standards make the primary IP required and the secondary optional, for connectivity redundancy. Zerodha, Upstox, Angel One, Kotak Neo, and ICICI Direct all describe the secondary as optional.

### Can I place orders from the primary and secondary IP at the same time?

At the brokers that have said so, yes. Kotak Neo allows one session from each IP at once, and a Zerodha team reply said both can run at the same time. Using both for two separate bots removes the backup, so keep one bot with two exits if you want failover.

### How often can I change my broker static IP?

NSE sets the limit at once a calendar week, with broker exceptions for extenuating circumstances. Zerodha, Upstox, Angel One, and ICICI Direct say once per calendar week. Kotak Neo and Dhan say 7 days, and Dhan tracks the date per slot.

### Can I put the same IP in both slots?

Upstox rejects it with error \`UDAPI1184\`. Where a console accepts it, you gain nothing, because one outage still stops every order and the replacement waits on the change limit.

### Does the market data WebSocket need the static IP?

Not at the brokers that document it. Zerodha says the WebSocket, order book, and positions work from any IP, and Kotak Neo and Dhan limit the check to order APIs. Only order calls must leave from a registered address.
