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/747/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수
287 <video>의 속성과 메소드 ADMINPLAY 2012-10-29 8226
286 FreeBSD 참고 명령문 ( H/W 정보 확인 방법) ADMINPLAY 2012-10-22 10191
285 GBIC(지빅) 이 뭘까?? file ADMINPLAY 2012-08-02 19183
284 GSLB(Global Service Load Balancing) ADMINPLAY 2012-07-30 10891
» linux bonding (네트워크 2개를 1개의 인터페이스로 구성) ADMINPLAY 2012-06-26 12454
282 TaskSet 으로 Process의 사용 CPU를 지정해 보자! ADMINPLAY 2012-06-18 10221
281 CentOS 4.x 에서 yum 실패 대처 ADMINPLAY 2012-06-13 23101
280 Centos 6.0 사용장비 교체후 eth0,1이 eth2,3으로 밀리거... ADMINPLAY 2012-05-29 15121
279 스퀴드(squid) 로그 로테이트 방법 ADMINPLAY 2012-05-18 7609
278 Squid 의 캐시 저장 기간 설정 ( refresh_pattern ) ADMINPLAY 2012-05-18 6872
277 rsync 를 이용하여 동기화 할때 특정 폴더 2개 이상 제외하기 ADMINPLAY 2012-05-09 10736
276 allowScriptAccess 설정 l2zeo 2012-05-05 8424
275 HTML5 멀티미디어 태그 - <video>,<audio>,<embed> ADMINPLAY 2012-05-02 8317
274 squid.conf : Reverse Proxy ADMINPLAY 2012-04-13 11862
273 ssh 특정 ip or 특정대역폭만 접속 허용 ADMINPLAY 2012-03-20 19527
272 lighttpd와 Apache의 성능 차이 file [2] l2zeo 2012-03-08 24242
271 squid.conf ADMINPLAY 2012-03-07 22738
270 [squid] 캐시 로그 결과 값(access_log) ADMINPLAY 2012-03-07 19783
269 linux - cp 덮어쓰기옵션 ADMINPLAY 2012-02-24 25692
268 ffmpeg 설치 및 활용 ADMINPLAY 2012-02-07 35507

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234