bond 706 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
7

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

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

21
    ip_set
22
23
24
}

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

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


# vim: set ts=4 et sw=4: