Ubuntu – Fresh Install of Ubuntu Server 19.04 Has No Internet

19.04internetnetworkingserver

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

Best Answer

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 Question