After reinstalling NetworkManager internet connection is not working. Only dhclient usb0 works. VPN connection says it’s connected but it’s not

I had a problem with dropping internet and vpn connection on ubuntu 20.04. Because of that i decided to reinstall network manager according to this anwser.

I executed following commands

sudo apt-get purge network-manager
sudo apt-get update
sudo apt-get autoremove
sudo apt-get upgrade
sudo apt-get install network-manager
sudo apt install ubuntu-desktop

then rebooted the system and after that i can’t connect to the internet. My modem is Android device with tethering enabled (internet connection has been working properly before executing commands that i listed above). Connection is visible on the ubuntu GUI (top right corner) and is named “USB Ethernet Connected”. Despite of that internet is not working.

I found that i can execute dhclient usb0 and after that internet is working properly but i have to do it every time i boot up the system. Also i can’t connect to VPN network (there is no error, GUI says it’s connected but servers available only in VPN network are not accessible).

There is my ifconfig

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:25:93:e5:82  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker_gwbridge: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.19.0.1  netmask 255.255.0.0  broadcast 172.19.255.255
        inet6 fe80::42:c3ff:fe60:668a  prefixlen 64  scopeid 0x20<link>
        ether 02:42:c3:60:66:8a  txqueuelen 0  (Ethernet)
        RX packets 495  bytes 47231 (47.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 520  bytes 80963 (80.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 4c:ed:fb:95:c7:9f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 5192  bytes 487445 (487.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5192  bytes 487445 (487.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.42.109  netmask 255.255.255.0  broadcast 192.168.42.255
        inet6 fe80::e097:241:56b:9a3a  prefixlen 64  scopeid 0x20<link>
        ether 92:28:29:5f:bf:6c  txqueuelen 1000  (Ethernet)
        RX packets 5  bytes 1058 (1.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 249  bytes 32661 (32.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth05b6c07: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::782e:6ff:fe4a:bdb9  prefixlen 64  scopeid 0x20<link>
        ether 7a:2e:06:4a:bd:b9  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48  bytes 6509 (6.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth0ba13b0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::1cc9:c1ff:fef2:b783  prefixlen 64  scopeid 0x20<link>
        ether 1e:c9:c1:f2:b7:83  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47  bytes 6425 (6.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth0c2d06c: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::286c:9dff:fe62:d6b8  prefixlen 64  scopeid 0x20<link>
        ether 2a:6c:9d:62:d6:b8  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth0e104e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::ac61:95ff:feb6:f31b  prefixlen 64  scopeid 0x20<link>
        ether ae:61:95:b6:f3:1b  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth1b2a54a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::8c1c:f4ff:fec1:3097  prefixlen 64  scopeid 0x20<link>
        ether 8e:1c:f4:c1:30:97  txqueuelen 0  (Ethernet)
        RX packets 495  bytes 54161 (54.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 519  bytes 80611 (80.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth1e723d5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::c463:b3ff:fe4e:992c  prefixlen 64  scopeid 0x20<link>
        ether c6:63:b3:4e:99:2c  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth20ad462: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::7cf1:a6ff:fe67:bd5  prefixlen 64  scopeid 0x20<link>
        ether 7e:f1:a6:67:0b:d5  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth2b1261a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::2091:6eff:fe36:6915  prefixlen 64  scopeid 0x20<link>
        ether 22:91:6e:36:69:15  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth3575eea: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::94f8:e5ff:fed1:3f13  prefixlen 64  scopeid 0x20<link>
        ether 96:f8:e5:d1:3f:13  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth48f5a22: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::d8e6:fcff:fe3f:c003  prefixlen 64  scopeid 0x20<link>
        ether da:e6:fc:3f:c0:03  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth4f510a3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::a870:e1ff:feb9:9cca  prefixlen 64  scopeid 0x20<link>
        ether aa:70:e1:b9:9c:ca  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 77  bytes 10671 (10.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth6ca5384: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::80ce:94ff:fe2f:8c8e  prefixlen 64  scopeid 0x20<link>
        ether 82:ce:94:2f:8c:8e  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth7249d81: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5c70:7fff:fe9d:54a4  prefixlen 64  scopeid 0x20<link>
        ether 5e:70:7f:9d:54:a4  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth875ed12: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::1047:dfff:fef6:d885  prefixlen 64  scopeid 0x20<link>
        ether 12:47:df:f6:d8:85  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth88216b5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::98bf:c5ff:fe8f:ef44  prefixlen 64  scopeid 0x20<link>
        ether 9a:bf:c5:8f:ef:44  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6098 (6.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vetha5da662: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::9c6d:36ff:fefa:4fdc  prefixlen 64  scopeid 0x20<link>
        ether 9e:6d:36:fa:4f:dc  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethb219fc4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::a427:5ff:fe2a:de36  prefixlen 64  scopeid 0x20<link>
        ether a6:27:05:2a:de:36  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethb58896f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::80e9:50ff:fe61:aee7  prefixlen 64  scopeid 0x20<link>
        ether 82:e9:50:61:ae:e7  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48  bytes 6509 (6.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethdceb1ac: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::387d:c8ff:fea5:4926  prefixlen 64  scopeid 0x20<link>
        ether 3a:7d:c8:a5:49:26  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 6115 (6.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

There is my /etc/network/interfaces file (originally after reinstallation of network manager it was empty but i added it in the mean time)

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
# auto lo
# iface lo inet loopback

# The primary network interface
# auto usb0
# iface usb0 inet dhcp

There is my netplan configuration (only /etc/netplan/01-network-amanger-all.yaml is there)

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

and /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

[device]
wifi.scan-rand-mac-address=no

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

I would like to have working internet after booting up the computer and working VPN connection. I would be glad for any explanations why it stopped working, what can i do and where i can read more about network configuration in Ubuntu.

EDIT #1

It seems that executing below commands fixed internet connection on system boot but VPN is still not working.

apt install resolvconf
systemctl enable systemd-resolved.service
service systemd-resolved start

EDIT #2

After executing sudo apt-get install --reinstall ubuntu-desktop and rebooting the machine VPN configuration can be edited and I can connect to VPN but i can’t access any server by it’s DNS name.

EDIT #3

Issue has been resolved following this tutorial