]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.vlan
vlan: Rename tag to id
[people/ms/network.git] / src / functions / functions.vlan
index 99a8baa375d513f0b664cd3d7e838d8127bdff87..9a70c95480e3a99609e3e7e5c66b0a729e5f411f 100644 (file)
@@ -24,19 +24,6 @@ PROC_NET_VLAN_CONFIG="${PROC_NET_VLAN}/config"
 
 VLAN_PORT_INTERFIX="v"
 
-vlan_init() {
-       ebtables-restore <<EOF
-*filter
-:INPUT ACCEPT
-:FORWARD ACCEPT
-:OUTPUT ACCEPT
-
-*broute
-:BROUTING ACCEPT
--A BROUTING -p 802_1Q -j DROP
-EOF
-}
-
 vlan_create() {
        local device="${1}"
        shift
@@ -44,8 +31,8 @@ vlan_create() {
        assert isset device
 
        local address
+       local id
        local parent
-       local tag
 
        # Parse command line arguments
        while [ $# -gt 0 ]; do
@@ -53,12 +40,12 @@ vlan_create() {
                        --address=*)
                                address=$(cli_get_val "${1}")
                                ;;
+                       --id=*)
+                               id=$(cli_get_val "${1}")
+                               ;;
                        --parent=*)
                                parent=$(cli_get_val "${1}")
                                ;;
-                       --tag=*)
-                               tag=$(cli_get_val "${1}")
-                               ;;
                        *)
                                error "Unrecognized argument: ${1}"
                                return ${EXIT_ERROR}
@@ -90,13 +77,10 @@ vlan_create() {
                return ${EXIT_ERROR}
        fi
 
-       # Load ebtables stuff.
-       vlan_init
-
        # Make the command
        local command=(
                ip link add link "${parent}" name "${device}"
-                       address "${address}" type vlan id "${tag}"
+                       address "${address}" type vlan id "${id}"
        )
 
        # Run the command
@@ -105,7 +89,7 @@ vlan_create() {
                return ${EXIT_ERROR}
        fi
 
-       log DEBUG "Created VLAN device ${device} (parent = ${parent}, id = ${tag})"
+       log DEBUG "Created VLAN device ${device} (parent = ${parent}, id = ${id})"
 
        return ${EXIT_OK}
 }