summaryrefslogtreecommitdiffstats
path: root/src/lib/connections/vlan
blob: e9ab08b7982eaa66388654b28e5af724059b00d8 (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
# Contributed by: Thomas S Hatch <thatch45@gmail.com>

. "$SUBR_DIR/connections/ethernet"

vlan_up() {
    if [[ ${#BindsToInterfaces[@]} -ne 1 ]]; then
        report_error "No unique physical device for VLAN interface '$Interface' specified"
        return 1
    fi
    if is_interface "$Interface"; then
        report_error "Interface '$Interface' already exists"
        return 1
    else
        bring_interface_up "$BindsToInterfaces"
        ip link add link "$BindsToInterfaces" name "$Interface" type vlan id "$VLANID"
    fi

    ethernet_up
}

vlan_down() {
    ethernet_down
    ip link delete "$Interface"
}


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