C#

china-ip-list

每小时更新中国IP范围列表,Update Mainland China ip‘s list in everyhour

M

mayaxcn

Dernière activité 29 sept. 2026
mayaxcn/china-ip-list

779

étoiles

112

forks

2

issues ouvertes

chinachina-ip-listchina-ipv6chn-ipchnrouteip

Ce README est souvent en anglais.

Mainland China IP List (IPv4 + IPv6)

根据亚太互联网络信息中心(APNIC)的亚太地区 IP 地址分配列表,自动更新中国大陆 IP 数据。

每 8 小时 自动更新一次(UTC 00:00 / 08:00 / 16:00,对应北京时间 08:00 / 16:00 / 00:00)。 Auto-updated every 8 hours (UTC 00:00 / 08:00 / 16:00).

⚠️ This project targets .NET 7, which is out of official support. The generated IP data is sourced from public APNIC statistics and provided as-is, without warranty.

数据来源

APNIC Delegated Statistics: https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest

输出文件

文件 内容 格式
chnroute.txt IPv4 CIDR <ip>/<prefix>
chn_ip.txt IPv4 范围 <start_ip> <end_ip>
chnroute_v6.txt IPv6 CIDR <ip>/<prefix>
chn_ip_v6.txt IPv6 范围 <start_ip> <end_ip>

使用方式

路由器 (OpenWrt) / 防火墙:直接使用 CIDR 文件

其他客户端:使用范围格式

本地构建

dotnet build --configuration Release
dotnet run --project china_ip_list.csproj --configuration Release

输出文件会写入 bin/Release/net7.0/。

自定义更新频率

公开仓库在 GitHub Actions 上的最小触发间隔是 5 分钟。 如需更高频更新,请 fork 后修改 .github/workflows/get_chn_ip.yml 中的 cron 表达式,例如:

- cron: '*/30 * * * *'   # 每 30 分钟一次

注意:APNIC 源站点的 delegated 列表每天只更新若干次,过高的轮询频率不会获得更及时的数据,反而会增加源站负担。

License

MIT — see LICENSE. Generated IP data derives from the APNIC public registry.

Projets similaires

中国运营商IPv4/IPv6地址库-每日更新

Rustasnbgpdaily
Ggaoyifan
3,6 k étoiles348

ASN and IP List in China (Daily Update)

Pythonasnasn-chinaip
Mmissuo
232 étoiles33

IP CIDRs List / IP 地址列表

JavaScriptchinalistcidrip
Mmetowolf
1,7 k étoiles234