bond 682 Bytes
Newer Older
1
# Contributed by: andy123 <ajs@online.de>
2
3
4

. "$SUBR_DIR/ip"

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

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

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

21
    ip_set
22
23
24
}

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

29
    ip_unset
30
    interface_delete "$Interface"
31
32
33
}


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