0

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.

  • What OS is your client running? What's the output of ip route when you're connected? – Vanessa Deagan Mar 13 '18 at 18:04
1

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 600

where 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.1

You can add it again with

$ sudo ip route add default via 192.168.0.1
| improve this answer | |
  • An ip route does indeed state that my home router is the default gateway (192.168.1.254). Deleting the route disconnects the VPN, and I'm unable to connect again until I add it back. – DMK Mar 13 '18 at 17:35
  • Adding... push "redirect-gateway autolocal"... into the server config file has no effect either. – DMK Mar 13 '18 at 17:36
  • Sounds like it might not have connected properly to the VPN. Might be useful to include in your question the output of "ip route" while you're connected to the VPN. – Ratler Mar 13 '18 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.