Squid Proxy inside VPN

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
MaxLu
OpenVpn Newbie
Posts: 1
Joined: Fri Jul 12, 2019 4:23 am

Squid Proxy inside VPN

Post by MaxLu » Fri Jul 12, 2019 4:26 am

Hi all!
I have a squid server on a VPN client and a VPN server with WAN IP
I use a port forwarder (rinetd) on VPN server to redirect user request to Squid Server
I want squid logs user public IP instead VPN server IP

This is an example:
User (Wan IP: 199.9.9.9) connects to VPN server by public IP (Wan IP: 188.8.8.8 - VPN IP: 10.8.0.1) on port 3128
User's request is forwarded to Squid server on VPN client (VPN IP: 10.8.0.10) on same port 3128
Squid works but logs 10.8.0.1 instead of 199.9.9.9 on access.log

Does anyone have a solution to propose to me?
Thank you in advance

zohaib09
OpenVpn Newbie
Posts: 1
Joined: Wed Jun 15, 2022 6:43 pm

Re: Squid Proxy inside VPN

Post by zohaib09 » Wed Jun 15, 2022 6:49 pm

I have installed openvpn and squid on same server. I want vpn client browsing should go through squid without setting up client browser serting

There must be need to define iptable rule? Please advice rule how to accomplish this

Geo.Rios
OpenVpn Newbie
Posts: 1
Joined: Tue Apr 25, 2023 10:04 pm

Re: Squid Proxy inside VPN

Post by Geo.Rios » Wed Apr 26, 2023 2:23 am

Hey zohaib09 Lograste configurarlo?

Magvegva
OpenVpn Newbie
Posts: 3
Joined: Wed Apr 26, 2023 5:14 pm

Re: Squid Proxy inside VPN

Post by Magvegva » Wed Apr 26, 2023 6:06 pm

Geo.Rios wrote:
Wed Apr 26, 2023 2:23 am
Hey zohaib09 Lograste configurarlo?
Hello!
Try to use iptables to redirect specific tcp port (80,443) to squid proxy server. Something like this
iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner root --dport 443 -j REDIRECT --to-port 8080

Post Reply