diff options
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index b54abe43..73e4e805 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -62,17 +62,19 @@ else ISALIAS=no fi +# Ethernet 802.1Q VLAN support if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then - # 802.1q VLAN if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q 'eth[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then - [ -d /proc/net/vlan ] || modprobe 8021q >/dev/null 2>&1 || { - echo $"No 802.1Q VLAN support available in kernel." - echo $"Error initializing device ${DEVICE}" - logger -p daemon.info -t ifup \ - $"No 802.1Q VLAN support available in kernel for device ${DEVICE}" - exit 1 - } - + if [ ! -d /proc/net/vlan ]; then + if modprobe 8021q >/dev/null 2>&1 ; then + /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD >/dev/null 2>&1 || { + echo $"Could not set 802.1Q VLAN parameters." + } + else + echo $"No 802.1Q VLAN support available in kernel for device ${DEVICE}" + exit 1 + fi + fi VID="`echo ${DEVICE} | \ LANG=C egrep 'eth[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \ LANG=C sed 's/^[a-z0-9]*\.//g;s/^0*//'`" @@ -90,8 +92,9 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then } # Link on Physical device needs to be up but no ip required - ip addr add 0.0.0.0/32 dev ${PHYSDEV} - ip -o link set dev ${PHYSDEV} up + check_device_down ${PHYSDEV} && { + ip -o link set dev ${PHYSDEV} up + } if [ ! -f /proc/net/vlan/${DEVICE} ]; then /sbin/vconfig add ${PHYSDEV} ${VID} || { |