replace vconfig with ip link

This commit is contained in:
Kishan Kavala 2014-08-11 22:28:39 +05:30 committed by root
parent 3e0c55cabe
commit b37ee25359

View File

@ -31,11 +31,9 @@ addVlan() {
local vlanDev=$pif.$vlanId local vlanDev=$pif.$vlanId
local vlanBr=$3 local vlanBr=$3
vconfig set_name_type DEV_PLUS_VID_NO_PAD
if [ ! -d /sys/class/net/$vlanDev ] if [ ! -d /sys/class/net/$vlanDev ]
then then
vconfig add $pif $vlanId > /dev/null ip link add link $pif name $vlanDev type vlan id $vlanId > /dev/null
if [ $? -gt 0 ] if [ $? -gt 0 ]
then then
@ -102,7 +100,7 @@ deleteVlan() {
local vlanDev=$pif.$vlanId local vlanDev=$pif.$vlanId
local vlanBr=$3 local vlanBr=$3
vconfig rem $vlanDev > /dev/null ip link delete $vlanDev type vlan > /dev/null
if [ $? -gt 0 ] if [ $? -gt 0 ]
then then