For Ethernet connection, when carrier is lost then NetworkManager sets connection state to 'unavailable':
[root@host ~]# ip link set down enp2s0f0
[root@host ~]# journalctl -u NetworkManager --since 20:50
Jun 02 20:54:09 ixmed1 NetworkManager[1200]: <info> [1591124049.7857] device (enp2s0f0): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
After that IPv4 address is removed from interface.
Unfortunately this is not the the case for bonded connections. I tried Round-Robin and Active-Backup and in both configurations when all slaves lost carrier master is still active and has its IPv4 address assigned.
I am using pacemaker/corosync with ocf::heartbeat:Ipaddr2 resource and this behaviour prevents corosync to move virtual IP address to another node when all slaves of bonded connection lost its carrier.
Is it possible to configure NetworkManager to behave exactly the same as Ethernet connection by default? I mean for any bond connection when both slaves lost its carrier master interface should be deactivated and its IPv4 address should be removed.