Fresh Install of Ubuntu Server 19.04 Has No Internet?

8,853

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/.

Share:
8,853

Related videos on Youtube

Sarah Szabo
Author by

Sarah Szabo

Updated on September 18, 2022

Comments

  • Sarah Szabo
    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 using ifconfig to set the state to up, but this didn't help.

    ip a reveals that the server doesn't seem to have an IP address.

    Pictures below: Ubuntu Server

    • N0rbert
      N0rbert about 5 years
      Did 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
      jwcooper about 5 years
      It 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
      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
      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
    i9pp0 over 4 years
    The 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
    N0rbert over 4 years