how to get OpenVPN to route traffic correctly on Ubuntu 20.04 - DNS issues and IP leaks
I'm trying to debug I'm currently trying to set up OpenVPN on an Ubuntu 20.04 server, but I'm having trouble with routing and DNS resolution after the connection is established... The VPN connects successfully, but when I check my IP using `curl ifconfig.me`, it still shows my original IP instead of the VPN's IP. Additionally, DNS queries seem to be leaking, as requests to `dnsleaktest.com` reveal my actual ISP's DNS servers instead of the VPN's. I've tried modifying the `server.conf` file by adding the following lines: ```bash push "redirect-gateway def1" push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" ``` After restarting the OpenVPN service with `sudo systemctl restart openvpn@server`, I ran `sudo iptables -L -v` and saw that the necessary NAT rules were applied correctly. I also verified that `net.ipv4.ip_forward` is set to `1` in `/etc/sysctl.conf`, and I executed `sudo sysctl -p` to ensure the settings were active. However, even after all these changes, the traffic still isn't routing through the VPN. I also checked the logs at `/var/log/syslog` and found some entries indicating potential issues: ```plaintext [OpenVPN] WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this [OpenVPN] behavior: Could not determine IPv4/IPv6 protocol ``` I've tried adding `auth-nocache` to the configuration, but that hasn't helped with the IP leakage. I'm starting to wonder if the scenario might be related to my network manager settings or the way the server is configured. Can anyone offer insights on what I might be missing or suggest any specific configurations that could help resolve these issues? My team is using Bash for this web app. Cheers for any assistance! I'm on CentOS using the latest version of Bash.