Skip to content

Commit

Permalink
bonding - set intf down before up
Browse files Browse the repository at this point in the history
  • Loading branch information
jbemmel authored Dec 12, 2024
1 parent b1614b4 commit a884b6f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions netsim/extra/bonding/linux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

set -e

{% for intf in interfaces|default([]) if intf.type=='bond' %}
{% set mode = intf.bonding.mode|default('active-backup') %}
{{ create_bond_dev(intf|combine( {'type':'lag','lag': { 'mode': mode, 'lacp': 'off' } }) ) }}
{% for intf in interfaces|default([]) if intf.bonding.mode is defined %}
{{ create_bond_dev(intf,{ 'mode': intf.bonding.mode, 'lacp': 'off' } ) }}
ip link set dev {{ intf.ifname }} down
{% for member in intf.members %}
{% for member in intf.bonding.members %}
ip link set dev {{ member }} down
ip link set dev {{ member }} master {{ intf.ifname }}
ip link set dev {{ member }} up
{% endfor %}
ip link set dev {{ intf.ifname }} up
{% endfor %}

0 comments on commit a884b6f

Please sign in to comment.