Commit d2cf9ae9 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Add policy support to bonding connections

parent 9a1ca23b
...@@ -4,3 +4,4 @@ Connection=bond ...@@ -4,3 +4,4 @@ Connection=bond
BindsToInterfaces=(eth0 eth2) BindsToInterfaces=(eth0 eth2)
IP=static IP=static
Address="10.0.0.1/8" Address="10.0.0.1/8"
#Mode=balance-rr
...@@ -303,8 +303,12 @@ of the `wireless' type: ...@@ -303,8 +303,12 @@ of the `wireless' type:
OPTIONS FOR `bond' CONNECTIONS OPTIONS FOR `bond' CONNECTIONS
------------------------------ ------------------------------
The interfaces of 'BindsToInterfaces' are bound together in the The interfaces of 'BindsToInterfaces' are bound together in the
interface named by 'Interface'. All *ip options* are understood for interface named by 'Interface'. Next to the *ip options*, the following
connections of the `bond' type. is understood for connections of the `bond' type:
'Mode='::
The bonding policy. See the kernel documentation on bonding for
details.
OPTIONS FOR `bridge' CONNECTIONS OPTIONS FOR `bridge' CONNECTIONS
......
...@@ -9,11 +9,10 @@ bond_up() { ...@@ -9,11 +9,10 @@ bond_up() {
if is_interface "$Interface"; then if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists" report_error "Interface '$Interface' already exists"
return 1 return 1
else
interface_add bond "$Interface"
fi fi
bring_interface_up "$Interface"
interface_add bond "$Interface" "" ${Mode:+mode "$Mode"}
bring_interface_up "$Interface"
for slave in "${BindsToInterfaces[@]}"; do for slave in "${BindsToInterfaces[@]}"; do
ip link set dev "$slave" master "$Interface" ip link set dev "$slave" master "$Interface"
done done
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment