ifup & ifdown don't work for vlan devices when raw device name is the new "enp" convention
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
The regular expressions used in /etc/network/
do not match the name of my network card enp4s0f0.
This can be fixed by broadening the regular expression.
This is only a problem when the device is a vlan device!
See below for the fix that worked on my system.
if-pre-up:
#!/bin/sh
# Most of this stuff is to enable vlans
case "$IFACE" in
# Ignore any alias (#272891) which uses <interface>
*:*)
exit 0
;;
vlan0*)
vconfig set_name_type VLAN_PLUS_VID
VLANID=`echo $IFACE|sed "s/vlan0*//"`
;;
vlan*)
vconfig set_name_type VLAN_PLUS_
VLANID=`echo $IFACE|sed "s/vlan0*//"`
;;
eth*.
vconfig set_name_type DEV_PLUS_VID
VLANID=`echo $IFACE|sed "s/eth[
IF_
;;
eth*.
vconfig set_name_type DEV_PLUS_VID_NO_PAD
VLANID=`echo $IFACE|sed "s/eth[
IF_
;;
*.0*)
# Silently ignore interfaces which we do not (know how to) support
[ -z "$IF_VLAN_
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_
vconfig set_name_type DEV_PLUS_VID_NO_PAD
VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"`
;;
*)
exit 0
;;
esac
if [ -n "$IF_VLAN_
if [ ! -x /sbin/vconfig ]; then
exit 0
fi
if ! ip link show dev "$IF_VLAN_
echo "$IF_VLAN_
exit 1
fi
if [ ! -e "/sys/class/
ip link set up dev $IF_VLAN_RAW_DEVICE
vconfig add $IF_VLAN_RAW_DEVICE $VLANID
fi
fi
# This is not vlan specific, and should actually go somewhere else.
if [ -n "$IF_HW_
ip link set $IFACE address $IF_HW_MAC_ADDRESS
fi
if-post-down:
#!/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
# Ignore any alias (#272891)
*:*)
exit 0
;;
eth*.
IF_
;;
eth*.
IF_
;;
# Test for vlan raw device (#196890, #292648)
*)
[ -z "$IF_VLAN_
;;
esac
if [ ! -x /sbin/vconfig ]; then
exit 0
fi
vconfig rem $IFACE
description: | updated |
summary: |
- ifup and ifdown dont work when ethernet device name does not meet - regular conventions + ifup and ifdown dont work for vlan devices when raw ethernet device name + does not meet regular conventions |
description: | updated |
affects: | biosdevname (Ubuntu) → ifupdown (Ubuntu) |
summary: |
- ifup and ifdown dont work for vlan devices when raw ethernet device name - does not meet regular conventions + ifup & ifdown don't work for vlan devices when raw device name is the + new "enp" convention |
might not be clear the added code are the scripts working with my ethernet device