게시물 261건
   
[RedHat] Bonding 구성
글쓴이 : 최장섭 날짜 : 2013-11-21 (목) 10:12 조회 : 5958
리눅스 본딩 - (Linux Bonding)
 
  • 스위치는 Ether 채널링을 지원하는 스위치가 필요하며, 서버의 리눅스 커널에서 bonding 을 지원하는 NIC 카드가 2장 있어야 한다.

  • Bonding 작업은 본딩 NIC 이외의 NIC 로 작업 해야 하며, 본딩 NIC 로 접속되어 있다면, 접속이 끊어지며 작업에 문제가 발생한다.
    (예 - eth0 로 접속 후 eth0 와 eth1 로 Bonding 하면 연결이 해제 된다. eth2 이후의 NIC 로 작업 해야 한다.)

  • Oracle Linux 에서는 ifcfg-ethxx 파일 내에 HW MAC 주소가 포함 되어 있지 않다면, 재부팅 후에 HBA 카드의 bus-info 정보가 변경되므로 반드시 작업 중에 HW MAC 주소 값을 넣어 주어야 한다.
  1. 우선 작업 진행 전에 lscpi 명령어를 이용하여 HBA 카드의 bus-info 정보를 확인 한다.

    06:00.0 Ethernet controller: NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter (rev 42)
    06:00.1 Ethernet controller: NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter (rev 42)
    09:00.0 Ethernet controller: NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter (rev 42)
    09:00.1 Ethernet controller: NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter (rev 42)

    여기서 06:00.0 부분이 HBA 카드가 연결된 포트의 번호 이다.
      
  2. ethtool -i NIC명 으로 Bus-info 를 확인 한다.

    [root@testServer network-scripts]# ethtool -i eth4
    driver: netxen_nic
    version: 4.0.65
    firmware-version: 4.0.585
    bus-info: 0000:09:00.0

    [root@testServer network-scripts]# ethtool -i eth6
    driver: netxen_nic
    version: 4.0.65
    firmware-version: 4.0.585
    bus-info: 0000:06:00.0

  3. Bus-info 정보를 토대로 Bonding 할 NIC 확인 후에 ifconfig 명령어를 통해서 해당 NIC 의 MAC 주소 값을 확인 한다.
    (여기서는 eth4, eth6 번을 Bonding 한다.)

    eth4      Link encap:Ethernet  HWaddr 80:C1:6E:A9:E3:F8 
              UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
              RX packets:82 errors:0 dropped:0 overruns:0 frame:0
              TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:4920 (4.8 KiB)  TX bytes:4750 (4.6 KiB)
              Interrupt:202

    eth6      Link encap:Ethernet  HWaddr E8:39:35:02:5F:00
              UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
              RX packets:266 errors:0 dropped:0 overruns:0 frame:0
              TX packets:208 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:25406 (24.8 KiB)  TX bytes:31242 (30.5 KiB)
              Interrupt:83

  4. ifcfg-eth4 파일을 열어 파일 내부를 수정 한다.
    [root@testServer network-scripts]# cat ifcfg-eth4
    # NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter
    DEVICE=eth4
    BOOTPROTO=none
    HWADDR=80:C1:6E:A9:E3:F8
    onBOOT=yes
    HOTPLUG=no
    MASTER=bond0
    SLAVE=yes
    USERCTL=no

    [root@testServer network-scripts]# cat ifcfg-eth6
    # NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter
    DEVICE=eth6
    BOOTPROTO=none
    HWADDR=E8:39:35:02:5F:00
    onBOOT=yes
    HOTPLUG=no
    MASTER=bond0
    SLAVE=yes
    USERCTL=no

  5. ifcfg-bond0 가상 NIC 를 만들어 준다.
    [root@testServer network-scripts]# cat ifcfg-bond0
    DEVICE=bond0
    IPADDR=10.217.45.73
    NETMASK=255.255.255.0
    GATEWAY=10.217.45.1

  6. /etc/modprobe.conf 파일을 수정
    - options bond0 miimon=100 mode=1 // Bonding 동작 옵션을 추가한다.
    - alias bond0 bonding 내용으로 추가해준다.

  7. service network restart 명령어로 네트워크 서비스를 재 시작 해준다.

  8. /proc/net/bonding/bond0 파일로 Bonding 이 정상적으로 작동하는지 확인한다.

    [root@testServer network-scripts]# cat /proc/net/bonding/bond0
    Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
    Bonding Mode: fault-tolerance (active-backup)
    Primary Slave: None
    Currently Active Slave: eth6
    MII Status: up
    MII Polling Interval (ms): 100
    Up Delay (ms): 0
    Down Delay (ms): 0
    Slave Interface: eth4
    MII Status: up
    Link Failure Count: 0
    Permanent HW addr: 80:c1:6e:a9:e3:f8
    Slave Interface: eth6
    MII Status: up
    Link Failure Count: 0
    Permanent HW addr: e8:39:35:02:5f:00

  9. 위 처럼 Bonding Mode 와 Currently Active Slave , MII Status 상태를 확인 한다.

  10. Bondig 작업이 완료가 되면, Bonding 이 정상적으로 되었는지 확인한다.

    1) ethttool -i 장치명 으로 펌웨어 버전을 확인한다.
    2) dmesg | grep -i flash version 버전으로 해당 버전 확인 후 dmesg 내에서 버전으로 검색하여 확인한다.


theko 2014-07-21 (월) 16:53
# RHEL 6 버전

[root@rhel6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.184.128
NETMASK=255.255.255.0
GATEWAY=192.168.184.1
BONDING_OPTS="miimon=100 mode=1"    

또는

[root@rhel6 ~]# cat /etc/modprobe.d/modprobe.conf       // 5 와 달리 modprobe.d 안에 들어간다.
options bond0 miimon=100 mode=1
alias bond0 bonding

theko 2016-03-23 (수) 14:39
options bonding mode=1 miimon=100 primary=eth0
이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com