[squid-users] Prefer or force ipv6 usage on dual stack interface
Alex Rousskov
rousskov at measurement-factory.com
Wed Jul 17 14:26:23 UTC 2024
On 2024-07-17 02:22, Rasmus Horndrup wrote:
> why it went with the ipv4 conn over ipv6 in the second case.
Squid went with IPv4 because Squid established the corresponding
TCP/IPv4 connection before it could establish the corresponding TCP/IPv6
connection. Squid started with an IPv4 connection establishment attempt
because DNS A query (QID 0xd80b) was answered before DNS AAAA query (QID
0xacdf) was.
The logs are not detailed enough for me to be sure, but I suspect that
Squid did not even try to establish an TCP/IPv6 connection in this
particular case (see happy_eyeballs_connect_timeout).
> As I understood, it should prefer ipv6?
Squid does not prefer IPv6. Whether it _should_ is a complicated
question I would rather not answer until it becomes really necessary.
N.B. Squid still sends DNS A (IPv4) queries just before sending DNS AAAA
(IPv6) queries. The two queries are sent one after another, without any
wait or artificial delays between them, but this hard-coded query
sending order does give IPv4 an advantage over IPv6 (with all other
factors being equal).
HTH,
Alex.
>> On 16 Jul 2024, at 20.46, Alex Rousskov <rousskov at measurement-factory.com> wrote:
>>
>> On 2024-07-16 09:31, Rasmus Horndrup wrote:
>>> how can I basically force squid to use IPv6?
>>
>> One can modify Squid source code to enforce that rule OR
>>
>> * ban requests targeting raw IPv4 addresses _and_
>> * ensure your /etc/hosts is not in the way _and_
>> * use a DNS resolver that never sends IPv4 addresses to Squid.
>>
>>
>> HTH,
>>
>> Alex.
More information about the squid-users
mailing list