Ubuntu Server 18.04.5 Internet not showing up on network
Recently installed Ubuntu Server 18.04.5 on a PC made somewhere around 2010s, however when I try to install net-tools (or any package for that matter) it says Temporary failure resolving ... In my router config page it calls my server ubuntu-server, even though that is not the name of my PC (its NEWCMC). As far as I can tell I cannot connect to the internet or any other PC, I can't ping my router. Extra Info:
ip a:
1: lo <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisk noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 1c:6f:65:76:d4:5f brd ff:ff:ff:ff:ff:ffAlso if anyone knows how I can copy text (such as above) from my PC to my laptop without SSH (caus' I have no connection) could you please let me know so I don't have to type things out manually... Thanks in Advance!
62 Answers
Networking is handled by netplan by default in Ubuntu Server 17.10 and later. I suggest that you remove the existing but not working configuration:
sudo rm /etc/netplan/*.yamlNext, create a new file:
sudo nano /etc/netplan/01-netcfg.yaml Add the following:
network: version: 2 renderer: networkd ethernets: enp2s0: addresses: - 192.168.0.150/24 gateway4: 192.168.0.1 nameservers: addresses: [8.8.8.8, 192.168.0.1]Of course, substitute your exact details here.
Netplan is very specific about spacing and indentation so proofread carefully twice. Save(Ctrl+o) and exit the text editor (Ctrl+x).
Follow with:
sudo netplan generate
sudo netplan applyYou will probably connect immediately. Check:
ip addr show
ping -c3 If you have the requested IP address and you get ping returns, then you are all set and you probably don’t require the net-tools package.
Like most of my problems I was looking around on askubuntu.com and I stumbled upon something that gave me a few things which I did (Some were here ) and now it works??? (only time will tell), my server shows up on router page, my static IP works, etc. I think it was just a temporary issue because today it works (I only thought it didn't because I put sudo apt-get install ifconfig instead of net-tools) So, to anyone who also has these issues, just wait it out is my advice. (Please let me know if I'm just being naive now.) Thanks to all who helped!! Edit: Just remembered what I did: I had previously followed a answer which said to edit some things in NetPlan, turns out I just had to change en01 to enp2s0. That fixed everything!