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/3d0/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
287 squid.conf : Reverse Proxy ADMINPLAY 2012-04-13 11862
» linux bonding (네트워크 2개를 1개의 인터페이스로 구성) ADMINPLAY 2012-06-26 12454
285 각종 데몬 이름 및 설명 ADMIN 2008-11-25 13782
284 [linux][명령어 백그라운드 실행] ADMINPLAY 2015-05-20 14742
283 rsync 미러링 백업 ADMINPLAY 2009-05-17 14845
282 Centos 6.0 사용장비 교체후 eth0,1이 eth2,3으로 밀리거... ADMINPLAY 2012-05-29 15122
281 vi(Visual) Editor 사용법 ADMINPLAY 2009-05-11 15339
280 리눅스 기본 명령어 # 2 ADMINPLAY 2009-05-11 15641
279 [리눅스] 파일의 속성관리를 위한 chattr실무활용 -2- ADMINPLAY 2009-09-09 15757
278 아쿠아앰프(aquamp) 설치 ADMIN 2008-10-30 16253
277 데몬(Daemon)이란? ADMINPLAY 2009-05-11 16346
276 알아두면 편리한 단축키(콘솔) ADMINPLAY 2009-05-22 16542
275 CentOS 6.X GUI 로그인 화면에서 로그인 했던 계정 리스트... ADMINPLAY 2014-03-05 16654
274 Disk Quota : 용량 제한 하기 ADMINPLAY 2009-05-22 16689
273 mrtg on freebsd , monitor windows2003 ADMINPLAY 2009-10-11 16783
272 리눅스 기본 명령어 # 1 ADMINPLAY 2009-05-11 16831
271 부분적으로 yum 업데이트 하고 싶을때 ADMIN 2008-11-10 17074
270 [Linux] Proxy 서버 설정하기 ADMINPLAY 2014-06-17 17102
269 snmpd 로그메세지 남기지 않기 ADMINPLAY 2011-04-28 17103
268 Ascii Art관련 사이트 링크 ADMINPLAY 2009-05-11 17265

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234