When I install squid forward proxy on a centos 7 vm and then tell a ubuntu vm to use the centos vm as a proxy squid blocks everything, this happens even if i create a new centos vm and install a fresh version of squid. If i change nothing in squid the problem still persists. I have created these vms in esxi 8
i have tried writing in the squid.conf file http_access allow all.
Can you post your config? Are you using Squid on CentOS 7 with
SELinuxenabled? Do the commandgetenforceto find out. If its output saysEnforcing, then SELinux is enabled and you should interact (start/stop/make changes) to Squid the same way the RedHat documentation specifies.With Squid, you should add a new acl in the config that references your Ubuntu servers ip.
Example:
acl ubuntu src 216.128.143.117/32Then, you should add a new http_access directive that allows your acl to access Squid.
Example:
http_access allow ubuntuI have a feeling you are using a local ip address, so you'll have ensure Squid is configured to allow traffic from local IPs. If you are adding an
http_access allow alldirective (not reccomended), then make sure it's above thehttp_access deny alldirective, if it exists.On Ubuntu, you can enable an http/s proxy by doing:
export http_proxy="http://{host}:{port}/"for an http proxy, andexport https_proxy="https://{host}:{port}/"for an https proxy.This will forward all http and https requests to the server specified.
Add those directives to a users
.bashrcfile to make it permanent for that user, or add them to/etc/environmentto make it permanent systemwide.In case you're still struggling, I tested it out myself and got it working within minutes.
I deployed 2 servers on Vultr in Dallas, Texas:
One running
CentOS 7 SELinux, and the otherUbuntu 22.04 LTS.On the CentOS server, I did the following:
sudo yum updatesudo yum install squidsudo firewall-cmd --add-port=3128/tcp --permanentsudo firewall-cmd --reloadnano /etc/squid/squid.confand added:acl ubuntu src 216.128.143.117/32andhttp_access allow ubuntuThen, I did
systemctl start squid.serviceMy
squid.conflooked like this:On the Ubuntu server, I did:
sudo apt-get updateexport http_proxy="http://216.128.131.111:3128/"export https_proxy="https://216.128.131.111:3128/"Then I did
curl ipinfo.io/ipand the response was216.128.131.111, my CentOS server ip.