【问题标题】:Squid proxy: how to use ipv6 address to send requestsSquid代理:如何使用ipv6地址发送请求
【发布时间】:2018-04-14 03:30:20
【问题描述】:

我已经在一台数字海洋 ubuntu 机器上安装了Squid

我要做的是:我将发送一个ipv4 地址到这个代理服务器,我需要获取并使用squid.conf 中配置的iPv6 地址。 我在 conf 文件中添加了 2 个ipv6 地址。

如果我通过将地址指定为 ipv6 来尝试以下命令,它可以正常工作。

curl -H 'Cache-Control: no-cache' --proxy localhost:3128 [2400:xxx:x:xx::xxx:a001]

即,它将从 conf 文件中随机选择一个ipv6 地址并通过该 IP 地址发送请求。

如果我通过将地址指定为 ipv4 来尝试以下命令,则它不起作用

curl -H 'Cache-Control: no-cache' --proxy localhost:3128 34.xxx.xxx.148

ie,它没有选择 conf 文件中指定的 ipv6 地址。而是使用服务器公共 ip。

我的/etc/squid/squid.conf 文件内容现在是这样的。

acl one_fourth_3 random 1/2
acl one_fourth_4 random 1/1
tcp_outgoing_address 2604:xxxx:xxx:xxx::xx:a001 one_fourth_3
tcp_outgoing_address 2604:xxxx:xxx:xxx::xx:a002 one_fourth_4

http_access deny !safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localhost
http_access allow all
http_access deny all
http_port 3128

我的鱿鱼版是

Squid Cache: Version 3.5.12
Service Name: squid

【问题讨论】:

    标签: proxy ipv6 squid


    【解决方案1】:

    Squid 隐式使用 IP 版本,你应该使用或强制使用 IPv6。

    Squid 将为每一行添加一个隐式 IP 版本测试。

    前往 IPv4 网站的请求将使用传出的 10.1.0.* 地址。

    前往 IPv6 网站的请求将使用传出的 2001:db8:* 地址。

    http://www.squid-cache.org/Doc/config/tcp_outgoing_address/

    【讨论】:

      猜你喜欢
      • 2017-03-17
      • 1970-01-01
      • 1970-01-01
      • 2022-01-12
      • 2017-06-30
      • 1970-01-01
      • 2021-05-20
      • 1970-01-01
      • 2014-08-24
      相关资源
      最近更新 更多