> For the complete documentation index, see [llms.txt](https://docs.ipwo.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipwo.net/huan-jing-zhun-bei/bai-ming-dan-yu-ben-ji-ip-shuo-ming.md).

# 白名单与本机IP说明

在使用 [API 提取](/huo-qu-yu-pei-zhi-dai-li/ru-he-huo-qu-dai-li/api-ti-qu.md)代理时，需要正确配置 [IP 白名单](/huo-qu-yu-pei-zhi-dai-li/ip-bai-ming-dan.md)。

👉 白名单用于验证请求来源，仅允许指定公网 IP 访问 API。

很多用户配置失败，通常是因为不了解「本机 IP」与「公网 IP」的区别。

***

### 🌍 什么是[本机公网 IP](/huan-jing-zhun-bei/ru-he-jian-ce-ben-ji-gong-wang-ip.md)？

公网 IP 是当前网络对外访问时显示的 IP 地址。

API 白名单校验的就是：

👉 当前请求 API 的公网 IP。

***

### ⚠️ 注意：不是电脑本地 IP

以下属于本地 / 内网 IP：

```
192.168.x.x
10.x.x.x
172.x.x.x
```

👉 这些不能用于白名单配置。

***

### ✅ 正确的白名单 IP

正确示例：

```
123.123.123.123
```

👉 必须填写公网 IP。

***

### 🌐 如何查看当前公网 IP？

推荐访问：

```
https://ipinfo.io
```

或：

```
https://api.ipify.org
```

***

#### 返回示例

```
123.123.123.123
```

👉 显示的即为当前公网 IP。

***

### ⚙️ 为什么 API 需要白名单？

API 提取方式无需用户名和密码认证。

因此：

👉 系统会通过白名单限制可访问 API 的设备。

只有已加入白名单的公网 IP 才允许访问 API。

***

### 🛠 白名单配置步骤

进入：

```
用户中心 → IP 白名单
```

***

#### 配置流程

```
查看公网 IP
↓
复制公网 IP
↓
添加至白名单
↓
保存配置
```

***

### ⚠️ 为什么添加后仍不生效？

常见原因包括：

* 添加了错误 IP
* 当前网络公网 IP 已变化
* 请求来自其他服务器
* 白名单尚未同步

***

### 🌍 使用服务器时需要注意什么？

如果程序运行在：

* 海外 VPS
* Linux 服务器
* 云服务器

👉 白名单应填写服务器公网 IP，而不是本地电脑 IP。

***

### 💡 家庭网络用户注意事项

部分家庭宽带：

* 使用动态公网 IP
* 重启网络后 IP 会变化

可能导致：

👉 白名单偶尔失效。

***

#### 建议：

公网 IP 变化后重新更新白名单。

***

### ⚙️ Docker / 云函数环境说明

部分环境：

* Docker
* 容器服务
* 云函数

实际出口 IP 可能与服务器 IP 不一致。

***

#### 建议：

在实际运行环境中访问：

```
https://ipinfo.io
```

确认真实出口 IP。

***

### ❗ 常见问题

#### 为什么本地测试正常，服务器无法访问 API？

通常是：

👉 服务器公网 IP 未加入白名单。

***

#### 为什么更换网络后 API 失效？

可能原因：

👉 当前公网 IP 已变化。

***

#### 白名单支持填写多个 IP 吗？

支持。

👉 可根据实际业务添加多个公网 IP。

***

### 🆘 遇到问题怎么办？

如果 API 无法访问：

建议优先检查：

* 当前公网 IP
* 白名单配置
* 请求来源服务器

***

### 总结

API 白名单校验逻辑：

```
请求 API
↓
检查公网 IP
↓
匹配白名单
↓
允许访问
```

👉 白名单中必须填写真实公网 IP

***


---

# 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.ipwo.net/huan-jing-zhun-bei/bai-ming-dan-yu-ben-ji-ip-shuo-ming.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.
