Hi there,
I'm a long term openvpn user to connect all my headless servers and very happy with it, thanks for that!
Now I'm up to a new project.
Basically what I'm trying to do is to route all traffic from my Squid proxy transparently to openvpn. So if someone connects to the proxy, the proxy forwards the traffic to the openvpn client on the same machine and the traffic is using the tunnel to the openvpn server. There the traffic is forwarded to the original destination.
I fear this is only partly openvpn related, but without any hints from here, I think I am lost.
So far I have setup my Linux box with Squid... working. I have setup the openvpn client... connecting to openvpn server and working. (openvpn server is from a third party, I can't do changes there, that's why I added --route-noexec)
The missing link is to connect Squid to the openvpn client on my box. I think it could be done by specifying tcp_outgoing_address 127.0.0.5 in the Squid conf, then outgoing traffic will have this IP address. Then maybe using Policy based routing to connect this IP address on eth0 to tun0. Or must the route setting be done in the openvpn client.conf? Lost :-)
Any hints and help appreciated.
tun0.conf
client
dev tun
proto udp
remote <domain.tld> 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ns-cert-type server
cipher bf-cbc
comp-lzo
verb 5
mute 20
ca ca.crt
mssfix 1300
key 1234.key
cert 1234.crt
route-noexec