bond 738 Bytes
Newer Older
1
2
3
4
# Contributed by: Byron Williams <byron@112percent.com>

. "$SUBR_DIR/ip"

Jouke Witteveen's avatar
Jouke Witteveen committed
5
: ${IFENSLAVE:=ifenslave}
6
declare -ag BindsToInterfaces
7
8

bond_up() {
9
10
11
    if is_interface "$Interface"; then
        report_error "Interface '$Interface' already exists"
        return 1
12
    else
13
        ip link add dev "$Interface" type bond
14
    fi
15
    bring_interface_up "$Interface"
16

17
18
19
    for slave in "${BindsToInterfaces[@]}"; do
        bring_interface_up "$slave"
        $IFENSLAVE "$Interface" "$slave"
20
21
    done

22
    ip_set
23
24
25
}

bond_down() {
26
27
    for slave in "${BindsToInterfaces[@]}"; do
        $IFENSLAVE "$Interface" -d "$slave"
28
29
    done

30
31
32
    ip_unset
    bring_interface_down "$Interface"
    ip link delete "$Interface"
33
34
35
}


Jouke Witteveen's avatar
Jouke Witteveen committed
36
# vim: ft=sh ts=4 et sw=4: