본문 바로가기
I T/Network

리눅스 Bonding 네트워크 설정.

by 루솨 2015. 8. 29.

Bonding 이란?

여러 개의 이더넷 어댑터를 하나로 묶어 네트워크 대역폭을 늘리거나, 한 개의 이더넷이 죽었을 경우 Redendency 할 수 있는 방법.
CISCO(시스코)에서는 "Etherchannel", Sun에서는 "Trunking", 리눅스 계통에서는 이와 대등한 개념으로 “Bonding”이라고 칭함.

이더넷 카드 3장 장착하여 본딩 구성하는 방법

▼ /etc/modprobe.conf 파일에 본딩 모듈 관련 설정 추가
[root@localhost ~]# cat /etc/modprobe.conf
alias bond0 bonding
options bond0 mode=0 miimon=100
alias eth0 e1000e
alias eth1 r8169
alias eth2 r8169
alias scsi_hostadapter 3w-9xxx
alias scsi_hostadapter1 pata_marvell
alias scsi_hostadapter2 ata_piix

### IPv6 OFF ###################
alias net-pf-10 off
alias ipv6 off

※ mode 0 : load balancing -> 각각의 물리 인터페이스로 균등하게 트래픽 분배
mode 1 : fault tolerance -> 장애 대비용, 평상시엔 한 개의 물리 인터페이스만 기능
mode 2 : load balancing (xor)
mode 3 : fault tolerance (broadcast)
mode 4 : IEEE 802.3ad Dynamic link aggregation
mode 0 로드 밸런싱 모드로 설정했을 시 한 개의 물리 인터페이스라도 장애가 발생하면 기능을 하지 못한다는 점에 유의한다.  (fault tolerance를 겸하는 게 아니라는 의미)

 

▼ bond0, eth0, eth1, eth2 인터페이스 설정
(bond0 인터페이스는 논리적으로 생성하는 가상의 인터페이스로 여기에 실 IP 할당)
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=xx.xx.xx.xx
NETMASK=xx.xx.xx.xx
ONBOOT=yes
USERCTL=no
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

 

[root@localhost network-scripts]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost
NETWORKING_IPV6=no
NOZEROCONF=yes
GATEWAY=xx.xx.xx.xx
GATEDEV=bond0

 

▼ 위와 같이 설정하고 시스템을 재부팅한 뒤 본딩 모듈이 제대로 올라왔는지 확인
[root@localhost network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

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

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:19:d1:82:da:ed

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:08:9f:f3:e2:18

Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:19:d1:82:da:ed

스위치 등의 네트워크 장비에서도 ‘이더 채널’과 같은 설정을 별도로 해 주어야 한다.

 [polldaddy rating="7739789"]