For some reason, my Ubuntu server "steals" a DHCP pool address even though it should have only a static address. Interestingly, one cannot even see from ifconfig that the spurious address exists. But the box is certainly reachable via that ip and it shows up and refreshes in the dhcp server, of course.

My guess was that a setting in cloud.cfg causes this, but even though I am new to netplan, I seem to have followed the sugested method to disable that ... ?!

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic


ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1438
        inet  netmask  broadcast
        inet6 fe80::250:56ff:fe95:df1f  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:95:df:1f  txqueuelen 1000  (Ethernet)
        RX packets 3853208  bytes 2793921154 (2.7 GB)
        RX errors 0  dropped 1170  overruns 0  frame 0
        TX packets 907823  bytes 750573388 (750.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 661271  bytes 106863136 (106.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 661271  bytes 106863136 (106.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cat /etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
 version: 2
 renderer: networkd
     dhcp4: no
     dhcp6: no
     addresses: []
       addresses: []

cat /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
            addresses: []
            dhcp4: true
            optional: true
    version: 2

cat /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

network: {config: disabled}
  • 1
    The cat of the cloud init yaml shows dhcp4 and an "optional" tag as true, have you tried editing that and adding the chosen static address between the brackets? Along with setting dhcp4 to false? – Lucy Brown Sep 10 '18 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.