🔗 Squid 出站 IP 轮换
这一部分介绍 Squid 的一些奇怪(有时也很有用)的配置。有经验的管理员通常会发现,为了达到这些目的而费尽心思并没有什么实际的好处,但人们似乎偶尔会提出这样的需求……
🔗 目录
在此处写一些介绍。
🔗 真实负载均衡
当 Squid 面临多个出站链接并需要在它们之间进行负载均衡时,这可能会有一些用处。然而,值得注意的是,正确配置这些链接的路由表将带来更大的好处,并且也能将非 Squid 流量包含在负载均衡中。
🔗 示例:在两个 ISP 链接之间分割上传和下载
acl download method GET HEAD
acl upload method POST PUT
# IP used by link for downloads
tcp_outgoing_address 192.0.2.1 download
# IP used by link for uploads
tcp_outgoing_address 192.0.2.2 upload
🔗 奇怪的“隐私”
我猜想,一些请求者可能听说过一段时间前出现的 IPv6 “隐私地址” RFC,并希望通过 Squid 为 IPv4 也实现类似的功能。
注意事项
- “隐私”一词的真正含义与 IP 地址无关。IP 地址根据定义、目的和用法,是机器的公共标识符。存在真正的私有 IP。如果你想要隐私,请使用它们。
- 在受控网络中使用这种地址伪装并没有实际好处。请改用 DHCP。也许还可以用 NAT。
- RFC 地址操作仅在私有 ISP 连接上有效。例如拨号或 DSL 宽带链接。在这些连接上,通常会进行某种形式的帧级别身份验证以进行用户跟踪,而不是 IP 跟踪。
- 运行隐私地址的任何网络都需要关闭所有有用的防火墙控制。
🔗 示例:根据一天中的时间轮换三个 IP
acl morning time 06:00-11:59
acl afternoon time 12:00-18:00
acl night time 18:00-06:00
# IP used in the morning
tcp_outgoing_address 192.0.2.1 morning
# IP used in the afternoon
tcp_outgoing_address 192.0.2.2 afternoon
# IP used in the night
tcp_outgoing_address 192.0.2.3 night
⚠️ Disclaimer: Any example presented here is provided "as-is" with no support
or guarantee of suitability. If you have any further questions about
these examples please email the squid-users mailing list.
类别: ConfigExample
导航:站点搜索、站点页面、分类、🔼 向上