Browse Source

network: support vlan tagged bonding

This patch adds support of vlan tagged bonding, for example,
bond0.2. In case of regression, I also tested bond0 and eth0.2,
all work fine.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
master
Cong Wang 13 years ago committed by Harald Hoyer
parent
commit
472edf825e
  1. 8
      modules.d/40network/ifup.sh
  2. 6
      modules.d/40network/net-genrules.sh

8
modules.d/40network/ifup.sh

@ -188,7 +188,7 @@ if [ -e /tmp/bridge.info ]; then @@ -188,7 +188,7 @@ if [ -e /tmp/bridge.info ]; then
brctl setfd $bridgename 0
for ethname in $ethnames ; do
if [ "$ethname" = "$bondname" ] ; then
DO_BOND_SETUP=yes ifup $bondname
DO_BOND_SETUP=yes ifup $bondname -m
else
ip link set $ethname up
fi
@ -211,7 +211,11 @@ get_vid() { @@ -211,7 +211,11 @@ get_vid() {

if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
modprobe 8021q
ip link set "$phydevice" up
if [ "$phydevice" = "$bondname" ] ; then
DO_BOND_SETUP=yes ifup $phydevice -m
else
ip link set "$phydevice" up
fi
wait_for_if_up "$phydevice"
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
fi

6
modules.d/40network/net-genrules.sh

@ -21,19 +21,19 @@ fix_bootif() { @@ -21,19 +21,19 @@ fix_bootif() {
# bridge: attempt only the defined interface
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
IFACES=${ethnames%% *}
IFACES+=" ${ethnames%% *}"
fi

# bond: attempt only the defined interface (override bridge defines)
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
# It is enough to fire up only one
IFACES=${bondslaves%% *}
IFACES+=" ${bondslaves%% *}"
fi

if [ -e /tmp/vlan.info ]; then
. /tmp/vlan.info
IFACES=$phydevice
IFACES+=" $phydevice"
fi

ifup='/sbin/ifup $env{INTERFACE}'

Loading…
Cancel
Save