我已经在一台数字海洋ubuntu机器上安装了Squid
。
我想要做的是:我将向这个代理服务器发送一个ipv4
地址,我需要选择并使用在squid.conf
中配置的iPv6
地址。我已经在conf文件中添加了2个ipv6
地址。
如果我通过将address指定为ipv6来尝试以下命令,它会工作得很好。
curl -H 'Cache-Control: no-cache' --proxy localhost:3128 [2400:xxx:x:xx::xxx:a001]
即,它将从配置文件中选择一个随机的ipv6
地址,并通过该ip地址发送请求。
如果我通过将address指定为ipv4来尝试以下命令,它将不起作用
curl -H 'Cache-Control: no-cache' --proxy localhost:3128 34.xxx.xxx.148
也就是说,它没有选择在配置文件中指定的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版本是
Squid Cache: Version 3.5.12
Service Name: squid
发布于 2017-12-18 12:17:10
Squid隐式使用IP版本,则应使用或强制IPv6。
Squid将为每行添加一个隐式IP版本测试。
发往IPv4网站的请求将使用传出的10.1.0.*地址。
发往IPv6网站的请求将使用传出的2001:db8:*地址。
http://www.squid-cache.org/Doc/config/tcp_outgoing_address/
https://stackoverflow.com/questions/47061218
复制相似问题