1
Web Proxy Filtering and Caching / Re: Squid leaking my IP and not routing via OpenVPN
« on: November 12, 2020, 10:54:25 am »
What a wonderful timing. I started working on the same problem yesterday. So far, my solution was what Amr has suggested: essentially, I have an LXD container connected to a VLAN with all traffic going through OpenVPN and with the proxy set up inside that container. Obviously, this solution works, but I also started to think about switching to simply using OPNsense with squid since it is already part of the system and to retire the container.
I figured I'd simply bind squid to the VPN subnet experienced the same issue as you minitux: the proxy ignores the VPN. I did look into squid.conf (I'm new to squid) and couldn't find anything of help. Then, I found https://forum.opnsense.org/index.php?topic=6516.0 and played with pre-auth and post-auth configs as per Amr's info about a "tcp_outgoing_address" directive. This is where I am blocked at the moment...
Let's say my VPN subnet is 192.168.x.0/24. I decided to create a file custom.conf and placed it once in pre-auth and once in the post-auth folder to test (for reference: login via shell, navigate to /usr/local/etc/squid/ where you find the folders in question). Inside my conf I specified an acl for the clients subnet (192.168.y.0/24) as well as the tcp outgoing address (gateway of VPN subnet) for these users:
And this is where the fun stops: with the browser configured to use the proxy, the connection times out and squid's access logs show (EDIT: NONE/503) errors.
EDIT: after some additional research I decided to give up on the OPNsense/squid combo to solve this problem. My current working solution took 3-5 minutes compared to a couple of hours of research without a working solution. Would've been cool, but not worth the hassle.
Good luck to you. And if you happen to find an answer...I'm still interested ;-)
I figured I'd simply bind squid to the VPN subnet experienced the same issue as you minitux: the proxy ignores the VPN. I did look into squid.conf (I'm new to squid) and couldn't find anything of help. Then, I found https://forum.opnsense.org/index.php?topic=6516.0 and played with pre-auth and post-auth configs as per Amr's info about a "tcp_outgoing_address" directive. This is where I am blocked at the moment...
Let's say my VPN subnet is 192.168.x.0/24. I decided to create a file custom.conf and placed it once in pre-auth and once in the post-auth folder to test (for reference: login via shell, navigate to /usr/local/etc/squid/ where you find the folders in question). Inside my conf I specified an acl for the clients subnet (192.168.y.0/24) as well as the tcp outgoing address (gateway of VPN subnet) for these users:
Code: [Select]
acl VPNUsers src 192.168.y.0/24
tcp_outgoing_address 192.168.x.1 VPNUsers
And this is where the fun stops: with the browser configured to use the proxy, the connection times out and squid's access logs show (EDIT: NONE/503) errors.
EDIT: after some additional research I decided to give up on the OPNsense/squid combo to solve this problem. My current working solution took 3-5 minutes compared to a couple of hours of research without a working solution. Would've been cool, but not worth the hassle.
Good luck to you. And if you happen to find an answer...I'm still interested ;-)