aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-03-30 16:49:09 +0000
committerBill Nottingham <notting@redhat.com>2005-03-30 16:49:09 +0000
commit132718bb1b966d026791bb970f3258753aec9752 (patch)
tree85acf7c01456b79565ee6418b0e1e87f26dde9e4
parent95fc0d1440cefbb0a8ae1df0f542cc56d6890250 (diff)
downloadinitscripts-132718bb1b966d026791bb970f3258753aec9752.tar
initscripts-132718bb1b966d026791bb970f3258753aec9752.tar.gz
initscripts-132718bb1b966d026791bb970f3258753aec9752.tar.bz2
initscripts-132718bb1b966d026791bb970f3258753aec9752.tar.xz
initscripts-132718bb1b966d026791bb970f3258753aec9752.zip
handle alternate vlan naming schemes (#115001)
-rwxr-xr-xrc.d/init.d/network3
-rwxr-xr-xsysconfig/network-scripts/ifdown3
-rwxr-xr-xsysconfig/network-scripts/ifup28
3 files changed, 24 insertions, 10 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 8106ccde..535fbf58 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -77,7 +77,8 @@ case "$1" in
case "$VLAN" in
yes)
if [ -d /proc/net/vlan ] || modprobe 8021q >/dev/null 2>&1 ; then
- action $"Setting 802.1Q VLAN parameters: " /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD
+ test -z "$VLAN_NAME_TYPE" && VLAN_NAME_TYPE=DEV_PLUS_VID_NO_PAD
+ action $"Setting 802.1Q VLAN parameters: " /sbin/vconfig set_name_type "$VLAN_NAME_TYPE"
else
echo $"No 802.1Q VLAN support available in kernel."
fi
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index a28e9af2..170b1504 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -151,7 +151,8 @@ fi
if [ -n "$VLAN" -a -x /sbin/vconfig ]; then
# 802.1q VLAN
- if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then
+ if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' \
+ || echo ${DEVICE} | LANG=C egrep -q 'vlan[0-9][0-9]?[0-9]?[0-9]?' ; then
[ -f /proc/net/vlan/${DEVICE} ] && {
/sbin/vconfig rem ${DEVICE}
}
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 23686e5f..a4c3934d 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -59,10 +59,28 @@ fi
# Ethernet 802.1Q VLAN support
if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then
- if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then
+ VID=""
+ if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?'; then
+ VID="`echo ${DEVICE} | \
+ LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
+ LANG=C sed 's/^[a-z0-9]*\.//g;s/^0*//'`"
+ PHYSDEV="`echo ${DEVICE} | \
+ LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
+ LANG=C sed 's/\.[a-z0-9]*$//g'`"
+ fi
+ if echo ${DEVICE} | LANG=C egrep -q 'vlan[0-9][0-9]?[0-9]?[0-9]?'; then
+ VID="`echo ${DEVICE} | LANG=C sed 's/^vlan//;s/^0*//'`"
+ # PHYSDEV should be set in ifcfg-vlan* file
+ if test -z "$PHYSDEV"; then
+ echo $"PHYSDEV should be set for device ${DEVICE}"
+ exit 1
+ fi
+ fi
+ if [ -n "$VID" ]; then
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 || {
+ test -z "$VLAN_NAME_TYPE" && VLAN_NAME_TYPE=DEV_PLUS_VID_NO_PAD
+ /sbin/vconfig set_name_type "$VLAN_NAME_TYPE" >/dev/null 2>&1 || {
echo $"Could not set 802.1Q VLAN parameters."
}
else
@@ -70,12 +88,6 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then
exit 1
fi
fi
- VID="`echo ${DEVICE} | \
- LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
- LANG=C sed 's/^[a-z0-9]*\.//g;s/^0*//'`"
- PHYSDEV="`echo ${DEVICE} | \
- LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
- LANG=C sed 's/\.[a-z0-9]*$//g'`"
is_available ${PHYSDEV} || {
if [ "$?" = "1" ] ; then