aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifdown3
-rwxr-xr-xsysconfig/network-scripts/ifup25
2 files changed, 15 insertions, 13 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 29fb9674..c16f251f 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -46,7 +46,7 @@ fi
. /etc/sysconfig/network
# Check to make sure the device is actually up
-check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "bootp" ] && exit 0
+check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "bootp" ] && [ -n "$VLAN" -a "$VLAN" != "yes" ] && exit 0
if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
@@ -127,7 +127,6 @@ if [ -n "$VLAN" -a -x /sbin/vconfig ]; then
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
[ -f /proc/net/vlan/${DEVICE} ] && {
/sbin/vconfig rem ${DEVICE}
- retcode=$?
}
fi
fi
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} || {