Proxy Squid (transparent mode) is not working under my Proxmox

edo300320

New Member
Jul 10, 2020
1
0
1
29
I encounter a problem with server squid proxy (transparent mode), impossible that the client machines of my lan, go through it.

The squid server works perfectly without the transparent mode, by the browser, so I think the problem comes from my iptables rules.

My Proxmox hypervisor is directly connected to a 4g box by cable

4g box: 192.168.10.1 (gateway)
Proxmox: enp2s0 the network card and vmbr0 bridge in 192.168.10.110


For my Proxmox hypervisor, it contains several machines:

Samba server: ens18 192.168.10.10/24, vmbr0 bridge, gateway 192.168.10.1, dns 127.0.0.1

DHCP server: ens18 192.168.10.11/24, vmbr0 bridge, gateway 192.168.10.1, dns 192.168.10.10

Squid server: ens18 192.168.10.12/24, vmbr0 bridge, gateway 192.168.10.1, dns 192.168.10.10

Windows 10 client machine: DHCP 192.168.10.20/24, vmbr0 bridge ...

On my Squid and DHCP server - cat / proc / sys / net / ipv4 / ip_forward = 1

For the Squid Proxy:

http_port 3128 transparent

acl localnet src 192.168.10.0/24

http_access allow localnet

http_access deny all


I tried 3 iptables rules:

The three rules have been executed from my Proxmox:
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o enp2s0 -j MASQUERADE

iptables -t nat -A PREROUTING -i enp2s0 -p tcp --dport 80 -j REDIRECT --to-port 3128

iptables -t nat -A PREROUTING -i enp2s0 -p tcp --dport 443 -j REDIRECT --to-port 3128


Can you tell me what's wrong and if you need more information, I'm available.
Namely on the Firewall is activated on the Proxmox and all client machines.

And also sorry in advance for my English ...

Thank you !
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!