0

I have a strange issue. If I suspend Ubuntu and then wake it up, it will successfully connect to a WiFi/wired network, but all requests will fail. My browser won't return anything, ping google.com or ping 8.8.8.8 get 100% packet loss. However, if I then restart Ubuntu, it starts working again.

This issue first started when I ran an install script for a VPN I was using (PrivateVPN), which seems to have ruined my network settings. Any idea what is happening here? How can I fix this problem? I've tried sudo systemctl restart networking, sudo systemctl restart NetworkManager, sudo resolvconf -u etc, and none of them fix the issue. I also don't think it's a DNS issue, because pinging 8.8.8.8 doesn't work.

Migwell
  • 161
  • 2
  • 11
  • Why not try disabling your connection to the network then reconnect to save rebooting? Just a thought. – Curiouskangaroo Mar 12 '19 at 09:01
  • Do you just mean disconnect from the WiFi and then reconnect? That doesn't work. Neither do all the other commands I've mentioned above – Migwell Mar 12 '19 at 13:01
  • Since we know that your "answer" isn't the fix, why don't you delete it, and we'll all start over again. Undo those fixes. Edit your question to include the output of ifconfig and resolvectl, BOTH with and without VPN running. BTW... VPN doesn't even work, does it? Report back to @heynnema – heynnema Mar 13 '19 at 13:12
  • And also show me ls -al /etc/resolv.conf and cat /etc/NetworkManager/NetworkManager.conf. – heynnema Mar 13 '19 at 13:19
  • I believe I've found an actual solution @heynnema – Migwell Mar 15 '19 at 05:08

1 Answers1

0

The actual issue, I realised, is that my VPN install script placed some configuration files into my /etc/openvpn directory. This install script is hosted here: https://privatevpn.com/client/install.sh

In addition, Ubuntu 18.04 seems to automatically have the openvpn service running, which means that any openvpn config files located in /etc/openvpn will be automatically activated. Thus, my networking didn't work because my computer was always trying to use the VPN, and often failing.

The way I worked this out is because my browser location always said I was in another country from where I really am, which led me to believe the VPN was still active.

To fix this, simply disable the openvpn service with sudo systemctl disable openvpn, or delete the config files: sudo rm /etc/openvpn/*.conf

The moral of this story is that you shouldn't use the poorly written install scripts provided by VPN hosts, when you can just load the .ovpn config files using NetworkManager (via network-manager-openvpn-gnome) or run them directly using the openvpn CLI.

Migwell
  • 161
  • 2
  • 11
  • Good job! We went down the same troubleshooting path, as I had asked "VPN doesn't even work, does it?". – heynnema Mar 15 '19 at 11:17