]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/network-vlans
network-vlans: Use ip link command instead of vconfig.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / network-vlans
old mode 100755 (executable)
new mode 100644 (file)
index 2fdfe9e..a6a75c3
@@ -31,13 +31,18 @@ eval $(/usr/local/bin/readhash ${CONFIG_FILE})
 # This is start or stop.
 action=${1}
 
-for interface in green0 blue0 orange0; do
+for interface in green0 red0 blue0 orange0; do
        case "${interface}" in
                green*)
                        PARENT_DEV=${GREEN_PARENT_DEV}
                        VLAN_ID=${GREEN_VLAN_ID}
                        MAC_ADDRESS=${GREEN_MAC_ADDRESS}
                        ;;
+               red*)
+                       PARENT_DEV=${RED_PARENT_DEV}
+                       VLAN_ID=${RED_VLAN_ID}
+                       MAC_ADDRESS=${RED_MAC_ADDRESS}
+                       ;;
                blue*)
                        PARENT_DEV=${BLUE_PARENT_DEV}
                        VLAN_ID=${BLUE_VLAN_ID}
@@ -75,13 +80,15 @@ for interface in green0 blue0 orange0; do
                                continue
                        fi
 
-                       echo "Creating VLAN interface ${interface}..."
-                       vconfig add ${PARENT_DEV} ${VLAN_ID}
-                       ip link set ${PARENT_DEV}.${VLAN_ID} name ${interface}
-
+                       # Build command line.
+                       command="ip link add link ${PARENT_DEV} name ${interface}"
                        if [ -n "${MAC_ADDRESS}" ]; then
-                               ip link set ${interface} address ${MAC_ADDRESS}
+                               command="${command} address ${MAC_ADDRESS}"
                        fi
+                       command="${command} type vlan id ${VLAN_ID}"
+
+                       echo "Creating VLAN interface ${interface}..."
+                       ${command}
 
                        # Bring up the parent device.
                        ip link set ${PARENT_DEV} up
@@ -95,7 +102,7 @@ for interface in green0 blue0 orange0; do
 
                        echo "Removing VLAN interface ${interface}..."
                        ip link set ${interface} down
-                       vconfig rem ${interface}
+                       ip link delete ${interface}
                        ;;
                
                *)