Reset internet on Ubuntu server 20.04 LTS
Mia Lopez
I converted a VirtualBox image (Ubuntu server 20.04 LTS without GUI) to QEMU image (sudo qemu-img convert -f vdi...). It is start and work, but its ethernet network does not. I can not update it etc. It does not matter, but it was bridged card (in VM) and in QEMU is NAT (yet).
I found a temporary solution:
sudo dhclient -r
sudo dhclient
After it internet work well, till the next boot. How can I fix the ethernet settings in the OS? There is a tool what ran during install?
2 Answers
You have to modify netplan config file. Replace ens3 by the name of the interface .
You have to execute the command ifconfig and you will get the interface name . Then change the interface name.
root@server:~# vi /etc/netplan/01-netcfg.yaml
# enable dhcp4
network: version: 2 renderer: networkd ethernets: ens3: dhcp4: yesthen you can do a netplan try to check if there is no syntax error then do a netplan apply
My 01-network-manager-all.yaml had only 4 lines, referring to none of the hardware.
I did the following:
sudo nautilusGo to
/etc/NetworkManager/system-connectionsOptional - back up the contained connections to a subdirectory in your home directory
Make a note of file permissions, just in case
delete all files
sudo /etc/init.d/network-manager restart
This worked for me. There may be drawbacks, but, it beats having to re-install ubuntu from scratch.