summaryrefslogtreecommitdiffstats
path: root/src/lib/connections/bond
blob: 7e4112f020d12f9a6c0a99b4a4f7cce6f0c51138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Contributed by: andy123 <ajs@online.de>

. "$SUBR_DIR/ip"

# Make sure BindsToInterfaces is set
BindsToInterfaces=("${BindsToInterfaces[@]}")

bond_up() {
    if is_interface "$Interface"; then
        report_error "Interface '$Interface' already exists"
        return 1
    else
        interface_add bond "$Interface"
    fi
    bring_interface_up "$Interface"

    for slave in "${BindsToInterfaces[@]}"; do
        ip link set dev "$slave" master "$Interface"
    done

    ip_set
}

bond_down() {
    for slave in "${BindsToInterfaces[@]}"; do
        ip link set dev "$slave" nomaster
    done

    ip_unset
    interface_delete "$Interface"
}


# vim: ft=sh ts=4 et sw=4: