Score:0

How to get DHCP from both interfaces in bonding active-backup mode?

fr flag

I have two interfaces connected to two different routers - with different gateway and subnets. How to get IP addresses on bond interface from both enp1s0 and enp2s0 (in bonding active-backup mode)? Currently I get IP from primary, but if primary goes down the bond doesn't refresh IP and gateway, so switching to backup doesn't work. Only when I plug out both, then plug in backup, the bond interface refresh DHCP and get new IP and gateway from backup router. But still if then plug in primary again the bond interface doesn't renew IP so internet connection doesn't work.

I observed that only if the bond interface have IPs from both subnets the failover works. But I get it only once when plug out and plug in the cables randomly between interfaces.

My configuration in netplan:

network:
 version: 2
 renderer: networkd
 ethernets:
  enp1s0:
   ignore-carrier: yes #with or without doesn't change (without bonding had to have)
  enp2s0:
   ignore-carrier: yes #with or without doesn't change (without bonding had to have)
  bonds:
   bond0:
    dhcp4: yes
    interfaces:
    - enp1s0
    - enp2s0
    parameters:
     mode: active-backup
     primary: enp2s0
     mii-monitor-interval: 50
     down-delay: 10
   

Maybe it would be better to do it without bonding but with metrics, but it didn't work to me that high-metric backup interface take over communication automatically when low-metric primary goes down.

Score:1
sz flag

Bonding in active-backup mode will only use one interface at a time, so you will only be able to get DHCP from one interface at a time.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.