DHCP Client Setup on Ubuntu
On
Ubuntu 16.04
, you can configure all interface in the config file
/etc/network/interfaces
.
$ sudo vi /etc/network/interfaces
Add these lines in it:
auto eth0
iface eth0 inet dhcp
Save the file and restart network services (or reboot the system).
$ sudo systemctl restart networking
On
Ubuntu 18.04
, networking is controlled by the
Netplan
program. You
need to edit the appropriate file under the directory
/etc/netplan/
, for
example.
$ sudo vim /etc/netplan/01-netcfg.yaml
Then enable
dhcp4
under a specific interface for example under