tags 272891 + patch thanks Hi,
On mer, sep 22, 2004, Johann Botha wrote: > > When I use vlan interfaces with aliases the ifup and ifdown scripts don't > work correctly. Actually, they produce an error, but seem to work nevertheless. > I think it should only try to add/remove the vlan interface if it is not an > alias. I came to the same conclusion. > my little hack is just to "exit 0" if it is an alias..... Same hack here. Configs attached. Adding tag "patch". I would add that it is confusing to miss the vlan* interfaces in the post-down script, but this is solved by the patch in #292648. Regards, -- Loïc Minier <[EMAIL PROTECTED]> "Neutral President: I have no strong feelings one way or the other."
#!/bin/sh # Most of this stuff is to enable vlans case "$IFACE" in vlan*:*) # this is just an alias, do nothing exit 0 ;; vlan0*) vconfig set_name_type VLAN_PLUS_VID VLANID=`echo $IFACE|sed "s/vlan0*//"` ;; vlan*) vconfig set_name_type VLAN_PLUS_VID_NO_PAD VLANID=`echo $IFACE|sed "s/vlan0*//"` ;; eth*.*:*) # this is just an alias, do nothing exit 0 ;; eth*.0*) vconfig set_name_type DEV_PLUS_VID VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"` IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` ;; eth*.*) vconfig set_name_type DEV_PLUS_VID_NO_PAD VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"` IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` ;; *) exit 0 ;; esac if [ -n "$IF_VLAN_RAW_DEVICE" ] then if [ ! -x /sbin/vconfig ] then exit 0 fi if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null then echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE" exit 1 fi ip link set up dev $IF_VLAN_RAW_DEVICE vconfig add $IF_VLAN_RAW_DEVICE $VLANID fi # This is not vlan specific, and should actually go somewhere else. if [ -n "$IF_HW_MAC_ADDRESS" ] then ip link set $IFACE address $IF_HW_MAC_ADDRESS fi
#!/bin/sh # If IFACE is an automagic vlan interface (without the vlan-raw-device # parameter) then let's try to discover the magic here.. Another way would be # to just probe for the right device name in /proc/net/vlan case "$IFACE" in vlan*:*) # this is just an alias, do nothing exit 0 ;; eth*.*:*) # this is just an alias, do nothing exit 0 ;; eth*.0*) IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` ;; eth*.*) IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` ;; *) exit 0 ;; esac if [ -z "$IF_VLAN_RAW_DEVICE" ] then exit 0 fi if [ ! -x /sbin/vconfig ] then exit 0 fi vconfig rem $IFACE