[editors note: this is written by Brian Clapper. Posted here because he’s too busy working to make a blog and post it himself ;) ]
This assumes starting out with a BASE (and I emphasize BASE) CentOS 5.3 install on a machine with 2 NICs (for this example we used a Dell SC1435 and 1950III). We also assume you want to use a VLAN with ID 2. If your setup varies from this, figuring out what you need to alter is left as an exercise to the reader.
DISCLAIMER: I am a programmer… not an SA… not a network guy. This works for me, this may not work for you or be the best or ”correct” approach. Use at your own risk!
1) yum install vconfig
2) modprobe 8021q
3) edit /etc/modprobe.conf add:
alias bond0 bonding
alias bond0.2 bonding
options bond0 miimon=100 mode=1
options bond0.2 miimon=100 mode=1
4) setup /etc/sysconfig/network-scripts/ifcfg-eth0 and eth1 like so
(note, make sure to change the DEVICE if need be):
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
MII_NOT_SUPPORTED=yes
5) setup /etc/sysconfig/network-scripts/bond0 like so:
DEVICE=bond0
IPADDR=<Default VLAN IP>
NETMASK=<Default VLAN netmast>
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MII_NOT_SUPPORTED=yes
6) vconfig add eth0 2
7) vconfig add eth1 2
8) Setup /etc/sysconfig/network-scripts/eth0.2 and eth1.2 like so:
DEVICE=eth0.2
USERCTL=no
ONBOOT=yes
MASTER=bond0.2
SLAVE=yes
BOOTPROTO=none
MII_NOT_SUPPORTED=yes
VLAN=yes
9) bond0.2
DEVICE=bond0.2
IPADDR=<VLAN 2 IP>
NETMASK=<VLAN 2 netmask>
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MII_NOT_SUPPORTED=yes
VLAN=yes
10) restart networking
11) pray
