Files
config-ros/README.md
2025-09-28 18:05:21 +08:00

94 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 使用说明
一、上传 ros 镜像,位置在 `templates` 目录下
二、为 ros 配置公网 IP 与网关,并重置 mac 地址
```
/ip/address/set 0 address=公网地址/掩码
/ip/route/set 0 gateway=网关地址
/interface/ethernet/reset-mac-address wan
```
三、将需要部署的 ros 配置条目从 `config.bak.csv` 中复制到 `config.csv`
四、执行 `main.py`
## 部署流程
**参数**
- 默认网关
- 公网 CIDR
- 内网 CIDR
- RADIUS 配置
- NAT 网关
- 节点 IP 池
- 节点地区编号
- 城市数量
- 窗口数量
- 连接报告地址
- 日志报告地址
**配置网络**
刷新 mac 地址(手动)
默认网关(手动 [默认网关]
wan 口 ip手动 [公网 CIDR]
lan 口 ip[内网 CIDR]
**配置 vpn**
地址池172.17.0.0/16
ppp profile本地地址地址池
pptp & l2tp & sstp 服务端profile
ppp secrets & radius[RADIUS 配置]
路由表默认路由路由策略default => [NAT 网关]172.17.0.0/16 => vpn
**配置 nat**
ospf 路由表,黑洞路由([节点 IP 池]
实例,区域,模板;在 lan 上的 area0 区域重分发黑洞路由表上的静态路由区域
**配置脚本**
上线脚本:
- 删除旧 nat 规则
- 根据[节点地区编号][城市数量][窗口数量]生成 ipv4 地址生成 snat 规则172.16.x.x => 10.i.j.k
- 上报开始占用
下线脚本:
- 删除旧 nat 规则
- 上报解除占用
清理超时连接9 小时):
- 查找并删除在线超过 24 小时的连接
报告用户在线数量5 分钟):
- 查找并上报用户在线数量
配置脚本调度
挂载上下线脚本到 ppp profile
**配置日志**
上报到远程地址
## 单地区
### 添加 ros 后应该改什么
域名:
- A 解析单地区
- CNAME 解析省混合
## 混拨