]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
red: Update to use ip in place of deprecated vconfig
authorAdolf Belka <adolf.belka@ipfire.org>
Mon, 9 Jun 2025 13:32:28 +0000 (15:32 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 15 Jun 2025 12:14:21 +0000 (12:14 +0000)
- I noticed that the vlan package was last updated in 2005 and that the vconfig site said
   that 802.1Q VLAN code is part of the official kernel, and has been for years and
   years. It is very unlikely that you need to download anything from this site, the
   packages are left here for posterity's sake. 802.1Q VLANs can be created with the
   'ip' utility (vconfig works for vlans, but is crufty and deprecated).
- Based on this it seemed appropriate to replace the vconfig commands with ip commands.
- This patch set has been sent as an RFC PATCH as my replacement ip commands may or may
   not be correct and I am unable to test the effect as I do not have a pppoe connection
   using vlans.
- I am open to any modifications or any other decision with reagard to the vlan package

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/networking/red

index fddc70d9295feb5b47a8a31cfdbf66e353f5c448..6d779b3652f966442fa3e1204e06bcf2b569b75d 100644 (file)
@@ -251,7 +251,7 @@ case "${1}" in
                        if [ "$TYPE" == "vdsl" ]; then
                                boot_mesg "Creating VLAN Interface ${DEVICE}.${INET_VLAN} ..."
                                modprobe 8021q
-                               vconfig add ${DEVICE} ${INET_VLAN}
+                               ip link add link ${DEVICE} name ${DEVICE}.${INET_VLAN} type vlan id ${INET_VLAN}
                                if [ -n "$MAC1" ]; then
                                        boot_mesg "Setting mac address on ${DEVICE}.${INET_VLAN} to ${MAC1}"    
                                        ip link set dev ${DEVICE}.${INET_VLAN} address ${MAC1}
@@ -276,7 +276,7 @@ case "${1}" in
                                if [ ! -f "$PIDFILE" ]; then
                                        boot_mesg "Creating VLAN Interface ${DEVICE}.${IPTV_VLAN} ..."
                                        modprobe 8021q
-                                       vconfig add ${DEVICE} ${IPTV_VLAN}
+                                       ip link add link ${DEVICE} name ${DEVICE}.${IPTV_VLAN} type vlan id ${IPTV_VLAN}
                                        if [ -n "$MAC2" ]; then
                                                boot_mesg "Setting mac address on ${DEVICE}.${IPTV_VLAN} to ${MAC2}"
                                                ip link set dev ${DEVICE}.${IPTV_VLAN} address ${MAC2}
@@ -548,7 +548,7 @@ case "${1}" in
                                if echo "${link_status}" | grep -q UP; then
                                        boot_mesg "Bringing down the ${DEVICE}.${INET_VLAN} interface..."
                                        ip link set ${DEVICE}.${INET_VLAN} down
-                                       vconfig rem ${DEVICE}.${INET_VLAN}
+                                       ip link delete ${DEVICE}.${INET_VLAN}
                                        evaluate_retval
                                fi
                        else