Author Topic: ทำ bonding บน หมวกแดง enterprise 4 / Cent 4  (Read 7846 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ทำ bonding บน หมวกแดง enterprise 4 / Cent 4
« on: มกราคม 24, 2011, 11:56:22 AM »
Setting up bounding is easy with RHEL v4.0.

Step #1: Create a bond0 configuration file

Red Hat Linux stores network configuration in /etc/sysconfig/network-scripts/ directory. First, you
need to create bond0 config file:

# vi /etc/sysconfig/network-scripts/ifcfg-bond0   ###Append following lines to it: DEVICE=bond0
IPADDR=192.168.1.20
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes     ####Replace above IP address with your actual IP address. Save file and exit to shell prompt.

Step #2: Modify eth0 and eth1 config files:

Open both configuration using vi text editor and make sure file read as follows for eth0 interface

#vi  /etc/sysconfig/network-scripts/ifcfg-eth0    ##Modify/append directive as follows: DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=noneOpen eth1 configuration file using vi text editor:

# vi /etc/sysconfig/network-scripts/ifcfg-eth1

###Make sure file read as follows for eth1
interfaceEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=noneSave file and exit to shell prompt.

Step # 3: Load bond driver/module

Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You
need to modify kernel modules configuration file:

# vi /etc/modprobe.confAppend following two
lines:alias bond0 bonding
options bond0 mode=balance-alb miimon=100Save file and exit to shell prompt. You can learn more
about all bounding options in kernel source documentation file (click here to read file online).

Step # 4: Test configuration

First, load the bonding module:# modprobe bondingRestart networking service in order to bring up
bond0 interface:# service network restartVerify everything is working:# less
/proc/net/bonding/bond0Output:

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:59

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:63

List all interfaces:# ifconfigOutput:

bond0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:2804 errors:0 dropped:0 overruns:0 frame:0
TX packets:1879 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:250825 (244.9 KiB) TX bytes:244683 (238.9 KiB)

eth0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:2809 errors:0 dropped:0 overruns:0 frame:0
TX packets:1390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:251161 (245.2 KiB) TX bytes:180289 (176.0 KiB)
Interrupt:11 Base address:0x1400

eth1 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:258 (258.0 b) TX bytes:66516 (64.9 KiB)
Interrupt:10 Base address:0x1480

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ทำ bonding บน หมวกแดง enterprise 4 / Cent 4
« Reply #1 on: มกราคม 24, 2011, 02:02:38 PM »

Posts: 3


View Profile Email Personal Message (Offline)
   
   
Bonding / Link Aggregation / Teaming / Trunking (ไม่รู้จะเรียกว่าอะไรดี)
« on: November 22, 2010, 05:37:39 pm »
   Reply with quoteQuote Modify messageModify Remove messageRemove Split TopicSplit Topic
วิธีการทำ Bonding ใน CentOS

     1. เพิ่ม config ในไฟล์ /etc/modprobe.conf ซึ่งเป็นการเพิ่ม module ที่จะใช้
          alias bond0 bonding
          options bond0 miimon=100 mode=1
          # mode มีหลาย mode สามารถหาอ่านเพิ่มเติมได้จาก TipsAndTricks/BondingInterfaces - CentOS Wiki
     2. สร้างไฟล์ /etc/sysconfig/network-scripts/ifcfg-bond0
          DEVICE=bond0
          IPADDR=10.1.1.1
          NETMASK=255.255.255.0
          NETWORK=10.1.1.0
          BROADCAST=10.1.1.255
          GATEWAY=10.1.1.254
          ONBOOT=yes
          BOOTPROTO=none
          USERCTL=no
     3. สร้างไฟล์ /etc/sysconfig/network-scripts/ifcfg-eth0 และ /etc/sysconfig/network-scripts/ifcfg-eth1 (หากมี interface มากกว่านั้น สามารถเพิ่มเติมได้)
          DEVICE=eth0
          ONBOOT=yes
          BOOTPROTO=none
          USERCTL=no
          MASTER=bond0
          SLAVE=yes
     4. ทำการ restart network
          service network restart
     5. monitor bonding ด้วย คำสั่ง
          cat /proc/net/bonding/bond0

reference: TipsAndTricks/BondingInterfaces - CentOS Wiki

ขอบคุณข้อมูลจากพี่บอย puka ครับ

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ทำ bonding บน หมวกแดง enterprise 4 / Cent 4
« Reply #2 on: สิงหาคม 15, 2011, 11:16:29 AM »
ถ้าต้องการทำการ เชค bandwidth การใช้งาน ของ interface ก็
ข้อแม้ ต้องทราบชื่อ interface ด้วยนะครับผม

[root@proxy1 golf]# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: g
        Link detected: yes