Secondary IP configured on eth0 on fresh Ubuntu core install

I am using Dell 5000 edge gateway and installing ubuntu-core on it.

I have seen that on the start up the output of ip addr gives:

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether f4:8e:38:d1:eb:7c brd ff:ff:ff:ff:ff:ff
inet brd scope global dynamic eth0
   valid_lft 498360sec preferred_lft 498360sec
inet brd scope global secondary dynamic eth0
   valid_lft 498550sec preferred_lft 498550sec
inet6 fe80::f68e:38ff:fed1:eb7c/64 scope link
   valid_lft forever preferred_lft forever

Notice that there is global secondary dynamic eth0 is configured by default.

I tried getting configuration through console-conf that too says eth0 is configured as DHCP with giving the above two ip addresses. But, after saving changes from console-conf the secondary IP disappeared and after doing a reboot it re-appears.

/etc/netplan/00-snapd-config.yaml contains:

# This is the network config written by 'console_conf'
      addresses: []
      dhcp4: true
      nameservers: {}
  version: 2

Is it any installed snap that is trying to assign multiple IP’s to eth0 ? I have network-manager and modem-manager snaps installed.

if you want to use network-manager you can tell netplan to use it as default renderer in the config, see:

@ogra that’s right, but I want the default renderer as networkd only. I am using network manager for cellular interface configuration.

The problem here is I am unable to get why eth0 interface is being assigned secondary IP on reboot.

I believe the secondary IP is coming from the /etc/netplan/50-cloud-init.yaml which is installed by default. I used nano and changed dhcp4: true to dhcp4: false inside this file and did a reboot. This removed the secondary IP assigned by DHCP that I was seeing with the command: ip a .

this file does only exist if you use cloud-init as a hack in your image creation … the default netplan config in Ubuntu Core is /etc/netplan/00-snapd-config.yaml and gets automatically re-written after console-conf has configured the network …