I have configured an OpenVPN server in the cloud (Digital Ocean), using this guide.
I have downloaded the client 'ovpn' file, (client is also Ubuntu), and have established a connection ok. However, when I check my public IP from my client, the IP is still showing my dynamic IP assigned by my ISP. Is there a way for my external IP to be the public IP of my VPN server?
As the IP's from my ISP are always blocked by Spamhaus (I'm setting up a home Exchange server lab), I would like a dedicated, static IP provided via my OpenVPN server.
12 Answers
I don't know how your specific provider is set up to work, but the VPN connection is normally set up to route all traffic through the VPN.
Check if your ISP modem is the default gateway.
$ ip route
default via 192.168.0.1 dev wlo1 proto static metric 600where 192.168.0.1 is my modem IP in this case. The VPN connection (tun0) should also be in this table if you've connected successfully.
Delete the default gateway, and if that fixes the IP issue (or if you can't connect at all), it means your traffic was being routed through your ISP.
$ sudo ip route del default via 192.168.0.1You can add it again with
$ sudo ip route add default via 192.168.0.1 3 I know this question is a little old, but it might help someone
I had the same problem with my VPN client.
Just add the option flag --redirect-gateway , this will unsure all outgoing traffic goes over the VPN tunnel
openvpn --config file.ovpn --redirect-gateway