设置采用浮动 IP 的防封锁服务器
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
简介
在网络审查严格的环境下,Outline 服务器有时可能会被发现和封锁。如果服务器设置正确,即使被封锁也有可能恢复,并且操作难度也不大。我们将使用 DNS 和浮动 IP 来恢复被封锁的服务器。DNS 是一种互联网技术,可以将域名(例如 getoutline.org
)转换为实际 IP 地址(例如 216.239.36.21
);而浮动 IP 是一项云功能,支持向一个 Outline 服务器分配多个 IP 地址。
要求
只要具备一定基础技能,就能按照本指南完成操作。对 DNS 有基本了解会起到帮助作用,但并非必要条件。这篇 MDN 指南介绍了域名的概念,可供参考。
为了提供具体示例,我们将使用 DigitalOcean 和 Google Domains,但只要是支持分配 IP 地址的云提供商(例如 Google Cloud 或 AWS Lightsail)以及域名注册商(例如 AWS Route 53)均可使用。
操作说明
下表概述了轮换服务器 IP 地址的步骤:
购买域名。
将该域名指向我们服务器的 IP 地址。
使用该域名发放访问密钥。
为服务器的 Droplet 分配浮动 IP。
更改域名,使其指向新的 IP 地址。
在 DigitalOcean 上创建 Outline 服务器
如果您已有正在运行的 DigitalOcean 服务器,请直接跳到下一步。
打开 Outline 管理器,点击左下角的“+”进入服务器创建界面。
点击“DigitalOcean”按钮上的“创建服务器”,按照应用中的说明操作。

为服务器设置主机名
前往 Google Domains,点击“找到最佳选择”。
在搜索栏中输入域名,然后选择一个想要的名称。在示例中,我们使用了 outlinedemo.info
。
前往 Google Domains 中的“DNS”标签页。在“自定义资源记录”下的“IPV4 地址”字段中输入服务器的 IP 地址。
在 Outline 管理器中,前往服务器的“设置”标签页。在“主机名”下输入您购买的主机名,然后点击“保存”。这会使得日后所有的访问密钥使用此主机名,而不是使用服务器的 IP 地址。

更改服务器的 IP 地址
在 DigitalOcean 的“Droplets”页面上找到您的服务器。
在窗口的右上角,点击“Floating IP”(浮动 IP)旁边的“Enable Now”(立即启用)。

- 在 Droplet 列表中找到您的服务器,然后点击“Assign Floating IP”(分配浮动 IP)。

返回 Google Domains 中的“DNS”标签页。
像之前一样更改 IP 地址,但这一次改用新的浮动 IP 地址。此操作最多可能需要 48 小时才能生效,但通常只需要几分钟。
进入 Google 的在线 DNS 工具,输入您的域名即可查看在最后一步中完成的更改何时生效。

一旦此更改生效,客户端就会连接到新的 IP 地址。您可以使用新密钥连接到服务器,打开 https://ipinfo.io,确保页面显示了服务器的新 IP 地址。
总结
轮换 Outline 服务器的 IP 地址可以快速将服务器解除封锁,恢复对客户端的服务。如有其他疑问,欢迎随时在通知帖子下发表评论,访问 Outline 的支持页面,或者直接与我们联系。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-01-27。"],[[["Outline servers can be blocked in highly censored networks, but recovery is possible by rotating the server's IP address."],["The recovery process involves using DNS to translate a domain name to an IP address and using a Floating IP feature to assign multiple IP addresses to the server."],["Users need to purchase a domain name and point it to the server's IP address and can use services such as DigitalOcean and Google Domains, or similar providers."],["After setting up a hostname and assigning a Floating IP, users must update their domain's DNS records with the new Floating IP address."],["Once the DNS changes propagate, clients will connect to the server using the new IP address, restoring access to previously blocked servers."]]],["To recover a blocked Outline server, purchase a domain name and point it to the server's IP address. Then, issue access keys using the domain name. Next, assign a Floating IP to the server. Finally, update the domain name's DNS records to point to the new Floating IP address. This process switches the server's address without changing the access keys. Verify the update by using online tools to check if the domain is directing to the new IP.\n"]]