aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Lautrbach <plautrba@redhat.com>2010-05-12 14:00:11 +0200
committerBill Nottingham <notting@redhat.com>2010-05-13 12:48:47 -0400
commit286e6430ce2b1873e319e5edfa08c45806fbedab (patch)
treed763ee1d96f2e43a350bae67c43ca78915c1112d
parenteaeb72231350ed442979a7616cf547859a885609 (diff)
downloadinitscripts-286e6430ce2b1873e319e5edfa08c45806fbedab.tar
initscripts-286e6430ce2b1873e319e5edfa08c45806fbedab.tar.gz
initscripts-286e6430ce2b1873e319e5edfa08c45806fbedab.tar.bz2
initscripts-286e6430ce2b1873e319e5edfa08c45806fbedab.tar.xz
initscripts-286e6430ce2b1873e319e5edfa08c45806fbedab.zip
use ip command for vlan instead of vconfig
-rwxr-xr-xrc.d/init.d/network8
-rw-r--r--sysconfig.txt3
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth4
-rwxr-xr-xsysconfig/network-scripts/ifup28
4 files changed, 10 insertions, 33 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 9e0fc2a0..232f3e2c 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -34,9 +34,6 @@ fi
# if the ip configuration utility isn't around we can't function.
[ -x /sbin/ip ] || exit 1
-# Even if VLAN is configured, without the utility we can't do much
-[ ! -x /sbin/vconfig ] && VLAN=
-
CWD=$(pwd)
cd /etc/sysconfig/network-scripts
@@ -69,10 +66,7 @@ case "$1" in
case "$VLAN" in
yes)
- if [ -d /proc/net/vlan ] || modprobe 8021q >/dev/null 2>&1 ; then
- 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
+ if [ ! -d /proc/net/vlan ] && ! modprobe 8021q >/dev/null 2>&1 ; then
echo $"No 802.1Q VLAN support available in kernel."
fi
;;
diff --git a/sysconfig.txt b/sysconfig.txt
index 480a42db..c939e288 100644
--- a/sysconfig.txt
+++ b/sysconfig.txt
@@ -704,8 +704,7 @@ Files in /etc/sysconfig/network-scripts/
Ethernet 802.1q VLAN items:
DEVICE=eth0.42
- Initscripts use DEV_PLUS_VID_NO_PAD naming mode for VLAN
- devices.
+ Initscripts use DEVICE for VLAN devices.
Example: eth0.42 for vlan 42 on device eth0.
Valid VLAN ID range is 0-4095. Most ethernet switches reserve
VLAN ID 1 to be used as management VLAN; starting from VLAN
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 1ca6a6f2..53c70238 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -138,12 +138,12 @@ if [ "$retcode" = 0 ] ; then
# the interface went down.
fi
-if [ -n "$VLAN" -a -x /sbin/vconfig ]; then
+if [ -n "$VLAN" ]; 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]?' \
|| 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}
+ ip link delete ${DEVICE} type vlan
}
fi
fi
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index ffbd376d..c15d1d2a 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -71,7 +71,7 @@ if [ "$USE_NM" = "true" -a -n "$UUID" ]; then
fi
# Ethernet 802.1Q VLAN support
-if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then
+if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ]; then
VID=""
MATCH='^(eth|hsi|bond)[0-9]+\.[0-9]{1,4}$'
if [[ "${DEVICE}" =~ $MATCH ]]; then
@@ -96,9 +96,6 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then
fi
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."
- }
is_available ${PHYSDEV} || {
if [ "$?" = "1" ] ; then
@@ -115,30 +112,17 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then
}
if [ ! -f /proc/net/vlan/${DEVICE} ]; then
- /sbin/vconfig add ${PHYSDEV} ${VID} || {
+ if [ "${REORDER_HDR}" = "no" -o "${REORDER_HDR}" = "0" ]; then
+ FLAG_REORDER_HDR="reorder_hdr off"
+ fi
+
+ ip link add dev ${DEVICE} link ${PHYSDEV} type vlan id ${VID} ${FLAG_REORDER_HDR} || {
(/usr/bin/logger -p daemon.info -t ifup \
$"ERROR: could not add vlan ${VID} as ${DEVICE} on dev ${PHYSDEV}" &)&
echo $"ERROR: could not add vlan ${VID} as ${DEVICE} on dev ${PHYSDEV}"
exit 1
}
fi
-
- if [ -f /proc/net/vlan/${DEVICE} ]; then
- case "$REORDER_HDR" in
- yes|1)
- /sbin/vconfig set_flag ${DEVICE} 1 1 || {
- (/usr/bin/logger -p daemon.info -t ifup \
- "WARNING: vconfig not able to enable REORDER_HDR on ${DEVICE}" &)&
- }
- ;;
- no|0)
- /sbin/vconfig set_flag ${DEVICE} 1 0 || {
- (/usr/bin/logger -p daemon.info -t ifup \
- $"WARNING: vconfig not able to disable REORDER_HDR on ${DEVICE}" &)&
- }
- ;;
- esac
- fi
fi
fi