Fresh Install of Ubuntu Server 19.04 Has No Internet?
To obtain IP address from DHCP server manually you can run
sudo dhclient enp0s25
To make this solution permanent you should use the corresponding configuration file inside 19.04 for Netplan (see server guide, p. 43) - /etc/netplan/01-netcfg.yaml
with the following contents:
network:
version: 2
renderer: networkd
ethernets:
enp0s25:
dhcp4: yes
then apply the configuration with sudo netplan apply
.
The file contents of /etc/netplan/01-netcfg.yaml
above is modified variant of /usr/share/doc/netplan/examples/dhcp.yaml
configuration file.
More examples of Netplan configuration are shown in /usr/share/doc/netplan/examples/
.
Related videos on Youtube
Sarah Szabo
Updated on September 18, 2022Comments
-
Sarah Szabo over 1 year
I just finished installing the new Ubuntu 19.04 Server on my downstairs server, but it doesn't appear to have an internet connection despite being wired to the router using a cat-6 cable.
All pings fail, including
ping 8.8.8.8
with the same error message. I've tried usingifconfig
to set the state toup
, but this didn't help.ip a
reveals that the server doesn't seem to have an IP address.-
N0rbert about 5 yearsDid you tried to use
sudo dhclient enp0s25
? Just curious why do you use 9 month-supported Ubuntu on server instead of LTS with 5 years of support? -
jwcooper about 5 yearsIt could be a DHCP issue, but I would honestly start bare bones here and check the back of the server for a link light. It should be gree, not amber. Let us know what you find.
-
Sarah Szabo about 5 years@N0rbert This is just for my backup server. I didn't really care although I probably should have used the LTS release. I'm not doing anything serious. It just has to stay functional for a month while I'm gone for backups. I guess I'll replace it with 18.04LTS since that has been debugged better.
-
Sarah Szabo about 5 years@N0rbert Your solution fixed the issue. It now has an IP address. I don't know why it didn't set up that way though. I'm not really knowledgeable about networking yet. If you post your solution as an answer, I'll upvote and accept it :]
-
-
i9pp0 over 4 yearsThe first part of your answer got my internet working. Thanks, but in 19.10 it seems that /etc/netplan/01-netcfg.yaml becomes /etc/netplan/50-cloud-init.yaml. However, the configuration you have provided doesn't work. I keep getting an "inconsistent indentation" error no matter how I move the indentations around. Do I need to add more info maybe?
-
N0rbert over 4 years@i9pp0 I'm not sure about CloudInit, see cloudinit.readthedocs.io/en/latest/topics/network-config.html