Configuring bridging, bonding, vlans on CentOS/RedHat 6.x
/etc/sysconfig/network-scripts/ifcfg-em1 and em2
/etc/sysconfig/network-scripts/ifcfg-em1.vlanid (example ifcfg-em1.20)
/etc/sysconfig/network-scripts/ifcfg-bond (example ifcfg-bond20)
DEVICE=bond<vlanid> ONBOOT=yes BONDING_OPTS="mode=active-backup primary=em1 miimon=100" BOOTPROTO=none BRIDGE=br<vlanid> MACADDR=<RANDOM_MAC>
/etc/sysconfig/network-scripts/ifcfg-br (example ifcfg.br20)
So, creating 3 vlans (20, 200, 250) on a 2 interface bond (em1, em2) creates the following set of configfiles:
- ifcfg-em1:
-
Base configuration for em1
- ifcfg-em2:
-
Base configuration for em2
- ifcfg-em1.20:
-
Vlan 20 interface on em1 interface
- ifcfg-em1.200:
-
Vlan 200 interface on em1 interface
- ifcfg-em1.250:
-
Vlan 250 interface on em1 interface
- ifcfg-em2.20:
-
Vlan 20 interface on em2 interface
- ifcfg-em2.200:
-
Vlan 200 interface on em2 interface
- ifcfg-em2.250:
-
Vlan 250 interface on em2 interface
- ifcfg-bond20:
-
Bonding em1.20 with em2.20
- ifcfg-bond200:
-
Bonding em1.200 with em2.200
- ifcfg-bond250:
-
Bonding em1.250 with em2.250
- ifcfg-br20:
-
Create a bridge on bond20
- ifcfg-br200:
-
Create a bridge on bond200
- ifcfg-br250:
-
Create a bridge on bond250