Showing posts with label bonding. Show all posts
Showing posts with label bonding. Show all posts

Wednesday, July 9, 2014

How to config Bonding network interface on CentOS

1. เรียง interface ใหม่ โดยเข้าไปแก้ไฟล์
vi /etc/udev/rules.d/70-persistent-net.rules
2. แก้ไข modprob
vi /etc/modprobe.d/bonding.conf
โดย mode ที่เราจะใช้ จะเป็น mode 0 ซึ่งจะ config ดังนี้
options bond0 mode=1 miimon=100
อ้างอิง mode (https://wiki.centos.org/TipsAndTricks/BondingInterfaces)
mode=0 ==> Round-robin (Balance RR)
mode=1 ==> Active-Standby
mode=2 ==> Balance XOR
mode=3 ==> Broadcast
mode=4 ==> IEEE 802.3ad (Dynamic Link Aggregation or Cisco EtherChannel)
mode=5 ==> Adaptive Transmit Load Balancing (Balance TLB)
mode=6 ==> Adaptive Load Balancing (Balance ALB)
3. จากนั้น ให้ไปสร้างไฟล์ bonding ขึ้นมา ซึ่งโดยปกติแล้ว จะใช้ชื่อไฟล์ประมาณ ifcfg-bond0 ซึ่งจะสร้างไว้ใน /etc/sysconfig/network-scripts/
vi /etc/sysconfig/network-scripts/ifcfg-bond0
ตัวอย่าง config
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
TYPE="Unknown"
IPADDR=10.217.202.13
NETMASK=255.255.255.0
GATEWAY=10.217.202.254
DEFROUTE=yes
IPV6INIT=no
NAME="System bond0"
USERCTL=no
4. จากนั้น จะต้องไป config ไฟล์ ifcfg-eth0, ifcfg-eth1 เพื่อให้ทั้ง 2 Interface นั้น เป็น bonding interface โดย config ดังนี้
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:50:56:A2:55:01
IPV6INIT=no
NAME="System eth0"
USERCTL=no
MASTER=bond0
SLAVE=yes
DEVICE=eth1
BOOTPROTO=none
HWADDR=00:50:56:A2:55:02
ONBOOT=yes
MASTER=bond0
SLAVE=yes
IPV6INIT=no
USERCTL=no
5. จากนั้น reboot ก็เป็นอันเสร็จเรียบร้อยแล้วครับ