Sometimes we want to hide our network ip from the outside world. Sometimes we want to appear as if we are coming from a server in another country. Whatever the reason, we can use a 3rd party proxy or VPN service to do so.
In my case I chose IPVanish's VPN service. I use it for firewall testing, ip scanning, etc. I think this article will apply to any VPN service that uses openvpn.
First, you'll need to build an Ubuntu 22.04 setup with Squid.
Then install openvpn
Download the config files from IPVanish, unzip them and find the server you want to connect to.
secret sauce to get around the weak CA algorithm restriction
/usr/sbin/openvpn --config /root/ipvanish/ipvanish-US-Miami-mia-a01.ovpn --tls-cipher DEFAULT:@SECLEVEL=0
*note the --tls-cipher DEFAULT:@SECLEVEL=0 without this the openssl version on Ubuntu 22.04 will not allow this connection.
Since openvpn builds a tun0 interface, you'll need to nat behind it.
/usr/sbin/iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
Now you can route through it, or proxy to it. Whatever works better for you.