# 网络要求

要在 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（推荐）

* 为租户提供稳定连接
* 更适合 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: 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:

```
GET https://docs.clore.ai/clore.ai/clore.ai-eng-zh/zhen-dui-zhu-ji/installing-clore-hosting/network-requirements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
