> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/clore.ai/clore.ai-eng-zh/mian-xiang-zhu-ji-ti-gong-zhe/installing-clore-hosting/network-requirements.md).

# 网络要求

要在 Clore.ai 上成功托管 GPU 服务器，你的网络必须满足以下要求。

## 最低要求

| 参数    | 要求            |
| ----- | ------------- |
| 下载速度  | 最低 100 Mbps   |
| 上传速度  | 最低 100 Mbps   |
| 延迟    | 到主要地区 < 100ms |
| IP 类型 | 静态或动态（更推荐静态）  |

> **注意：** 更高的带宽会带来更好的服务器评分和更多租赁。

## 所需端口

以下端口必须可从互联网访问：

| 端口        | 协议      | 用途                     |
| --------- | ------- | ---------------------- |
| 22        | TCP     | SSH 访问（或自定义 SSH 端口）    |
| 8080      | TCP     | Jupyter Notebook（如果启用） |
| 3000-4000 | TCP     | 应用程序端口（可配置）            |
| 自定义       | TCP/UDP | 如服务器设置中所定义             |

## 防火墙配置

### UFW（Ubuntu）

```bash
# 允许 SSH
sudo ufw allow 22/tcp

# 允许 Jupyter
sudo ufw allow 8080/tcp

# 允许应用程序端口范围
sudo ufw allow 3000:4000/tcp

# 启用防火墙
sudo ufw enable
```

### iptables

```bash
# 允许 SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

# 允许 Jupyter
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

# 允许端口范围
iptables -A INPUT -p tcp --dport 3000:4000 -j ACCEPT

# 保存规则
iptables-save > /etc/iptables/rules.v4
```

## NAT / 端口转发

如果你的服务器位于路由器之后：

1. **访问路由器管理面板** （通常是 192.168.1.1）
2. **找到端口转发部分**
3. **转发所需端口** 到你的服务器内部 IP
4. **为你的服务器** 设置静态内部 IP

### 端口转发规则示例

| 外部端口  | 内部 IP         | 内部端口 | 协议  |
| ----- | ------------- | ---- | --- |
| 22022 | 192.168.1.100 | 22   | TCP |
| 8080  | 192.168.1.100 | 8080 | TCP |

## 静态 IP 与动态 IP

### 静态 IP（推荐）

* 为租户提供稳定的连接
* 更适合 DNS 和书签
* 更高的服务器可靠性评分

### 动态 IP

* 可用，但需要 DDNS 服务
* IP 变化可能会短暂中断租赁
* 在你的服务器上配置 DDNS 客户端：

```bash
# 以 ddclient 为例
sudo apt install ddclient
sudo nano /etc/ddclient.conf
```

## 带宽注意事项

### 对收益的影响

| 速度        | 影响                 |
| --------- | ------------------ |
| 100 Mbps  | 最低 - 基础租赁          |
| 500 Mbps  | 良好 - 适合大多数机器学习工作负载 |
| 1 Gbps 以上 | 优秀 - 吸引高端租户        |

### 带宽监控

```bash
# 安装监控工具
sudo apt install iftop

# 实时监控
sudo iftop -i eth0
```

## 网络测试

### 测速

```bash
# 安装 speedtest
sudo apt install speedtest-cli

# 运行测试
speedtest-cli
```

### 延迟测试

```bash
# 测试常见地区
ping -c 10 8.8.8.8        # Google DNS
ping -c 10 1.1.1.1        # Cloudflare
```

### 端口可访问性测试

从你的网络外部验证端口是否已打开：

```bash
# 使用另一台机器上的 nmap
nmap -p 22,8080 YOUR_PUBLIC_IP

# 或使用在线端口检查器
# https://www.yougetsignal.com/tools/open-ports/
```

## 故障排除

### 端口无法访问

1. 检查服务器上的防火墙规则
2. 验证路由器端口转发
3. 联系 ISP - 有些会屏蔽托管
4. 尝试不同的端口号

### 连接缓慢

1. 运行测速
2. 检查是否存在带宽限速
3. 考虑升级你的互联网套餐
4. 优化服务器网络设置：

```bash
# 增大网络缓冲区大小
sudo sysctl -w net.core.rmem_max=16777216
sudo sysctl -w net.core.wmem_max=16777216
```

### 连接断开

1. 检查 IP 地址是否变化
2. 验证路由器稳定性
3. 监控系统日志： `dmesg | grep -i network`
4. 考虑使用以太网而不是 WiFi


---

# 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.clore.ai/clore.ai/clore.ai-eng-zh/mian-xiang-zhu-ji-ti-gong-zhe/installing-clore-hosting/network-requirements.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.
