core icon indicating copy to clipboard operation
core copied to clipboard

Squid: Allow configuration of IPv4 fallback

Open somova opened this issue 6 years ago • 0 comments

In my Opnsense configuration the squid proxy connects my IPv4 LAN with the outside IPv6 world in the internet. Both IPV4 and IPV6 internet access work fine, whereas squid automatically prefers IPv6 over IPv4 in case a server is reachable over both protocols.

But, if squid tries to access a server via IPv6 (indicated by related AAAA DNS record) an the server is faulty, it tries to fallback to IPv4 after 60 seconds (timeout) in its standard configuration. This timeout is too long, so that many browsers cancel the initial request.

I solved this issues by adding a manual configuration directive to the squid configuration file (/usr/local/etc/squid/squid.conf):

connect_timeout 7 seconds

But manually modifying configuration files is not a good idea, because they get overwritten when reconfiguring or restarting Opnsense.

Fallback test can be performed via https://ipv6-test.com/

Idea:

  • It would be a great idea to make the above configuration directive configurable via a form field (value in seconds) in the webgui (e.g. Services -> Web proxy -> Administration -> Forward proxy -> General Forward settings).

Opnsense version:

  • OPNsense 20.1.6-amd64
  • FreeBSD 11.2-RELEASE-p19-HBSD
  • LibreSSL 3.0.2

somova avatar May 07 '20 14:05 somova