> For the complete documentation index, see [llms.txt](https://docs.samita.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samita.io/b2b-lock-password-protect/access-rules/certain-ip-addresses.md).

# Certain IP addresses

Match visitors whose public IP address exactly matches an address on a merchant-entered list.

**Certain IP addresses** matches a visitor based on their exact public IP address against a list you enter. It's a good fit for gating content to a known, fixed set of locations — for example, letting only your office or warehouse network see an internal catalog or a testing page.

{% hint style="warning" %}
**This rule matches exact public IP addresses only**; IP ranges, CIDR blocks (such as `192.168.1.0/24`), and wildcards are not supported. Enter each address separately, and update the list if your network uses a changing IP address.
{% endhint %}

Like most access rules (aside from the action-based ones such as Passcode, Secret link, Subscribe, and Confirmation prompt), Certain IP addresses can be set to match **If** the visitor's IP is on your list, or **Unless** it is — inverting it to match every other IP instead. See [Combining rules](/b2b-lock-password-protect/access-rules/combining-rules.md).

## Add the rule

1. Open **Locks** and create a new lock, or open an existing one to edit it.
2. Choose the content you want to protect. See [Access rules overview](/b2b-lock-password-protect/access-rules/overview.md) for how rules fit into a lock.
3. Click the **Unlock rules** tab, then in the **Condition type** dropdown, select **Certain IP addresses**.

<figure><img src="https://27754559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF4qMYopXntYz9YgUqZSo%2Fuploads%2Fgit-blob-a69b9fbc5f0fb3c8afe1db62096e205ac48cfbfd%2Fscreenshot-access-rules-picker-certain-ip-addresses.png?alt=media" alt="The Unlock rules tab with Certain IP addresses selected in the Condition type dropdown."><figcaption><p>Select Certain IP addresses from the Condition type dropdown on the Unlock rules tab.</p></figcaption></figure>

4. Enter the exact public IP address(es) you want to match. You can add more than one.

<figure><img src="https://27754559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF4qMYopXntYz9YgUqZSo%2Fuploads%2Fgit-blob-3f8833c5f85661fdfb7335c1cbc4fab25bc5c478%2Fscreenshot-access-rules-certain-ip-addresses-config.png?alt=media" alt="The Certain IP addresses rule settings, showing a list input for entering exact IP addresses."><figcaption><p>Add each exact public IP address this rule should match — no ranges or wildcards.</p></figcaption></figure>

5. Choose **If** or **Unless**.
6. Click **Save**.

{% hint style="info" %}
To find the public IP address to enter for a location like your office or warehouse, search "what is my IP" from a browser on that network, or check with whoever manages that network's internet connection.
{% endhint %}

## Example: Limit an internal price list to the office network

Suppose the office's fixed public IP address is `203.0.113.10`, and only visitors using that network should see an internal price list.

1. Select the **Internal price list** page as the content to protect.

<figure><img src="https://27754559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF4qMYopXntYz9YgUqZSo%2Fuploads%2Fgit-blob-b15c5652db9fc8606172ef715497f987e51b7ff8%2Fscreenshot-example-certain-ip-addresses-content.png?alt=media" alt="The Lock setup tab with Specific Page as the content type and the Internal price list page listed under Restricted pages."><figcaption><p>Pick the page you want to keep on the office network.</p></figcaption></figure>

2. Add **Certain IP addresses**, choose **If**, and enter `203.0.113.10`. Click **Add IP address** to turn it into a chip — the value isn't saved until you do.

<figure><img src="https://27754559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF4qMYopXntYz9YgUqZSo%2Fuploads%2Fgit-blob-7167a490a31d04b7995b19c4171806ecc608c2b6%2Fscreenshot-example-certain-ip-addresses-rule.png?alt=media" alt="The Certain IP addresses condition with Rule logic set to If and 203.0.113.10 added as a chip below the IP addresses field."><figcaption><p>The condition heading confirms the value: If the visitor IP address matches 203.0.113.10.</p></figcaption></figure>

3. Leave the rule's **Redirect URL** empty.
4. Set the **Access denied message** to:

> This page is only available when you’re connected to an approved network.

<figure><img src="https://27754559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF4qMYopXntYz9YgUqZSo%2Fuploads%2Fgit-blob-3b4c86a35c03e3cd0be83cc2eabfe087b9e3b7b2%2Fscreenshot-example-certain-ip-addresses-message.png?alt=media" alt="The Messages card showing the Access denied message set to the approved-network wording, with the Preview panel rendering it."><figcaption><p>This rule has only one message field. The Preview panel shows the wording as shoppers will read it.</p></figcaption></figure>

5. Click **Save**.

### Result on the storefront

A visitor whose public IP is exactly `203.0.113.10` can open the page. Any other IP address fails the rule and sees the message above. If the office's public IP changes, update the value in the rule before access can work again.

<figure><img src="https://27754559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF4qMYopXntYz9YgUqZSo%2Fuploads%2Fgit-blob-8f7e59ea005827cd0d6136b46bda0dbff65cb4c6%2Fscreenshot-example-certain-ip-addresses-result.png?alt=media" alt="The Internal price list page displaying the configured approved-network message."><figcaption><p>A visitor outside the allowed IP address sees the Access denied message from this example.</p></figcaption></figure>

## Related docs

* [Access rules overview](/b2b-lock-password-protect/access-rules/overview.md)
* [Combining rules](/b2b-lock-password-protect/access-rules/combining-rules.md)
* [Location](/b2b-lock-password-protect/access-rules/location.md)
* [Shop domain](/b2b-lock-password-protect/access-rules/shop-domain.md)


---

# 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://docs.samita.io/b2b-lock-password-protect/access-rules/certain-ip-addresses.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.
