[CentOS] nmcli: unwanted secondary ip-address

Tue Sep 22 15:26:29 UTC 2020
Mark Milhollan <mlm+centos-lists at milhollan.com>

On Tue, 22 Sep 2020, Felix Kölzow wrote:

>A secondary ip address seems to be automatically added to a nic which
>causes several issues in our setup.

> # nmcli con show
> NAME      UUID                                  TYPE      DEVICE
> eno4      dbd95c24-1ed7-4292-8dba-3934bd1476a0  ethernet  eno4

> 6: eno4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
>     link/ether 00:26:b9:78:87:d7 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.2.98/24 brd 192.168.2.255 scope global noprefixroute eno4
>        valid_lft forever preferred_lft forever
>     inet *192.168.137.223/24* brd 192.168.137.255 scope global dynamic eno4      <<----- THIS IS UNWANTED
>        valid_lft 604778sec preferred_lft 604778sec
>     inet6 fe80::9257:5654:b211:8dea/64 scope link noprefixroute
>        valid_lft forever preferred_lft forever

You failed to show the configuration of eno4's profile in Network 
Manager (nmcli con show eno4).  You can use 'nmcli con edit' (or nmtui) 
to modify the profile to eliminate the assignment of the unwanted 
address -- if it is in automatic mode (which seems to be the case) then 
you may need to fix your DHCP server instead.  If there is no chance 
that Network Manager is assigning the extra address then you will have 
to hunt around your system for the program or script that is doing so.


/mark