Network Interface IP Address Weird Behavior

I’d put it as:

While working with two interfaces:

  • enp2s0
  • enp3s0

enp2s0 is set to 192.168.8.8 by default, so to avoid colliding addresses, enp3s0 is set to 192.168.8.9.

To change these addresses, the application is leveraging DBUS and NetworkManager with a Python script to update the IPv4 address and prefix for that particular interface.

While this logs and seems to be working, however after replugging the device, the addresses flip:

  • enp2s0: 192.168.8.9
  • enp3s0: 192.168.8.8

And pinging the node on either address is now responsive only on one interface, so enp2s0 responds to the x.x.8.9 and x.x.8.8 addresses.

After pulling enp3s0, enp2s0 now only responds to the x.x.8.9 address!

Any thoughts on how to resolve this behavior?

It appears that the device is acknowledging a physical interface being plugged in by assigning the IP address previously set via DBUS, however in this case it is only setting those IP addresses on ONE interface, when it should be assigning them to different physical interfaces as expected. Modifications to the IP address should only be to that specific interface

Is there any additional logging/debug information we can look at to investigate the issue deeper?

Hi,

How exactly are you setting device / IP mappings in NetworkManager?
It’s possible to create dedicated connection profiles that bind to specific interface names, so I’d assume you can also specify it in your DBus / nmcli commands

1 Like