【发布时间】: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
【问题讨论】: