Ubuntu – remove secondary IP on interface ubuntu 19.04 permanently

linux-networkingUbuntu

I have a strange problem: I have 2 IP Adresses configured and I can't remove it, neither I know where it is configured.

> ip a s enp6s0
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 18:31:bf:6a:cd:89 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.3/24 brd 192.168.178.255 scope global enp6s0
       valid_lft forever preferred_lft forever
    inet 192.168.178.114/24 brd 192.168.178.255 scope global secondary noprefixroute enp6s0
       valid_lft forever preferred_lft forever

I do have configured a static IP in /etc/network/interfaces, but no secondary IP at all:

## The primary network interface
auto enp6s0
iface enp6s0 inet static
  address 192.168.178.3/24
  gateway 192.168.178.1
  dns-nameserver 192.168.178.1

the /var/log/syslog shows, that somehow a DHCP address is assigned to the Interface:

Jul 14 12:33:03 hogwarts dhcpcd[1897]: enp6s0: leased 192.168.178.114 for 864000 seconds
Jul 14 12:33:03 hogwarts dhcpcd[1897]: enp6s0: adding route to 192.168.178.0/24
Jul 14 12:33:03 hogwarts dhcpcd[1897]: enp6s0: adding default route via 192.168.178.1 

deleting it manually is unsuccessful

ip a d 192.168.136.114/32 dev enp6s0
RTNETLINK answers: Cannot assign requested address

I can't find any systemd/initd skript being responsible for this IP being added.

What I already checked:

  • I already configured systemd to "debug" to be more verbose, but no
    luck.
  • No netplan config exits
  • disabled NetworkManager in systemctl

Any ideas are appreciated!

System: Ubuntu 19.04 Server, upgraded from 18.04 LTS -> 18.10 -> 19.04

Best Answer

-> Antons point 2.) lead me to the solution:

somehow dhcpcd was running (hope neither docker nor virtualbox needs it) and everytime I deleted the IP with Antons point 1), it was obviously created once again.

so my solution is

systemctl disable dhcpcd.service
systemctl stop dhcpcd.service
ip a d 192.168.178.114/24 dev enp6s0

Thx!