Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os-squid: web proxy does not listen on all configured interfaces on startup #4191

Open
3 tasks done
meyergru opened this issue Aug 21, 2024 · 6 comments
Open
3 tasks done
Labels
support Community support

Comments

@meyergru
Copy link
Contributor

meyergru commented Aug 21, 2024

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

When using squid on several VLAN interfaces in order to regulate internet access, sometimes, it seems that it does not listen to all configured interfaces. Òn some, there is an ECONNREFUSED, meaning that the port 3128 seems to be closed.

To Reproduce

Reboot OpnSense and try to access Squid from all potential interfaces by using the interfaces IP address on port 3128, e.g. with nmap -p3128 192.168.7.1, of which I have multiple defined in squid.conf:

# Setup regular listeners configuration
http_port 192.168.5.1:3128
http_port 192.168.4.1:3128
http_port 192.168.3.1:3128
http_port 192.168.7.1:3128
http_port 192.168.8.1:3128
http_port 192.168.6.1:3128

From some interfaces, the port is closed.

After a restart, the ports open up. "Restart" meaning exactly: Disable and re-enable squid, restart via the recycle button does not work.

Expected behavior
Squid should listen on all interfaces from the get-go.

Additional context
I think this may be of different behaviour for interface startup. Either Squid should be allowed to use "all" interfaces - like the web GUI of OpnSense itself (we know that there are problems if the bind address is not 0.0.0.0).

Alternatively, the interface startup should restart Squid or its startup should be delayed until all interfaces are up.

Environment

OPNsense 24.7.2 (amd64), probably since 24.7 already.

@fichtner
Copy link
Member

Squid is started very late and coupled with the fact that it only accepts static addresses (unless we talk about VIPs here) I can't see a good reason why this would fail during initial setup. I would think the daemon does something strange, which would also point to the fact that the reload doesn't recover in this case (although this could be an implementational detail I don't know about).

Listening to 0.0.0.0 is probably not going to happen as it will likely introduce other side effects.

@fichtner fichtner added the support Community support label Aug 22, 2024
@meyergru
Copy link
Contributor Author

Most interesting was that I saw that the binding was done with "sockstat", however only one IP reacted to connection requests.

@fichtner
Copy link
Member

fichtner commented Aug 22, 2024

The only other thing I can think of is some kernel-down/up related link activity that wedges the interface at least from squid's perspective and that's why it can't recover on reload as well because it thinks it's fine?

@meyergru
Copy link
Contributor Author

Sure looks like it. But what activity is that? If Squid is started late and the interfaces are configured statically, what happens thereafter?

@fichtner
Copy link
Member

Check dmesg for link events. I don't think I want to look any closer at what the problem could be.

@meyergru
Copy link
Contributor Author

The only link events I can see is with initial setup of the VLAN interfaces. None after that. But I think that Squid gets started after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Community support
Development

No branches or pull requests

2 participants