The following example is done on RHEL5 or CentOS5.
Short desc:
Why Bonding? To auto fail over or balance load on Ethernet interface.
Why VLAN? Save you some expensive physical network ports, special useful in virtualization.
Scenario:
Two Ethernet cards, connected to two separate switches, switch port are configured with VLAN 10, 100 and 200.
VLAN 10 is network 192.168.10.0/24 gateway 192.168.10.1
VLAN 100 is network 192.168.100.0/24 gateway 192.168.100.1
VLAN 200 is network 192.168.200.0/24 gateway 192.168.200.1
Example server should have IP 192.168.10.7, 192.168.100.34 and 192.168.200.233
Steps:
I. Bonding interfaces before VLAN
II. Add VLAN on bonded interface
Details:
Bonding
1. Edit /etc/modprobe.conf
alias bond0 bonding
options bond0 mode=1 miimon=100 use_carrier=0 primary=eth0
2. Edit /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
MASTER=bond0
SLAVE=yes
ONBOOT=yes
BOOTPROTO=static
Edit /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
MASTER=bond0
SLAVE=yes
ONBOOT=yes
BOOTPROTO=static
Edit /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
3. Add vlan, make sure you have vconfig installed. Also make sure it is loaded to kernel by "modprobe 8021q"
vconfig add bond0 10
vconfig add bond0 100
vconfig add bond0 200
Edit /etc/sysconfig/network-scripts/ifcfg-bond0.10
DEVICE=bond0.10
VLAN=yes
IPADDR="192.168.10.7"
NETMASK="255.255.255.0"
ONBOOT=yes
GATEWAY="192.168.10.1"
Edit /etc/sysconfig/network-scripts/ifcfg-bond0.100
DEVICE=bond0.100
VLAN=yes
IPADDR="192.168.100.34"
NETMASK="255.255.255.0"
ONBOOT=yes
GATEWAY="192.168.100.1"
Edit /etc/sysconfig/network-scripts/ifcfg-bond0.200
DEVICE=bond0.200
VLAN=yes
IPADDR="192.168.200.233"
NETMASK="255.255.255.0"
ONBOOT=yes
GATEWAY="192.168.200.1"
Important parameter to remember:
Bonding mode:
0 = balanced_rr # Round Robin Balanced
1 = active-backup # Active / Backup
primary indicate which interface is used first
miimon is link monitor frequency in milliseconds
VLAN
vconfig rem bond0.10 # for removing vlan 10 from bond0
No comments:
Post a Comment