Skip to content

현재 거의 모든 서버들은 랜카드가 1G를 지원한다

하지만 백업서버나 대역폭을 요구하는 서버의 경우 1G 이상이 필요한데

그렇다고 10G 랜카드를 살수 없는것이고. 이럴때 사용하는 기능이 bonding  기술이다

리눅스에서 간단하게 구성할수 있다

환경 : CENTOS


1. bond1 인터페이스 추가

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0  

DEVICE=bond0
IPADDR=10.10.10.66
NETMASK=255.255.255.0
BROADCAST=10.10.10.255
GATEWAY=10.10.10.1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="mode=4 miimon=100"


저장

위에 옵션에서 mode 부분은 bond의 모드 부분이다

    [Bonding 모드 종류]

     0 : balance-round robine ( 2개의 NIC 통한 분배 +  Fault Tolerance )

        1 : active-standby ( Active상태의 NIC에 문제 발생시 Fault Tolerance )

     2 : balance-xor ( 0 비슷하지만 xor연산을 이용한 목적지 Mac 근원지 Mac 이용한

                 분배 +    Fault tolerance)

    3 : broadcast ( 2개의 NIC 어떤 규칙 없이 데이터 통신 +  Fault Tolerace)

       4 : 802.3ad (link aggregation) – switch aggregation 그룹생성이 필요




2. 실제 인터페이스 랜카드 eth0 / eth1 내용 수정

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes


[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes


네트워크 환경 설정 파일 내용 추가

[root@localhost ~]# vi /etc/sysconfig/network
추가
GATEDEV=bond0


3. 모듈 구성

[root@localhost ~]# vi /etc/modprobe.conf

추가
alias bond0 bonding
options bond0 miimon=100

[root@localhost ~]# modprobe bonding

[root@localhost ~]# lsmod | grep bonding
bonding               126649  0
ipv6                  432161  26 bonding,ip6t_REJECT


4. 네트워크 재시작 ( 여기서 네트워크를 재시작시 네트워크가 끊기는 현상이  있으니 로컬에서 작업하는것을 추천)

[root@localhost ~]# service network restart

5. 인터페이스 확인

bond0     Link encap:Ethernet  HWaddr 00:16:17:A2:F8:EB 
          inet addr:10.10.10.1  Bcast:10.10.10.255  Mask:255.255.255.0
          inet6 addr: fe80::216:17ff:fea2:f8eb/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:172575 errors:0 dropped:0 overruns:0 frame:0
          TX packets:239301 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:16180948 (15.4 MiB)  TX bytes:28025443 (26.7 MiB)

eth0      Link encap:Ethernet  HWaddr 00:16:17:A2:F8:EB 
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:164853 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15280216 (14.5 MiB)  TX bytes:7327202 (6.9 MiB)
          Interrupt:169 Memory:dd100000-dd110000

eth1      Link encap:Ethernet  HWaddr 00:16:17:A2:F8:EB 
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:7722 errors:0 dropped:0 overruns:0 frame:0
          TX packets:182040 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:900732 (879.6 KiB)  TX bytes:20698241 (19.7 MiB)
          Interrupt:193 Memory:dd310000-dd320000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:223 errors:0 dropped:0 overruns:0 frame:0
          TX packets:223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:55612 (54.3 KiB)  TX bytes:55612 (54.3 KiB)


실제 인터페이스는 2개이며 가상의 bond0 이라는 인터페이스 생성되었다
bond0의 인터페이스는 master이며 실제 물리적 인터페이스는  slave로 표시가 된다

그러면 이제 bonding 이 잘되었는지 확인해 본다



[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Active Aggregator Info:
        Aggregator ID: 3
        Number of ports: 2
        Actor Key: 17
        Partner Key: 1
        Partner Mac Address: 28:c0:da:37:69:00

Slave Interface: eth0
MII Status: up
Link Failure Count: 3
Permanent HW addr: 00:16:17:a2:f8:eb
Aggregator ID: 3

Slave Interface: eth1
MII Status: up
Link Failure Count: 4
Permanent HW addr: 00:16:17:a2:f8:ea
Aggregator ID: 3



위에서 bond모드를 4로 지정을 해서 802.3ad가 나온다 ( 상단에서 LACP기능을 구현)
만약 모드를  1로 지정할 경우 Round robin으로 나올것이다


리눅스 자체 서버에서  2G로 통신이 되는지는 확인할수 가 없어 상단 LACP를 구현한
SW에서 확인

root# run show interfaces ae0        
Physical interface: ae0, Enabled, Physical link is Up
  Interface index: 154, SNMP ifIndex: 162
  Link-level type: Ethernet, MTU: 1514, Speed: 2000mbps, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled,



profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/105681/35e/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
287 CentOS Samba 설정 ADMINPLAY 2010-11-08 24884
286 가볍고 강력한 SNMP를 이용한 모니터링 프로그램입니다. file ADMINPLAY 2009-10-31 24859
285 리눅스 - htop file ADMINPLAY 2010-09-12 24838
284 favicon 만들기 ADMINPLAY 2009-09-30 24835
283 네트워크 관리자를 위한 통합 모니터링 툴 - N.E.W.T file [2] ADMINPLAY 2009-10-31 24705
282 리눅스 - zip 압축 해제 ADMINPLAY 2009-07-25 24646
281 [CentOS] ffmpeg 설치 ADMINPLAY 2012-02-07 24495
280 리눅스 Proxy Server[Squid] 설정법[RedHatLinux8.0] ADMINPLAY 2009-11-26 24408
279 커널 컴파일 장애 처리 perl: warning: Please check that... ADMINPLAY 2009-08-08 24378
278 대용량 하드 디스크 파티셔닝 (GPT 파티션) ADMINPLAY 2009-06-04 24364
277 lighttpd와 Apache의 성능 차이 file [2] l2zeo 2012-03-08 24242
276 [Flash] 크로스 도메인 설정 방법 ADMINPLAY 2010-08-31 24233
275 로드밸런싱의 ‘꽃’, L4/L7 스위치 관심 집중 ADMINPLAY 2009-11-30 24151
274 kernel panic 발생 시 자동으로 리부팅 설정 ADMIN 2008-12-10 24084
273 하드웨어정보 확인(lshw) file ADMINPLAY 2008-11-03 24038
272 MRTG 소스 설치 ADMINPLAY 2010-05-11 24028
271 리눅스에서 특정 파일을 제외하고 삭제하기 ADMIN 2008-11-03 23970
270 VI 에디터 유니코드(UTF-8)로 인코딩 전환 ADMINPLAY 2010-04-02 23966
269 리눅스 공유 메모리의 설정 (세마포어) ADMINPLAY 2010-04-28 23950
268 젠투리눅스에서 잃어버린 암호를 다시 설정하기 ADMINPLAY 2010-04-15 23899

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234