bond 694 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
13
    fi

14
15
    interface_add bond "$Interface" "" ${Mode:+mode "$Mode"}
    bring_interface_up "$Interface"
16
    for slave in "${BindsToInterfaces[@]}"; do
17
        ip link set dev "$slave" master "$Interface"
18
19
    done

20
    ip_set
21
22
23
}

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

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


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