diff options
author | Loïc Minier <lool@dooz.org> | 2007-09-30 17:52:21 +0200 |
---|---|---|
committer | Loïc Minier <lool@dooz.org> | 2007-09-30 17:52:21 +0200 |
commit | cf4ac411b817a3b4630e7766562dffbc42a6525e (patch) | |
tree | f0991b3f1eb335caea4cebc6a8eb5c10d14adc58 | |
parent | 9791e631aa3fda30c84b5f10112e162b196284b8 (diff) |
Point to vlan-interfaces(5); recommend setting vlan-raw-device
-rw-r--r-- | debian/README | 11 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/network/if-post-down.d/vlan | 31 | ||||
-rw-r--r-- | debian/network/if-pre-up.d/vlan | 100 |
4 files changed, 81 insertions, 67 deletions
diff --git a/debian/README b/debian/README index 703516c..afc0b51 100644 --- a/debian/README +++ b/debian/README @@ -1,4 +1,15 @@ +VLANs in /etc/network/interfaces +================================ + +Check the vlan-interfaces(5) man page and make sure you set vlan-raw-device in +your interfaces stanzas. You can omit the hint in some cases, but it's best +to always have the keyword. + + +MAC-VLAN +======== + You need a kernel with the MAC-VLAN driver to use macvlan_config. MAC-VLAN support was merged in the Linux kernel for version 2.6.23. diff --git a/debian/changelog b/debian/changelog index b3e2c65..87b3b72 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,8 +14,12 @@ vlan (1.9-3) UNRELEASED; urgency=low binaries, so simply rely on the upstream build. - Build with -O2 unless DEB_BUILD_OPTIONS has noopt. * Prepare to ship macvlan_config in the future. + * Add support for bonding in if-pre-up and if-post-down scripts; cleanup + these scripts; closes: #404630. + * Point to the vlan-interfaces(5) man page in the Debian README and + recommend setting vlan-raw-device. - -- Loic Minier <lool@dooz.org> Sun, 30 Sep 2007 17:21:45 +0200 + -- Loic Minier <lool@dooz.org> Sun, 30 Sep 2007 17:48:04 +0200 vlan (1.9-2) unstable; urgency=medium diff --git a/debian/network/if-post-down.d/vlan b/debian/network/if-post-down.d/vlan index bbc1c44..5d3cba5 100644 --- a/debian/network/if-post-down.d/vlan +++ b/debian/network/if-post-down.d/vlan @@ -5,23 +5,24 @@ # to just probe for the right device name in /proc/net/vlan case "$IFACE" in - # Ignore any alias (#272891) - *:*) 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/"` - ;; - # Test for vlan raw device (#196890, #292648) - *) [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 - ;; + # Ignore any alias (#272891) + *:*) + exit 0 + ;; + eth*.0*|bond*.0*) + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + eth*.*|bond*.*) + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + # Test for vlan raw device (#196890, #292648) + *) + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + ;; esac -if [ ! -x /sbin/vconfig ] -then - exit 0 +if [ ! -x /sbin/vconfig ]; then + exit 0 fi vconfig rem $IFACE diff --git a/debian/network/if-pre-up.d/vlan b/debian/network/if-pre-up.d/vlan index 4c8126c..8753998 100644 --- a/debian/network/if-pre-up.d/vlan +++ b/debian/network/if-pre-up.d/vlan @@ -3,61 +3,59 @@ # Most of this stuff is to enable vlans case "$IFACE" in - # Ignore any alias (#272891) which uses <interface>:<alabel> - *:*) 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*.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/"` - ;; - *.0*) - # Silently ignore interfaces which we do not (know how to) support - [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 - vconfig set_name_type DEV_PLUS_VID - VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` - ;; - *.*) - # Silently ignore interfaces which we do not (know how to) support - [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 - vconfig set_name_type DEV_PLUS_VID_NO_PAD - VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` - ;; + # Ignore any alias (#272891) which uses <interface>:<alabel> + *:*) + 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*.0*|bond*.0*) + vconfig set_name_type DEV_PLUS_VID + VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//"` + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + eth*.*|bond*.*) + vconfig set_name_type DEV_PLUS_VID_NO_PAD + VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//g"` + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + *.0*) + # Silently ignore interfaces which we do not (know how to) support + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + vconfig set_name_type DEV_PLUS_VID + VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` + ;; + *.*) + # Silently ignore interfaces which we do not (know how to) support + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + vconfig set_name_type DEV_PLUS_VID_NO_PAD + VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` + ;; - *) exit 0 - ;; + *) + 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 +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 +if [ -n "$IF_HW_MAC_ADDRESS" ]; then + ip link set $IFACE address $IF_HW_MAC_ADDRESS fi |