Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

亚马逊 (AWS) 的 CloudFront CDN 的全部 IP 段(本软件也支持对其他 CDN 测速) #180

Closed
XIU2 opened this issue Feb 19, 2022 · 12 comments
Labels
工具教程 辅助工具 或 技巧教程

Comments

@XIU2
Copy link
Owner

XIU2 commented Feb 19, 2022

可能很多人都不知道,虽然软件名字里有个 Cloudflare,但其实也支持对其他网站 IP / CDN IP 进行测速的。

前段时间 AWS 的 CloudFront CDN 宣布免费 1TB 流量,因此不少人开始尝试使用这个对国内速度更友好的 CDN 了(有很多亚洲直连节点),我印象中 AWS CloudFront CDN 也是和 Cloudflare CDN 一样,支持自选 IP 的,因此大家可以试试~

注意,似乎 AWS CloudFront 回源(即你的上传)是收费的?具体我不太清楚,大家使用前记得先确认一下。
另外,我自己是没用过 CloudFront CDN 的,所以我无法解答相关问题
,我只能解答 CloudflareST 的使用问题。


# AWS CloudFront CDN 官方公布的 IP 段

我对后者格式化后(使其可用于 CloudflareST 测速),得到了以下 IP 段列表,不过我不清楚 Global 与 Regional Edge 的区别,有懂的可以告诉我,不懂得自行摸索~ 另外,下面格式化好的 IP 段可能不是最新的请以官方提供的 IP 列表为准

CloudFront Global IPv4 列表 - 点击展开
13.224.0.0/14
13.249.0.0/16
13.32.0.0/15
13.35.0.0/16
15.158.0.0/16
18.154.0.0/15
18.160.0.0/15
18.164.0.0/15
18.172.0.0/15
18.238.0.0/15
18.244.0.0/15
18.64.0.0/14
36.103.232.0/25
36.103.232.128/26
52.124.128.0/17
52.222.128.0/17
52.46.0.0/18
52.82.128.0/19
52.84.0.0/15
54.182.0.0/16
54.192.0.0/16
54.230.0.0/17
54.230.128.0/18
54.230.200.0/21
54.230.208.0/20
54.230.224.0/19
54.239.128.0/18
54.239.192.0/19
54.240.128.0/18
58.254.138.0/25
58.254.138.128/26
64.252.128.0/18
64.252.64.0/18
65.8.0.0/16
65.9.0.0/17
65.9.128.0/18
70.132.0.0/18
71.152.0.0/17
99.84.0.0/16
99.86.0.0/16
108.138.0.0/15
108.156.0.0/14
116.129.226.0/25
116.129.226.128/26
118.193.97.128/25
118.193.97.64/26
119.147.182.0/25
119.147.182.128/26
120.232.236.0/25
120.232.236.128/26
120.253.240.192/26
120.253.241.160/27
120.253.245.128/26
120.253.245.192/27
120.52.12.64/26
120.52.153.192/26
120.52.22.96/27
120.52.39.128/27
130.176.0.0/17
130.176.128.0/18
130.176.192.0/19
130.176.224.0/20
143.204.0.0/16
144.220.0.0/16
180.163.57.0/25
180.163.57.128/26
204.246.164.0/22
204.246.168.0/22
204.246.172.0/24
204.246.173.0/24
204.246.174.0/23
204.246.176.0/20
205.251.200.0/21
205.251.208.0/20
205.251.249.0/24
205.251.250.0/23
205.251.252.0/23
205.251.254.0/24
216.137.32.0/19
223.71.11.0/27
223.71.71.128/25
223.71.71.96/27

CloudFront Regional Edge IPv4 列表 - 点击展开
3.10.17.128/25
3.101.158.0/23
3.11.53.0/24
3.128.93.0/24
3.134.215.0/24
3.231.2.0/25
3.234.232.224/27
3.236.169.192/26
3.236.48.0/23
3.35.130.128/25
13.113.196.64/26
13.113.203.0/24
13.124.199.0/24
13.210.67.128/26
13.228.69.0/24
13.233.177.192/26
13.48.32.0/24
13.54.63.128/26
13.59.250.0/26
15.188.184.0/24
15.207.13.128/25
15.207.213.128/25
18.192.142.0/23
18.200.212.0/23
18.216.170.128/25
18.229.220.192/26
34.195.252.0/24
34.216.51.0/25
34.223.12.224/27
34.223.80.192/26
34.226.14.0/24
35.158.136.0/24
35.162.63.192/26
35.167.191.128/26
44.227.178.0/24
44.234.108.128/25
44.234.90.252/30
52.15.127.128/26
52.199.127.192/26
52.212.248.0/26
52.220.191.0/26
52.47.139.0/24
52.52.191.128/26
52.56.127.0/25
52.57.254.0/24
52.66.194.128/26
52.78.247.128/26
54.233.255.128/26
99.79.169.0/24

CloudFront Global IPv6 列表 - 点击展开
2400:7fc0:500::/40
2404:c2c0:500::/40
2600:9000:1000::/36
2600:9000:2000::/36
2600:9000:3000::/36
2600:9000:4000::/36
2600:9000:5308::/45
2600:9000:5310::/44
2600:9000:5320::/43
2600:9000:5340::/42
2600:9000:5380::/41
2600:9000:ddd::/48
2600:9000:eee::/48
2600:9000:f000::/38
2600:9000:f400::/40
2600:9000:f500::/43
2600:9000:f520::/44
2600:9000:f534::/46
2600:9000:f538::/45
2600:9000:f540::/42
2600:9000:f580::/41
2600:9000:f600::/39
2600:9000:f800::/37
2600:9000:fff::/48

CloudFront 含有部分中国大陆节点,而这些 IP 因为用的人太多,似乎用不了了?因此我简单过滤了下:

CloudFront 非中国大陆的所有 IPv4+IPv6 列表 - 点击展开
3.10.17.128/25
3.11.53.0/24
3.35.130.128/25
3.101.158.0/23
3.128.93.0/24
3.134.215.0/24
3.160.0.0/14
3.231.2.0/25
3.234.232.224/27
3.236.48.0/23
3.236.169.192/26
13.32.0.0/15
13.35.0.0/16
13.48.32.0/24
13.54.63.128/26
13.59.250.0/26
13.113.196.64/26
13.113.203.0/24
13.124.199.0/24
13.210.67.128/26
13.224.0.0/14
13.228.69.0/24
13.233.177.192/26
13.249.0.0/16
15.158.0.0/16
15.188.184.0/24
15.207.13.128/25
15.207.213.128/25
18.64.0.0/14
18.68.0.0/16
18.154.0.0/15
18.160.0.0/15
18.164.0.0/15
18.172.0.0/15
18.192.142.0/23
18.200.212.0/23
18.216.170.128/25
18.229.220.192/26
18.238.0.0/15
18.244.0.0/15
34.195.252.0/24
34.216.51.0/25
34.223.12.224/27
34.223.80.192/26
34.226.14.0/24
35.158.136.0/24
35.162.63.192/26
35.167.191.128/26
44.227.178.0/24
44.234.90.252/30
44.234.108.128/25
52.15.127.128/26
52.46.0.0/18
52.47.139.0/24
52.52.191.128/26
52.56.127.0/25
52.57.254.0/24
52.66.194.128/26
52.78.247.128/26
52.84.0.0/15
52.124.128.0/17
52.199.127.192/26
52.212.248.0/26
52.220.191.0/26
52.222.128.0/17
54.182.0.0/16
54.192.0.0/16
54.230.0.0/17
54.230.128.0/18
54.230.200.0/21
54.230.208.0/20
54.230.224.0/19
54.233.255.128/26
54.239.128.0/18
54.239.192.0/19
54.240.128.0/18
64.252.64.0/18
64.252.128.0/18
65.8.0.0/16
65.9.0.0/17
65.9.128.0/18
70.132.0.0/18
71.152.0.0/17
99.79.169.0/24
99.84.0.0/16
99.86.0.0/16
108.138.0.0/15
108.156.0.0/14
130.176.0.0/17
130.176.128.0/18
130.176.192.0/19
130.176.224.0/20
143.204.0.0/16
144.220.0.0/16
204.246.164.0/22
204.246.168.0/21
204.246.176.0/20
205.251.200.0/21
205.251.208.0/20
205.251.249.0/24
205.251.250.0/23
205.251.252.0/23
205.251.254.0/24
216.137.32.0/19
2400:7fc0:500::/40
2404:c2c0:500::/40
2600:9000:ddd::/48
2600:9000:eee::/48
2600:9000:fff::/48
2600:9000:1000::/36
2600:9000:2000::/36
2600:9000:3000::/36
2600:9000:4000::/36
2600:9000:5308::/45
2600:9000:5310::/44
2600:9000:5320::/43
2600:9000:5340::/42
2600:9000:5380::/41
2600:9000:f000::/38
2600:9000:f400::/40
2600:9000:f500::/43
2600:9000:f520::/44
2600:9000:f534::/46
2600:9000:f538::/45
2600:9000:f540::/42
2600:9000:f580::/41
2600:9000:f600::/39
2600:9000:f800::/37

# 如何使用这些 IP 段?

在 CloudflareST 程序目录下,新建一个文本文件,并重命名为 1.txt(只是示例,名字随意),然后复制 IP 或 IP 段到该文件内并保存,最后指定 -f 1.txt -dd 参数去运行 CloudflareST 即可。

# Windows 系统
CloudflareST.exe -f 1.txt -dd

# Linux 系统
./CloudflareST -f 1.txt -dd

注意:因为 CloudflareST 默认下载测速地址只能用于 Cloudflare CDN,因此需要自行寻找可用的 AWS CloudFront CDN 下载测速地址,如果找不到,就请加上 -dd 禁用下载测速,否则会下载测速失败。

Windows 用户不知道怎么加参数运行的话,可以看看这个:


Gcore CDN IP 段:#267

@XIU2 XIU2 added the 工具教程 辅助工具 或 技巧教程 label Feb 19, 2022
@xifanu
Copy link

xifanu commented Mar 4, 2022

现在CDN到非AWS源站开始计费了,如果你的网站不在AWS的服务器上面,则意味着要收费。

@wkingnet
Copy link

wkingnet commented Apr 6, 2022

global、edge大概意思是两层CDN网络。比如你在美国的源站,亚马逊给你CDN到欧洲,那数据先到欧洲的global节点,然后分布到N个欧洲的edge边缘网络节点。

PS:1T流量可真爽呀

@xianlinlc
Copy link

试了一下,ping值最低的是国内宁夏和北京的节点,但是都不可用,只有国外的可用。

@xianlinlc
Copy link

应该是因为我没有中国的账号吧

@xianlinlc
Copy link

延迟看起来是真香 30几

@wkingnet
Copy link

应该是因为我没有中国的账号吧

因为中国节点是由亚马逊中国独立运营的,只能在亚马逊中国购买云计算,在亚马逊全球站点部署的云业务是不会到中国的节点的。另外亚马逊中国只接收商业客户,不对个人客户服务

@lflcan
Copy link

lflcan commented Jul 28, 2022

这里贡献一个使用了 Amazon Cloudfront 加速的网站

images.nasa.gov

这是 NASA 官方的图像与视频资料库,大部分资源提供下载直链

375M
20 Years of Hubble Science: Exoplanets
https://images-assets.nasa.gov/video/GSFC_20100722_Hubble_m10619_Exoplanets/GSFC_20100722_Hubble_m10619_Exoplanets~orig.mp4

463M
NASA/SpaceX Crew-2 Launch ISOs - 4K
https://images-assets.nasa.gov/video/KSC-20210423-MH-AJW01-0001-SpaceX_Crew_2_Isolated_Launch_Views_Broll_String_4K-3273128/KSC-20210423-MH-AJW01-0001-SpaceX_Crew_2_Isolated_Launch_Views_Broll_String_4K-3273128~orig.mp4

3.08G
First 8K Video from Space
https://images-assets.nasa.gov/video/First-8K-Video-from-Space/First-8K-Video-from-Space~orig.mp4

@wxyShine
Copy link

现在CDN到非AWS源站开始计费了,如果你的网站不在AWS的服务器上面,则意味着要收费。

确定吗?

@Infatuation-Fei
Copy link

Infatuation-Fei commented Dec 4, 2022

cloudfront有ipv6列表吗

@codiy1992
Copy link

@codiy1992
Copy link

MAPPING=$(curl -s https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips | \
    jq '.CLOUDFRONT_GLOBAL_IP_LIST | INDEX(.) | with_entries(.key |= (split("/") | .[0])  )')
RESULT=$(curl -s -X POST "http://ip-api.com/batch?lang=zh-CN&fields=61439" \
    --header "Content-Type: application/json" --data "$(echo ${MAPPING} | jq 'keys | .[:100]')")
CIRDS=$(
    echo "[$RESULT]" | jq --argjson all "${MAPPING}" \
    'flatten | map(select(.countryCode != "CN")) | map(.query) | .[] |$all[.]'
)
echo "${CIRDS//\"/}" > /tmp/cirds.txt

@XIU2
Copy link
Owner Author

XIU2 commented Jan 3, 2023

@Infatuation-Fei 1楼那个官方列表链接里只包含了 CloudFront CDN 的 IPv4 地址,官方还提供了另一个完整版的列表,里面包含了 AWS 的所有 IP 段,但其中只有一部分是 CloudFront CDN 的,你可以试试这里面末尾写那几个 service
为 CLOUDFRONT 的 IPv6 段:
https://ip-ranges.amazonaws.com/ip-ranges.json

我已经更新,把 IPv6 加到 1L 了。

Repository owner locked and limited conversation to collaborators Mar 1, 2023
@XIU2 XIU2 converted this issue into discussion #304 Mar 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
工具教程 辅助工具 或 技巧教程
Projects
None yet
Development

No branches or pull requests

8 participants