Ubuntu 20.04 – Check if DHCP Client is Running

dhcpUbuntu

I have a system that runs Ubuntu 20.04. However, it doesn't seem to be set as a DHCP client.

song@docker:~$ ps -ef | grep dhcp
song        7861    3124  0 08:50 pts/0    00:00:00 grep --color=auto dhcp
song@docker:~$ 

However, this machine got an IP address when it boots up. Because every time it restarts, it gets a different IP.

song@docker:~$ cat /etc/netplan/00-installer-config.yaml 
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens160:
      dhcp4: true
  version: 2
song@docker:~$ ifconfig ens160
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.95  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::250:56ff:fe95:d581  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:95:d5:81  txqueuelen 1000  (Ethernet)
        RX packets 263821  bytes 73294629 (73.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 229178  bytes 79367259 (79.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Thank you in advance.

Best Answer

Not every DHCP client runs a command name containing "dhcp". Ubuntu is probably using systemd-networkd which has its own DHCP implementation.